Skip to content

Conversation

@manrueda
Copy link
Contributor

I was in the need of exclude nested values of an objects, so extend the omit function to work with paths.

It's a heavy function, but does what need to do...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing a backtick. And the semicolon is unnecessary. 😄

@joshuacc
Copy link
Contributor

joshuacc commented Oct 4, 2014

@manrueda I think this should probably go into the object.builders module.

Then you can use _.snapshot internally and just delete the value at the path.

@jgonggrijp jgonggrijp added before modules This needs to be tackled before modularization (temporary label, see #220) enhancement labels Aug 7, 2020
@jgonggrijp jgonggrijp self-assigned this Aug 30, 2020
jgonggrijp added a commit to jgonggrijp/underscore-contrib that referenced this pull request Aug 31, 2020
jgonggrijp added a commit to jgonggrijp/underscore-contrib that referenced this pull request Aug 31, 2020
…ntcloud#177

Also reimplements the function as suggested by @joshuacc. More tests
pass in this way, but still not all.

This is somewhat inconsistent; arguably, _.omitWhen, _.pickWhen and
_.selectKeys belong in object.builders, too.
jgonggrijp added a commit to jgonggrijp/underscore-contrib that referenced this pull request Aug 31, 2020
jgonggrijp added a commit to jgonggrijp/underscore-contrib that referenced this pull request Aug 31, 2020
@jgonggrijp jgonggrijp merged commit d5a5695 into documentcloud:master Sep 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

before modules This needs to be tackled before modularization (temporary label, see #220) enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants