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

Feature request: Insert to Array option #36

Open
havardthom opened this issue Oct 5, 2021 · 0 comments · May be fixed by #37
Open

Feature request: Insert to Array option #36

havardthom opened this issue Oct 5, 2021 · 0 comments · May be fixed by #37

Comments

@havardthom
Copy link

I'm missing an option to insert value into Array instead of overwriting the existing value. Similar to the merge option that currently exists for Objects. Something like:

obj = {"path": {"to": {"array": ["oldValue"]}}}
set(obj, ["path", "to", "array", 0], "newValue", { insert: true ))

console.log(obj)
{"path": {"to": {"array": ["newValue", "oldValue"]}}}

I checked out the related projects but did not find a way to do this, please let me know if I missed something.

@havardthom havardthom linked a pull request Oct 6, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants