0.1.3 • Published 5 years ago

n-tools v0.1.3

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

n-tools

开发工具函数

methods

namenoteother
typeof
compareObject复杂类型数据比较
deepClone深拷贝
extend
merge
arrayEquals数组比较
keepDecimal
formatDigital
deepGet深获取

Usage

    let _ = require( 'n-tools' );

    _.compareObject(x, y);

deepGet

var obj = {
    a: [
        {
            b: {
                c: 3
            }
        }
    ],
    e: {
        f: [
            {
                g: 'alj'
            },
            {
                g: 'kakaka'
            }
        ]
    }
};

var result = '';

for(var kk = 0; kk < 3; kk++) {
	result = _.deepGet(obj, 'e.f[' + kk +'].g', '');
	console.log(result);
}

// 'alj'
// 'kakaka'
// ''
0.1.3

5 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.9

6 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago