(node: BaseRoot)
| 725 | } |
| 726 | |
| 727 | const nodeFacts = (node: BaseRoot): Facts | undefined => { |
| 728 | if (node.isNever() || node.topAlias) return |
| 729 | const key = `@${node.id}` |
| 730 | const domains = domainsOf(node) |
| 731 | if (node.hasAlias) return { key, domains, pure: false, cyclic: true } |
| 732 | let values: unknown[] | undefined = [] |
| 733 | let units = false |
| 734 | for (const branch of node.branches) { |
| 735 | if (branch.is("unit")) { |
| 736 | units = true |
| 737 | if (typeof branch.unit !== "object") values?.push(branch.unit) |
| 738 | else values = undefined |
| 739 | } else { |
| 740 | values = undefined |
| 741 | units ||= outputsUnit(branch) |
| 742 | } |
| 743 | } |
| 744 | const { bits, ends } = nodeHolds(node) |
| 745 | // a node says nothing of where it holds a predicate or a unit |
| 746 | const narrowed = (bits & holdsNarrow) !== 0 |
| 747 | return { |
| 748 | key, |
| 749 | domains, |
| 750 | pure: !node.alters, |
| 751 | values, |
| 752 | units, |
| 753 | unitsWithin: (bits & holdsUnit) !== 0, |
| 754 | narrowed, |
| 755 | narrowedWithin: narrowed, |
| 756 | ends |
| 757 | } |
| 758 | } |
| 759 | |
| 760 | // a prop's `this`, its own at each call, whose nodes each reference what's being defined |
| 761 | const thisFacts = (v: unknown): Facts | undefined => |
no test coverage detected