n-tools

0.1.3 • Public • Published

n-tools

开发工具函数

methods

name note other
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'
// ''

Readme

Keywords

none

Package Sidebar

Install

npm i n-tools

Weekly Downloads

0

Version

0.1.3

License

ISC

Unpacked Size

31.3 kB

Total Files

25

Last publish

Collaborators

  • realign