Skip to content

Commit

Permalink
examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jonschlinkert committed Jan 2, 2017
1 parent bf19529 commit 730e6c9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .verb.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
```js
var omitDeep = require('{%= name %}');

omitDeep({a: 'a', b: 'b', c: {b: 'b', d: {b: 'b', f: 'f'}}});
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:

```js
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: {} } }
```
9 changes: 9 additions & 0 deletions example.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
var omitDeep = require('./');
var res = omitDeep({a: 'a', b: 'b', c: {b: 'b', d: {b: 'b', f: 'f'}}}, ['b']);
//=> {a: 'a', c: {d: {f: 'f'}}}

console.log(res);

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: {} } }

0 comments on commit 730e6c9

Please sign in to comment.