(node: Structure.Node)
| 95 | |
| 96 | // a sequence declares its indices, and "reject" checks only string keys |
| 97 | export const allowedKeysOf = (node: Structure.Node): BaseRoot => { |
| 98 | let keys = allowedKeys.get(node) |
| 99 | if (!keys) { |
| 100 | keys = node.keyof() |
| 101 | if (node.sequence) |
| 102 | keys = keys.rawOr($ark.kw.nonNegativeIntegerString.internal) |
| 103 | if (node.undeclared === "reject") keys = keys.rawOr($ark.kw.symbol.internal) |
| 104 | allowedKeys.set(node, keys) |
| 105 | } |
| 106 | return keys |
| 107 | } |
| 108 | |
| 109 | // how many leading indices are checked one by one for a bound |
| 110 | const maxCountedIndices = 1024 |
no test coverage detected