1.0.1 • Published 8 years ago

real-types v1.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

#real-types

Converts strings to corresponding types.

travis build

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