alisonmonteiro / shoe-size-converter

Converts footwear (shoe) sizes using a collection of sizing systems 👟
https://npm.im/shoe-size-converter
MIT License
21 stars 5 forks source link

Iso #4

Closed cjblomqvist closed 4 years ago

cjblomqvist commented 4 years ago

Complete rework of the whole package. Adds a new API interface, to support a wider range of scenarios, while still being very flexible/customizable, as well as tree shakable. Now supports virtually any size, and size ranges, have a base/default system which follows the ISO standardization specification (more or less anyway). It also adds pretty printing (including handling it both ways).

Note: This breaks backwards compatibility. It should be fairly trivial to add backward compatibility, at least using the new API (i.e. work with the old size table), by adding a new systems collection that is based off the old sizing table. I guess the API could also relatively easily be added as a separate function.

If you prefer, feel free to add me as npm collaborator/owner if you'd like me to handle pushing to npm and all that.

PS. Sorry for the last huge commit.

cjblomqvist commented 4 years ago

To add som background on the why... The current version is quite limited. The most critical part is the lack of sizes which it works with. This could be remedied using a larger sizing table. Eventually, you'll realize that sizing tables only take you so far. After doing some significant research, one can conclude that:

To support the ISO structure, while still keeping it flexible/customizable, it was better to add the "systems collections" concept, with ISO being the default/standard to use. The benefits of this new "collection of systems" approach is that:

Let me know your thoughts! In case this is all too much and you don't want to dig deeper into footwear sizing conversion (as I apparently have - I work for a company working with footwear sourcing globally with buyers/suppliers on all continents and 50+ countries - hence my interest in this...), let me know and I'll happily help you out in maintaining this for the future (this seems to be the only package I could find in the JS/Node world (and C# world) that deals with conversion - so seems like a worthwhile effort to create a standard here).

alisonmonteiro commented 4 years ago

Hey @cjblomqvist. Wow :scream:

It looks great! I will take a look and get back to you soon. Thank you!

cjblomqvist commented 4 years ago

Thanks! Don't forget to publish a new version! 🙂

cjblomqvist commented 4 years ago

Never mind, I'm guessing you're planning on giving me access to do it myself 😊

alisonmonteiro commented 4 years ago

@cjblomqvist beautiful. Please, do it! What about that one being the v0.1.0. Thanks again for your incredible work.

alisonmonteiro commented 4 years ago

Also, can we export the old table in order to keep backward compatibility with Brazilian size? Thanks!