2.20.0-next.1600602846.f79109c061ae84ab2b029155e3fabd678b4f3649 • Published 5 years ago

normalify v2.20.0-next.1600602846.f79109c061ae84ab2b029155e3fabd678b4f3649

Weekly downloads
1,456
License
MIT
Repository
github
Last release
5 years ago

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

Usage

Complete API Documentation.

import normalify from 'normalify'
const nan = 0 / 0
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
  }
}
*/

npm

Deno

import pkg from 'https://unpkg.com/normalify@^2.20.0/edition-deno/index.ts'

Skypack

<script type="module">
    import pkg from '//cdn.skypack.dev/normalify@^2.20.0'
</script>

unpkg

<script type="module">
    import pkg from '//unpkg.com/normalify@^2.20.0'
</script>

jspm

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

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

2 years ago

2.30.0

2 years ago

2.26.0

2 years ago

2.29.0

2 years ago

2.25.0

2 years ago

2.28.0

2 years ago

2.24.0

4 years ago

2.22.0

4 years ago

2.21.0

5 years ago

2.20.0

5 years ago

2.19.0

5 years ago

2.18.0

5 years ago

2.16.0

5 years ago

2.15.0

5 years ago

2.14.0

5 years ago

2.13.0

5 years ago

2.11.0

6 years ago

2.10.0

6 years ago

2.9.0

6 years ago

2.7.0

6 years ago

2.6.0

6 years ago

2.5.0

6 years ago

2.4.0

6 years ago

2.3.0

6 years ago

2.2.0

6 years ago

2.1.0

6 years ago

2.0.0

6 years ago

1.1.0

10 years ago

1.0.0

13 years ago