deepy

    0.1.2 • Public • Published

    Deepy

    Build Status

    A fast algorithm for value comparison and equality of value types.

    It's build for performance, and supports ES6 primitives among other things.

    Loosely based on algorithms from NodeJS, Jasmine, Lodash and others.

    Install

    $ npm install --save deepy

    Usage

    Returns either true or false depends if the values are the same according to the algorithm or not.

     
    let deepy = require('deepy')
     
    deepy({a: 0}, {a: false}) // false
    deepy(['a'], {0: 'a'}) // false
    deepy({a: 1}, {a: 1}) // true
    deepy('/a/igmm', '/a/igm') // false
    deepy(
        [
            {foo: {z: 100, y: 200, x: 300}},
            'bar',
            11,
            {baz: {d: 4, a: 1, b: 2, c: 3}}
        ],
        [
            {foo: {z: 100, y: 200, x: 300}},
            'bar',
            11,
            {baz: {d: 4, a: 1, b: 2, c: 3}}
        ]
    ) // true
     

    Install

    npm i deepy

    DownloadsWeekly Downloads

    2

    Version

    0.1.2

    License

    none

    Last publish

    Collaborators

    • kflash123