Skip to content

Commit d358b32

Browse files
committed
handle array in Path.set
1 parent d6eaf97 commit d358b32

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/parsers/path.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,9 @@ exports.set = function (obj, path, val) {
302302
warnNonExistent(path)
303303
}
304304
} else {
305-
if (key in obj) {
305+
if (_.isArray(obj)) {
306+
obj.$set(key, val)
307+
} else if (key in obj) {
306308
obj[key] = val
307309
} else {
308310
obj.$add(key, val)

0 commit comments

Comments
 (0)