Skip to content

Commit

Permalink
addressed PR comment for original object
Browse files Browse the repository at this point in the history
  • Loading branch information
David Annopolsky committed Oct 6, 2015
1 parent 7893092 commit 3ee3112
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion documentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1535,7 +1535,6 @@ const omit = require('1-liners/omit');
const object = {foo: 1, bar: 2, baz: 3};

omit(['foo', 'baz'], object); // => {bar: 2}
object; // => {foo: 1, bar: 2, baz: 3}
```

<div align="right"><sup>
Expand Down
2 changes: 1 addition & 1 deletion module/omit.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* const object = {foo: 1, bar: 2, baz: 3};
*
* omit(['foo', 'baz'], object); // => {bar: 2}
* object; // => {foo: 1, bar: 2, baz: 3}
*
*
*/
export default (props:Array, object) => Object.keys(object).reduce((res, k) => Object.assign(res, props.includes(k) ? null : {[k]: object[k]}), {});

0 comments on commit 3ee3112

Please sign in to comment.