Skip to content

Feature request: Insert to Array option #36

@havardthom

Description

@havardthom

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions