Skip to content

v1.0.0

Compare
Choose a tag to compare
@alisonmonteiro alisonmonteiro released this 30 Jun 12:38
· 4 commits to master since this release
bfb104d

Overview

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).

import {convert, iso} from 'shoe-size-converter';

convert({size: 36.5, system: 'eu'}, iso);
// =>
[{
	size: 4,
	prettySize: '4',
	system: 'au',
	men: true
}, {
	size: 6,
	prettySize: '6',
	system: 'au',
	women: true
}, {
	size: 5,
	prettySize: '5',
	system: 'brannock',
	men: true
}, {
	size: 6,
	prettySize: '6',
	system: 'brannock',
	women: true
}, {
	size: 23,
	system: 'cm',
	unisex: true
}, {
	size: 36.5,
	system: 'eu',
	unisex: true
}, {
	size: 230,
	system: 'mondopoint',
	unisex: true
}, {
	size: 3.5,
	prettySize: '3 1/2',
	system: 'mx',
	men: true,
	women: true
}, {
	size: 4,
	prettySize: '4',
	system: 'uk',
	men: true,
	women: true
}, {
	size: 5,
	prettySize: '5',
	system: 'us',
	men: true
}, {
	size: 6,
	prettySize: '6',
	system: 'us',
	women: true
}]

Table-based system (and backward compatibility)

There's a table-based system's collection which can be used instead of iso:

import {convert} from 'shoe-size-converter';
import {table} from 'shoe-size-converter/systems/table';

convert({size: 36.5, system: 'eu'}, table);

Currently, it's based on the old sizing table, which means it can be used to have the same conversion as version 0.0.5 and earlier, BUT with the new API.

The old conversion table can be found in the size-tables.js file, along with other conversion tables.

Huge thanks to @cjblomqvist 🎉