Skip to content
This repository has been archived by the owner on Sep 9, 2021. It is now read-only.

nikitasfrs/real-types

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

real-types

Converts strings to the 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));

Above code will print:

{
    foo: false,
    bar: [1,5,9],
    next: {
        label: 'foo',
        value: 10
    }
};

License

MIT

About

Converts strings to corresponding types.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published