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

Different interface for objectPath.insert()? #21

Open
mariocasciaro opened this issue Sep 23, 2014 · 1 comment
Open

Different interface for objectPath.insert()? #21

mariocasciaro opened this issue Sep 23, 2014 · 1 comment
Labels
Milestone

Comments

@mariocasciaro
Copy link
Owner

Instead of:

objectPath.insert(obj, "a.c", "m", 1);

Shouldn't it be:

objectPath.insert(obj, "a.c.1", "m");

To be consistent with the rest of the API?

@pocesar
Copy link
Collaborator

pocesar commented Sep 23, 2014

it mimicks splice, with a default to zero (splice has no default, it removes the item if the value is not set), if you call it without the 1 at the end, it will work as a unshift, IMHO, this can only happen by having a separated (and not part of the path) parameter

@pocesar pocesar modified the milestone: 1.0.0 May 12, 2015
@pocesar pocesar added the plugin label May 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants