real-types
v1.0.1
Published
Converts strings to corresponding types.
Downloads
9
Readme
#real-types
Converts strings to corresponding types.
Originally written as a quick way to convert form input values to corresponding types.
Install
Install using npm
npm install real-types
Usage
import convert from 'real-types'
const example = {
foo: 'false',
bar: ['1', '5', '9'],
next: {
label: 'foo',
value: '10'
}
};
console.log(convert(example));
Executing code above will print:
{
foo: false,
bar: [1,5,9],
next: {
label: 'foo',
value: 10
}
};
License
MIT