2.30.0 • Published 4 months ago

normalify v2.30.0

Weekly downloads
1,456
License
Artistic-2.0
Repository
github
Last release
4 months ago

Normalize different variable value types - e.g. "1" becomes 1

npm

jspm

<script type="module">
    import * as pkg from '//dev.jspm.io/normalify'
</script>

Usage

const 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:

2.27.0

6 months ago

2.30.0

5 months ago

2.26.0

6 months ago

2.29.0

5 months ago

2.25.0

6 months ago

2.28.0

5 months ago

2.24.0

3 years ago

2.22.0

3 years ago

2.21.0

4 years ago

2.20.0

4 years ago

2.19.0

4 years ago

2.18.0

4 years ago

2.16.0

4 years ago

2.15.0

4 years ago

2.14.0

4 years ago

2.13.0

4 years ago

2.11.0

4 years ago

2.10.0

4 years ago

2.9.0

4 years ago

2.7.0

4 years ago

2.6.0

4 years ago

2.5.0

4 years ago

2.4.0

4 years ago

2.3.0

4 years ago

2.2.0

4 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.1.0

8 years ago

1.0.0

11 years ago