DEV Community

Discussion on: My first Vue npm package

Collapse
 
htndev profile image
Oleksandr Vanilchuk

Very nice Hildor!
But I think, you need to refactor your code.
For example:

[
'636368', '438935',
'504175', '451416',
'509048', '509067',
'509049', '509069',
'509050', '509074',
'509068', '509040',
'509045', '509051',
'509046', '509066',
'509047', '509042',
'509052', '509043',
'509064', '509040',
].includes(cNumber.slice(0, 6))

It's mystic numbers that can't give any description. I hope you won't stop and will continue developing your pretty component!

Collapse
 
hildorjr profile image
Hildor Júnior

Thanks for replying, so in this case what do you suggest? Maybe assigning the array to a "const brandNumbers"?

Collapse
 
htndev profile image
Oleksandr Vanilchuk

I can recommend you to create @/constants.js and import it.
In the future, it will help you to scale your component.

Thread Thread
 
hildorjr profile image
Hildor Júnior

Right, great idea, i will be implementing this soon!

Thanks, Alexandr.

Thread Thread
 
htndev profile image
Oleksandr Vanilchuk

Feel free to contact me.
I'm interested to write the same component for my own project. :)