( object: Object, path: Array<string | number>, )
| 629 | } |
| 630 | |
| 631 | export function deletePathInObject( |
| 632 | object: Object, |
| 633 | path: Array<string | number>, |
| 634 | ) { |
| 635 | const length = path.length; |
| 636 | const last = path[length - 1]; |
| 637 | if (object != null) { |
| 638 | const parent = getInObject(object, path.slice(0, length - 1)); |
| 639 | if (parent) { |
| 640 | if (isArray(parent)) { |
| 641 | parent.splice(((last: any): number), 1); |
| 642 | } else { |
| 643 | delete parent[last]; |
| 644 | } |
| 645 | } |
| 646 | } |
| 647 | } |
| 648 | |
| 649 | export function renamePathInObject( |
| 650 | object: Object, |
no test coverage detected