( object: Object, path: Array<string | number>, value: any, )
| 668 | } |
| 669 | |
| 670 | export function setInObject( |
| 671 | object: Object, |
| 672 | path: Array<string | number>, |
| 673 | value: any, |
| 674 | ) { |
| 675 | const length = path.length; |
| 676 | const last = path[length - 1]; |
| 677 | if (object != null) { |
| 678 | const parent = getInObject(object, path.slice(0, length - 1)); |
| 679 | if (parent) { |
| 680 | parent[last] = value; |
| 681 | } |
| 682 | } |
| 683 | } |
| 684 | |
| 685 | export type DataType = |
| 686 | | 'array' |
no test coverage detected