(root: BaseRoot)
| 474 | // helpers and node layout it calls into, is never bound to a node: a key it |
| 475 | // doesn't match falls back to compiling it |
| 476 | const precompiledKeyOf = (root: BaseRoot): string => { |
| 477 | let childCounts = "" |
| 478 | for (const id in root.byId) { |
| 479 | const node = root.byId[id] |
| 480 | childCounts += `${node.children.length}${node.is("optional") && node.defaultsUndefined ? "u" : ""},` |
| 481 | if (node.is("structure") && node.order) |
| 482 | childCounts += `[${node.inOrder.map(prop => node.props.indexOf(prop))}]` |
| 483 | } |
| 484 | const content = |
| 485 | root.hash.includes(`"$ark.`) ? keyRegisteredNames(root) : root.hash |
| 486 | return hashOf( |
| 487 | `${arkUtilVersion}\n${content}\n${childCounts}\n${$ark.sets !== undefined}` |
| 488 | ) |
| 489 | } |
| 490 | |
| 491 | // registered names and minified function names vary by program |
| 492 | const keyRegisteredNames = (root: BaseRoot): string => { |
no test coverage detected