$ npm install normalify
Normalize different variable value types - e.g. "1"
becomes 1
npm install --save normalify
require('normalify')
<script type="module">
import * as pkg from '//dev.jspm.io/normalify'
</script>
This package is published with the following editions:
normalify/source/index.ts
is typescript source code with import for modulesnormalify/edition-browsers/index.js
is typescript compiled for browsers with import for modulesnormalify
aliases normalify/edition-node-13/index.js
normalify/edition-node-13/index.js
is typescript compiled for node.js 13 with require for modulesconst nan = 0 / 0
const normalify = require('normalify').default
const result = normalify({
a: 'one',
b: '1',
c: '1.1',
d: 1,
e: 1.1,
f: "'hello'",
g: '"world"',
h: 'NaN',
i: nan,
j: 'true',
k: true,
l: 'false',
m: false,
n: 'null',
o: null,
z: {
a: 'one',
b: '1',
c: '1.1',
d: 1,
e: 1.1,
f: "'hello'",
g: '"world"',
h: 'NaN',
i: nan,
j: 'true',
k: true,
l: 'false',
m: false,
n: 'null',
o: null
}
})
console.log(result)
/* ouputs:
{
a: 'one',
b: 1,
c: 1.1,
d: 1,
e: 1.1,
f: 'hello',
g: 'world',
h: NaN,
i: NaN,
j: true,
k: true,
l: false,
m: false,
n: null,
o: null,
z: {
a: 'one',
b: 1,
c: 1.1,
d: 1,
e: 1.1,
f: 'hello',
g: 'world',
h: NaN,
i: NaN,
j: true,
k: true,
l: false,
m: false,
n: null,
o: null
}
}
*/
Discover the release history by heading on over to the HISTORY.md
file.
Discover how you can contribute by heading on over to the CONTRIBUTING.md
file.
These amazing people are maintaining this project:
These amazing people have contributed finances to this project:
Become a sponsor!
These amazing people have contributed code to this project:
Discover how you can contribute by heading on over to the CONTRIBUTING.md
file.
Unless stated otherwise all works are:
and licensed under:
© 2010 - cnpmjs.org x YWFE | Home | YWFE