Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consider returning the target object from set #6

Closed
focusaurus opened this issue Nov 30, 2014 · 2 comments
Closed

consider returning the target object from set #6

focusaurus opened this issue Nov 30, 2014 · 2 comments

Comments

@focusaurus
Copy link

I migrated from a similar module called lodash-deep. It had the nice feature that the set function would return the target object, so you could make a new object from a literal and assign it like this:

var req = pathval.set({}, 'session.token.modelId', new ObjectID());

In pathval, req ends up undefined here.

@keithamus
Copy link
Member

@lucasfcosta think we should add this? Seems reasonable.

@lucasfcosta
Copy link
Member

@keithamus seems reasonable to me too. Looks like a good idea.
I'll work on it as soon as I get some free time this weekend, it may be a pretty simple thing to do.

keithamus added a commit that referenced this issue Oct 11, 2016
feat: setPathValue returns the object in which the value was set. Closes #6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants