( object: Object, data: DehydratedData, path: InspectedElementPath, value: any, )
| 649 | } |
| 650 | |
| 651 | export function fillInPath( |
| 652 | object: Object, |
| 653 | data: DehydratedData, |
| 654 | path: InspectedElementPath, |
| 655 | value: any, |
| 656 | ) { |
| 657 | const target = getInObject(object, path); |
| 658 | if (target != null) { |
| 659 | if (!target[meta.unserializable]) { |
| 660 | delete target[meta.inspectable]; |
| 661 | delete target[meta.inspected]; |
| 662 | delete target[meta.name]; |
| 663 | delete target[meta.preview_long]; |
| 664 | delete target[meta.preview_short]; |
| 665 | delete target[meta.readonly]; |
| 666 | delete target[meta.size]; |
| 667 | delete target[meta.type]; |
| 668 | } |
| 669 | } |
| 670 | |
| 671 | if (value !== null && data.unserializable.length > 0) { |
| 672 | const unserializablePath = data.unserializable[0]; |
| 673 | let isMatch = unserializablePath.length === path.length; |
| 674 | for (let i = 0; i < path.length; i++) { |
| 675 | if (path[i] !== unserializablePath[i]) { |
| 676 | isMatch = false; |
| 677 | break; |
| 678 | } |
| 679 | } |
| 680 | if (isMatch) { |
| 681 | upgradeUnserializable(value, value); |
| 682 | } |
| 683 | } |
| 684 | |
| 685 | setInObject(object, path, value); |
| 686 | } |
| 687 | |
| 688 | export function hydrate( |
| 689 | object: any, |
no test coverage detected