(structure: StructureNode)
| 211 | |
| 212 | // a key two constraints transform, each reading the value as it received it |
| 213 | const transformsKeyTwice = (structure: StructureNode): boolean => { |
| 214 | const writes = (node: BaseNode) => |
| 215 | node.hasAlias || |
| 216 | node.references.some( |
| 217 | reference => reference.is("structure") && reference.tfs |
| 218 | ) |
| 219 | const index = structure.index?.filter(index => index.value.tfs) ?? [] |
| 220 | if (!index.length) return false |
| 221 | if (index.length > 1 && index.some(index => writes(index.value))) return true |
| 222 | return structure.props.some(prop => { |
| 223 | const steps = structure.tfsOf(prop) |
| 224 | return steps.length > 1 && steps.some(step => writes(step.node)) |
| 225 | }) |
| 226 | } |
| 227 | |
| 228 | // a reader checked after the writer receives what it wrote |
| 229 | const overlaps = (writer: BaseRoot, reader: BaseRoot): boolean => { |
no test coverage detected