object-path
object-path copied to clipboard
Different interface for objectPath.insert()?
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?
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