Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/realign/n-tools
a util tool for dev
https://github.com/realign/n-tools
Last synced: 8 days ago
JSON representation
a util tool for dev
- Host: GitHub
- URL: https://github.com/realign/n-tools
- Owner: ReAlign
- Created: 2017-10-16T05:47:34.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-07-21T12:35:45.000Z (over 4 years ago)
- Last Synced: 2024-10-06T12:18:27.948Z (about 1 month ago)
- Language: JavaScript
- Size: 29.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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'
// ''
```