@13protons/omit-deep 中文文档教程
omit-deep
递归地从对象中省略指定的一个或多个键。
Install
使用 npm 安装:
$ npm install --save omit-deep
Usage
var omitDeep = require('omit-deep');
var obj = {a: 'a', b: 'b', c: {b: 'b', d: {b: 'b', f: 'f'}}};
console.log(omitDeep(obj, ['b']));
//=> {a: 'a', c: {d: {f: 'f'}}}
var obj = {a: 'a', b: 'b', c: {b: 'b', d: {b: 'b', f: 'f'}}};
console.log(omitDeep(obj, ['b', 'f']));
//=> {a: 'a', c: {d: {}}}
也适用于点符号:
var obj = {a: 'a', b: 'b', c: {b: 'b', d: {b: 'b', f: 'f'}}};
console.log(omitDeep(obj, ['c.d.b', 'f']));
//=> { a: 'a', b: 'b', c: { b: 'b', d: {} } }
About
Contributing
Pull requests 和 stars 总是受欢迎的。 对于错误和功能请求,请创建一个问题。
Contributors
Commits | Contributor |
---|---|
18 | jonschlinkert |
2 | splodingsocks |
1 | rikukissa |
Building docs
(本文档由 verb-generate-readme 生成(a verb 生成器),请不要直接编辑自述文件。对自述文件的任何更改都必须在 .verb 中进行。 md.)
使用 verb 生成自述文件和 API 文档:
$ npm install -g verb verb-generate-readme && verb
Running tests
安装开发依赖项:
$ npm install -d && npm test
Author
乔恩·施林克特
License
版权所有 © 2017,乔恩·施林克特。 根据 MIT 许可证 发布。
此文件由 verb-generate-readme,v0.2.1,于 2017 年 1 月 1 日生成。
omit-deep
Recursively omit the specified key or keys from an object.
Install
Install with npm:
$ npm install --save omit-deep
Usage
var omitDeep = require('omit-deep');
var obj = {a: 'a', b: 'b', c: {b: 'b', d: {b: 'b', f: 'f'}}};
console.log(omitDeep(obj, ['b']));
//=> {a: 'a', c: {d: {f: 'f'}}}
var obj = {a: 'a', b: 'b', c: {b: 'b', d: {b: 'b', f: 'f'}}};
console.log(omitDeep(obj, ['b', 'f']));
//=> {a: 'a', c: {d: {}}}
Also works with dot-notation:
var obj = {a: 'a', b: 'b', c: {b: 'b', d: {b: 'b', f: 'f'}}};
console.log(omitDeep(obj, ['c.d.b', 'f']));
//=> { a: 'a', b: 'b', c: { b: 'b', d: {} } }
About
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Contributors
Commits | Contributor |
---|---|
18 | jonschlinkert |
2 | splodingsocks |
1 | rikukissa |
Building docs
(This document was generated by verb-generate-readme (a verb generator), please don't edit the readme directly. Any changes to the readme must be made in .verb.md.)
To generate the readme and API documentation with verb:
$ npm install -g verb verb-generate-readme && verb
Running tests
Install dev dependencies:
$ npm install -d && npm test
Author
Jon Schlinkert
License
Copyright © 2017, Jon Schlinkert. Released under the MIT license.
This file was generated by verb-generate-readme, v0.2.1, on January 01, 2017.