| 609 | } |
| 610 | |
| 611 | function dehydrateKey( |
| 612 | parent: Object, |
| 613 | key: number | string | symbol, |
| 614 | cleaned: Array<Array<string | number>>, |
| 615 | unserializable: Array<Array<string | number>>, |
| 616 | path: Array<string | number>, |
| 617 | isPathAllowed: (path: Array<string | number>) => boolean, |
| 618 | level: number = 0, |
| 619 | ): DehydratedData['data'] { |
| 620 | try { |
| 621 | return dehydrate( |
| 622 | parent[key], |
| 623 | cleaned, |
| 624 | unserializable, |
| 625 | path, |
| 626 | isPathAllowed, |
| 627 | level, |
| 628 | ); |
| 629 | } catch (error) { |
| 630 | let preview = ''; |
| 631 | if ( |
| 632 | typeof error === 'object' && |
| 633 | error !== null && |
| 634 | typeof error.stack === 'string' |
| 635 | ) { |
| 636 | preview = error.stack; |
| 637 | } else if (typeof error === 'string') { |
| 638 | preview = error; |
| 639 | } |
| 640 | cleaned.push(path); |
| 641 | return { |
| 642 | inspectable: false, |
| 643 | preview_short: '[Exception]', |
| 644 | preview_long: preview ? '[Exception: ' + preview + ']' : '[Exception]', |
| 645 | name: preview, |
| 646 | type: 'unknown', |
| 647 | }; |
| 648 | } |
| 649 | } |
| 650 | |
| 651 | export function fillInPath( |
| 652 | object: Object, |