Skip to content

Commit f94814b

Browse files
committed
fix pop method
1 parent 8975544 commit f94814b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/datapack_changes.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,8 @@ function applyToValue(json: {[key: string]: any}, value_path: string, value: Dat
347347

348348
case "pop":
349349
let arr = json[last_key] as Array<any>;
350-
delete arr[typeof value === "string" ? parseInt(value) : value as number];
350+
value = typeof value === "string" ? parseInt(value) : value as number;
351+
arr.splice(value, 1);
351352
json[last_key] = arr;
352353
break;
353354

0 commit comments

Comments
 (0)