@azx-pbc/axiom-runtime 0.0.0-stage → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +714 -2
- package/dist/cache/index.d.ts +191 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +361 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/canonical/jcs.d.ts +78 -0
- package/dist/canonical/jcs.d.ts.map +1 -0
- package/dist/canonical/jcs.js +500 -0
- package/dist/canonical/jcs.js.map +1 -0
- package/dist/canonical/restricted-json.d.ts +7 -0
- package/dist/canonical/restricted-json.d.ts.map +1 -0
- package/dist/canonical/restricted-json.js +318 -0
- package/dist/canonical/restricted-json.js.map +1 -0
- package/dist/canonical/restricted-value.d.ts +59 -0
- package/dist/canonical/restricted-value.d.ts.map +1 -0
- package/dist/canonical/restricted-value.js +156 -0
- package/dist/canonical/restricted-value.js.map +1 -0
- package/dist/canonical/restricted.d.ts +85 -0
- package/dist/canonical/restricted.d.ts.map +1 -0
- package/dist/canonical/restricted.js +163 -0
- package/dist/canonical/restricted.js.map +1 -0
- package/dist/canonical/signature.d.ts +38 -0
- package/dist/canonical/signature.d.ts.map +1 -0
- package/dist/canonical/signature.js +47 -0
- package/dist/canonical/signature.js.map +1 -0
- package/dist/eval/access/delivery.d.ts +63 -0
- package/dist/eval/access/delivery.d.ts.map +1 -0
- package/dist/eval/access/delivery.js +98 -0
- package/dist/eval/access/delivery.js.map +1 -0
- package/dist/eval/access/overlay.d.ts +72 -0
- package/dist/eval/access/overlay.d.ts.map +1 -0
- package/dist/eval/access/overlay.js +402 -0
- package/dist/eval/access/overlay.js.map +1 -0
- package/dist/eval/access/projection.d.ts +159 -0
- package/dist/eval/access/projection.d.ts.map +1 -0
- package/dist/eval/access/projection.js +211 -0
- package/dist/eval/access/projection.js.map +1 -0
- package/dist/eval/access/window.d.ts +128 -0
- package/dist/eval/access/window.d.ts.map +1 -0
- package/dist/eval/access/window.js +254 -0
- package/dist/eval/access/window.js.map +1 -0
- package/dist/eval/access/write.d.ts +113 -0
- package/dist/eval/access/write.d.ts.map +1 -0
- package/dist/eval/access/write.js +119 -0
- package/dist/eval/access/write.js.map +1 -0
- package/dist/eval/addressing.d.ts +131 -0
- package/dist/eval/addressing.d.ts.map +1 -0
- package/dist/eval/addressing.js +270 -0
- package/dist/eval/addressing.js.map +1 -0
- package/dist/eval/budget.d.ts +143 -0
- package/dist/eval/budget.d.ts.map +1 -0
- package/dist/eval/budget.js +387 -0
- package/dist/eval/budget.js.map +1 -0
- package/dist/eval/computed.d.ts +46 -0
- package/dist/eval/computed.d.ts.map +1 -0
- package/dist/eval/computed.js +89 -0
- package/dist/eval/computed.js.map +1 -0
- package/dist/eval/denials.d.ts +64 -0
- package/dist/eval/denials.d.ts.map +1 -0
- package/dist/eval/denials.js +87 -0
- package/dist/eval/denials.js.map +1 -0
- package/dist/eval/engine/cancellation.d.ts +12 -0
- package/dist/eval/engine/cancellation.d.ts.map +1 -0
- package/dist/eval/engine/cancellation.js +56 -0
- package/dist/eval/engine/cancellation.js.map +1 -0
- package/dist/eval/engine/delta.d.ts +104 -0
- package/dist/eval/engine/delta.d.ts.map +1 -0
- package/dist/eval/engine/delta.js +466 -0
- package/dist/eval/engine/delta.js.map +1 -0
- package/dist/eval/engine/deps.d.ts +136 -0
- package/dist/eval/engine/deps.d.ts.map +1 -0
- package/dist/eval/engine/deps.js +345 -0
- package/dist/eval/engine/deps.js.map +1 -0
- package/dist/eval/engine/identity.d.ts +128 -0
- package/dist/eval/engine/identity.d.ts.map +1 -0
- package/dist/eval/engine/identity.js +398 -0
- package/dist/eval/engine/identity.js.map +1 -0
- package/dist/eval/engine/index.d.ts +200 -0
- package/dist/eval/engine/index.d.ts.map +1 -0
- package/dist/eval/engine/index.js +1242 -0
- package/dist/eval/engine/index.js.map +1 -0
- package/dist/eval/engine/measurement.d.ts +23 -0
- package/dist/eval/engine/measurement.d.ts.map +1 -0
- package/dist/eval/engine/measurement.js +42 -0
- package/dist/eval/engine/measurement.js.map +1 -0
- package/dist/eval/engine/naive.d.ts +19 -0
- package/dist/eval/engine/naive.d.ts.map +1 -0
- package/dist/eval/engine/naive.js +59 -0
- package/dist/eval/engine/naive.js.map +1 -0
- package/dist/eval/engine/ops.d.ts +214 -0
- package/dist/eval/engine/ops.d.ts.map +1 -0
- package/dist/eval/engine/ops.js +1422 -0
- package/dist/eval/engine/ops.js.map +1 -0
- package/dist/eval/engine/patches.d.ts +40 -0
- package/dist/eval/engine/patches.d.ts.map +1 -0
- package/dist/eval/engine/patches.js +125 -0
- package/dist/eval/engine/patches.js.map +1 -0
- package/dist/eval/engine/ports.d.ts +71 -0
- package/dist/eval/engine/ports.d.ts.map +1 -0
- package/dist/eval/engine/ports.js +2 -0
- package/dist/eval/engine/ports.js.map +1 -0
- package/dist/eval/engine/session.d.ts +116 -0
- package/dist/eval/engine/session.d.ts.map +1 -0
- package/dist/eval/engine/session.js +653 -0
- package/dist/eval/engine/session.js.map +1 -0
- package/dist/eval/engine/snapshot.d.ts +97 -0
- package/dist/eval/engine/snapshot.d.ts.map +1 -0
- package/dist/eval/engine/snapshot.js +221 -0
- package/dist/eval/engine/snapshot.js.map +1 -0
- package/dist/eval/engine/subscriptions.d.ts +47 -0
- package/dist/eval/engine/subscriptions.d.ts.map +1 -0
- package/dist/eval/engine/subscriptions.js +103 -0
- package/dist/eval/engine/subscriptions.js.map +1 -0
- package/dist/eval/engine/trace.d.ts +77 -0
- package/dist/eval/engine/trace.d.ts.map +1 -0
- package/dist/eval/engine/trace.js +140 -0
- package/dist/eval/engine/trace.js.map +1 -0
- package/dist/eval/error-diagnostic.d.ts +26 -0
- package/dist/eval/error-diagnostic.d.ts.map +1 -0
- package/dist/eval/error-diagnostic.js +63 -0
- package/dist/eval/error-diagnostic.js.map +1 -0
- package/dist/eval/evaluate-expr.d.ts +44 -0
- package/dist/eval/evaluate-expr.d.ts.map +1 -0
- package/dist/eval/evaluate-expr.js +149 -0
- package/dist/eval/evaluate-expr.js.map +1 -0
- package/dist/eval/evaluate.d.ts +282 -0
- package/dist/eval/evaluate.d.ts.map +1 -0
- package/dist/eval/evaluate.js +391 -0
- package/dist/eval/evaluate.js.map +1 -0
- package/dist/eval/evolution/relocate.d.ts +72 -0
- package/dist/eval/evolution/relocate.d.ts.map +1 -0
- package/dist/eval/evolution/relocate.js +427 -0
- package/dist/eval/evolution/relocate.js.map +1 -0
- package/dist/eval/evolution/select.d.ts +11 -0
- package/dist/eval/evolution/select.d.ts.map +1 -0
- package/dist/eval/evolution/select.js +53 -0
- package/dist/eval/evolution/select.js.map +1 -0
- package/dist/eval/evolution/upcast.d.ts +13 -0
- package/dist/eval/evolution/upcast.d.ts.map +1 -0
- package/dist/eval/evolution/upcast.js +88 -0
- package/dist/eval/evolution/upcast.js.map +1 -0
- package/dist/eval/expr/aggregates.d.ts +75 -0
- package/dist/eval/expr/aggregates.d.ts.map +1 -0
- package/dist/eval/expr/aggregates.js +991 -0
- package/dist/eval/expr/aggregates.js.map +1 -0
- package/dist/eval/expr/arithmetic.d.ts +26 -0
- package/dist/eval/expr/arithmetic.d.ts.map +1 -0
- package/dist/eval/expr/arithmetic.js +387 -0
- package/dist/eval/expr/arithmetic.js.map +1 -0
- package/dist/eval/expr/between.d.ts +17 -0
- package/dist/eval/expr/between.d.ts.map +1 -0
- package/dist/eval/expr/between.js +46 -0
- package/dist/eval/expr/between.js.map +1 -0
- package/dist/eval/expr/binder.d.ts +96 -0
- package/dist/eval/expr/binder.d.ts.map +1 -0
- package/dist/eval/expr/binder.js +253 -0
- package/dist/eval/expr/binder.js.map +1 -0
- package/dist/eval/expr/call-dispatch.d.ts +28 -0
- package/dist/eval/expr/call-dispatch.d.ts.map +1 -0
- package/dist/eval/expr/call-dispatch.js +114 -0
- package/dist/eval/expr/call-dispatch.js.map +1 -0
- package/dist/eval/expr/collections.d.ts +20 -0
- package/dist/eval/expr/collections.d.ts.map +1 -0
- package/dist/eval/expr/collections.js +66 -0
- package/dist/eval/expr/collections.js.map +1 -0
- package/dist/eval/expr/compare.d.ts +36 -0
- package/dist/eval/expr/compare.d.ts.map +1 -0
- package/dist/eval/expr/compare.js +115 -0
- package/dist/eval/expr/compare.js.map +1 -0
- package/dist/eval/expr/datasets.d.ts +28 -0
- package/dist/eval/expr/datasets.d.ts.map +1 -0
- package/dist/eval/expr/datasets.js +304 -0
- package/dist/eval/expr/datasets.js.map +1 -0
- package/dist/eval/expr/digest.d.ts +23 -0
- package/dist/eval/expr/digest.d.ts.map +1 -0
- package/dist/eval/expr/digest.js +89 -0
- package/dist/eval/expr/digest.js.map +1 -0
- package/dist/eval/expr/domains.d.ts +19 -0
- package/dist/eval/expr/domains.d.ts.map +1 -0
- package/dist/eval/expr/domains.js +18 -0
- package/dist/eval/expr/domains.js.map +1 -0
- package/dist/eval/expr/host.d.ts +152 -0
- package/dist/eval/expr/host.d.ts.map +1 -0
- package/dist/eval/expr/host.js +36 -0
- package/dist/eval/expr/host.js.map +1 -0
- package/dist/eval/expr/lists.d.ts +24 -0
- package/dist/eval/expr/lists.d.ts.map +1 -0
- package/dist/eval/expr/lists.js +155 -0
- package/dist/eval/expr/lists.js.map +1 -0
- package/dist/eval/expr/member.d.ts +15 -0
- package/dist/eval/expr/member.d.ts.map +1 -0
- package/dist/eval/expr/member.js +32 -0
- package/dist/eval/expr/member.js.map +1 -0
- package/dist/eval/expr/money-ops.d.ts +10 -0
- package/dist/eval/expr/money-ops.d.ts.map +1 -0
- package/dist/eval/expr/money-ops.js +17 -0
- package/dist/eval/expr/money-ops.js.map +1 -0
- package/dist/eval/expr/operands.d.ts +27 -0
- package/dist/eval/expr/operands.d.ts.map +1 -0
- package/dist/eval/expr/operands.js +167 -0
- package/dist/eval/expr/operands.js.map +1 -0
- package/dist/eval/expr/presence.d.ts +27 -0
- package/dist/eval/expr/presence.d.ts.map +1 -0
- package/dist/eval/expr/presence.js +140 -0
- package/dist/eval/expr/presence.js.map +1 -0
- package/dist/eval/expr/records.d.ts +22 -0
- package/dist/eval/expr/records.d.ts.map +1 -0
- package/dist/eval/expr/records.js +101 -0
- package/dist/eval/expr/records.js.map +1 -0
- package/dist/eval/expr/rule-refs.d.ts +25 -0
- package/dist/eval/expr/rule-refs.d.ts.map +1 -0
- package/dist/eval/expr/rule-refs.js +60 -0
- package/dist/eval/expr/rule-refs.js.map +1 -0
- package/dist/eval/expr/sequences.d.ts +26 -0
- package/dist/eval/expr/sequences.d.ts.map +1 -0
- package/dist/eval/expr/sequences.js +151 -0
- package/dist/eval/expr/sequences.js.map +1 -0
- package/dist/eval/expr/value.d.ts +99 -0
- package/dist/eval/expr/value.d.ts.map +1 -0
- package/dist/eval/expr/value.js +14 -0
- package/dist/eval/expr/value.js.map +1 -0
- package/dist/eval/expression.d.ts +142 -0
- package/dist/eval/expression.d.ts.map +1 -0
- package/dist/eval/expression.js +446 -0
- package/dist/eval/expression.js.map +1 -0
- package/dist/eval/firing.d.ts +68 -0
- package/dist/eval/firing.d.ts.map +1 -0
- package/dist/eval/firing.js +222 -0
- package/dist/eval/firing.js.map +1 -0
- package/dist/eval/gate.d.ts +110 -0
- package/dist/eval/gate.d.ts.map +1 -0
- package/dist/eval/gate.js +278 -0
- package/dist/eval/gate.js.map +1 -0
- package/dist/eval/layout-visibility.d.ts +18 -0
- package/dist/eval/layout-visibility.d.ts.map +1 -0
- package/dist/eval/layout-visibility.js +61 -0
- package/dist/eval/layout-visibility.js.map +1 -0
- package/dist/eval/option-availability.d.ts +26 -0
- package/dist/eval/option-availability.d.ts.map +1 -0
- package/dist/eval/option-availability.js +580 -0
- package/dist/eval/option-availability.js.map +1 -0
- package/dist/eval/options-boundary.d.ts +15 -0
- package/dist/eval/options-boundary.d.ts.map +1 -0
- package/dist/eval/options-boundary.js +40 -0
- package/dist/eval/options-boundary.js.map +1 -0
- package/dist/eval/options.d.ts +99 -0
- package/dist/eval/options.d.ts.map +1 -0
- package/dist/eval/options.js +96 -0
- package/dist/eval/options.js.map +1 -0
- package/dist/eval/overrides.d.ts +116 -0
- package/dist/eval/overrides.d.ts.map +1 -0
- package/dist/eval/overrides.js +176 -0
- package/dist/eval/overrides.js.map +1 -0
- package/dist/eval/paths.d.ts +25 -0
- package/dist/eval/paths.d.ts.map +1 -0
- package/dist/eval/paths.js +47 -0
- package/dist/eval/paths.js.map +1 -0
- package/dist/eval/presentation-reads.d.ts +20 -0
- package/dist/eval/presentation-reads.d.ts.map +1 -0
- package/dist/eval/presentation-reads.js +2 -0
- package/dist/eval/presentation-reads.js.map +1 -0
- package/dist/eval/presentation.d.ts +122 -0
- package/dist/eval/presentation.d.ts.map +1 -0
- package/dist/eval/presentation.js +255 -0
- package/dist/eval/presentation.js.map +1 -0
- package/dist/eval/reader/context-value.d.ts +41 -0
- package/dist/eval/reader/context-value.d.ts.map +1 -0
- package/dist/eval/reader/context-value.js +129 -0
- package/dist/eval/reader/context-value.js.map +1 -0
- package/dist/eval/reader/covered.d.ts +53 -0
- package/dist/eval/reader/covered.d.ts.map +1 -0
- package/dist/eval/reader/covered.js +139 -0
- package/dist/eval/reader/covered.js.map +1 -0
- package/dist/eval/reader/declarations.d.ts +182 -0
- package/dist/eval/reader/declarations.d.ts.map +1 -0
- package/dist/eval/reader/declarations.js +153 -0
- package/dist/eval/reader/declarations.js.map +1 -0
- package/dist/eval/reader/member-access.d.ts +87 -0
- package/dist/eval/reader/member-access.d.ts.map +1 -0
- package/dist/eval/reader/member-access.js +212 -0
- package/dist/eval/reader/member-access.js.map +1 -0
- package/dist/eval/reader/memo.d.ts +34 -0
- package/dist/eval/reader/memo.d.ts.map +1 -0
- package/dist/eval/reader/memo.js +67 -0
- package/dist/eval/reader/memo.js.map +1 -0
- package/dist/eval/reader/overlay.d.ts +74 -0
- package/dist/eval/reader/overlay.d.ts.map +1 -0
- package/dist/eval/reader/overlay.js +365 -0
- package/dist/eval/reader/overlay.js.map +1 -0
- package/dist/eval/reader/questions.d.ts +37 -0
- package/dist/eval/reader/questions.d.ts.map +1 -0
- package/dist/eval/reader/questions.js +78 -0
- package/dist/eval/reader/questions.js.map +1 -0
- package/dist/eval/reader/resolve.d.ts +84 -0
- package/dist/eval/reader/resolve.d.ts.map +1 -0
- package/dist/eval/reader/resolve.js +310 -0
- package/dist/eval/reader/resolve.js.map +1 -0
- package/dist/eval/reader/value-read.d.ts +50 -0
- package/dist/eval/reader/value-read.d.ts.map +1 -0
- package/dist/eval/reader/value-read.js +133 -0
- package/dist/eval/reader/value-read.js.map +1 -0
- package/dist/eval/reader/withheld.d.ts +48 -0
- package/dist/eval/reader/withheld.d.ts.map +1 -0
- package/dist/eval/reader/withheld.js +108 -0
- package/dist/eval/reader/withheld.js.map +1 -0
- package/dist/eval/reader-paths.d.ts +24 -0
- package/dist/eval/reader-paths.d.ts.map +1 -0
- package/dist/eval/reader-paths.js +23 -0
- package/dist/eval/reader-paths.js.map +1 -0
- package/dist/eval/reader.d.ts +281 -0
- package/dist/eval/reader.d.ts.map +1 -0
- package/dist/eval/reader.js +560 -0
- package/dist/eval/reader.js.map +1 -0
- package/dist/eval/receipt.d.ts +37 -0
- package/dist/eval/receipt.d.ts.map +1 -0
- package/dist/eval/receipt.js +222 -0
- package/dist/eval/receipt.js.map +1 -0
- package/dist/eval/report/assemble.d.ts +84 -0
- package/dist/eval/report/assemble.d.ts.map +1 -0
- package/dist/eval/report/assemble.js +277 -0
- package/dist/eval/report/assemble.js.map +1 -0
- package/dist/eval/report/fold.d.ts +18 -0
- package/dist/eval/report/fold.d.ts.map +1 -0
- package/dist/eval/report/fold.js +58 -0
- package/dist/eval/report/fold.js.map +1 -0
- package/dist/eval/rule/alternatives.d.ts +23 -0
- package/dist/eval/rule/alternatives.d.ts.map +1 -0
- package/dist/eval/rule/alternatives.js +46 -0
- package/dist/eval/rule/alternatives.js.map +1 -0
- package/dist/eval/rule/behaviour.d.ts +47 -0
- package/dist/eval/rule/behaviour.d.ts.map +1 -0
- package/dist/eval/rule/behaviour.js +249 -0
- package/dist/eval/rule/behaviour.js.map +1 -0
- package/dist/eval/rule/compute.d.ts +46 -0
- package/dist/eval/rule/compute.d.ts.map +1 -0
- package/dist/eval/rule/compute.js +158 -0
- package/dist/eval/rule/compute.js.map +1 -0
- package/dist/eval/rule/create-state.d.ts +42 -0
- package/dist/eval/rule/create-state.d.ts.map +1 -0
- package/dist/eval/rule/create-state.js +134 -0
- package/dist/eval/rule/create-state.js.map +1 -0
- package/dist/eval/rule/diagnostics.d.ts +24 -0
- package/dist/eval/rule/diagnostics.d.ts.map +1 -0
- package/dist/eval/rule/diagnostics.js +45 -0
- package/dist/eval/rule/diagnostics.js.map +1 -0
- package/dist/eval/rule/execution.d.ts +24 -0
- package/dist/eval/rule/execution.d.ts.map +1 -0
- package/dist/eval/rule/execution.js +495 -0
- package/dist/eval/rule/execution.js.map +1 -0
- package/dist/eval/rule/gate.d.ts +12 -0
- package/dist/eval/rule/gate.d.ts.map +1 -0
- package/dist/eval/rule/gate.js +34 -0
- package/dist/eval/rule/gate.js.map +1 -0
- package/dist/eval/rule/item.d.ts +11 -0
- package/dist/eval/rule/item.d.ts.map +1 -0
- package/dist/eval/rule/item.js +265 -0
- package/dist/eval/rule/item.js.map +1 -0
- package/dist/eval/rule/prepare.d.ts +64 -0
- package/dist/eval/rule/prepare.d.ts.map +1 -0
- package/dist/eval/rule/prepare.js +131 -0
- package/dist/eval/rule/prepare.js.map +1 -0
- package/dist/eval/rule/result.d.ts +97 -0
- package/dist/eval/rule/result.d.ts.map +1 -0
- package/dist/eval/rule/result.js +347 -0
- package/dist/eval/rule/result.js.map +1 -0
- package/dist/eval/rule/runner.d.ts +128 -0
- package/dist/eval/rule/runner.d.ts.map +1 -0
- package/dist/eval/rule/runner.js +296 -0
- package/dist/eval/rule/runner.js.map +1 -0
- package/dist/eval/rule/screen.d.ts +32 -0
- package/dist/eval/rule/screen.d.ts.map +1 -0
- package/dist/eval/rule/screen.js +73 -0
- package/dist/eval/rule/screen.js.map +1 -0
- package/dist/eval/rule/state.d.ts +137 -0
- package/dist/eval/rule/state.d.ts.map +1 -0
- package/dist/eval/rule/state.js +2 -0
- package/dist/eval/rule/state.js.map +1 -0
- package/dist/eval/rule/steps.d.ts +44 -0
- package/dist/eval/rule/steps.d.ts.map +1 -0
- package/dist/eval/rule/steps.js +367 -0
- package/dist/eval/rule/steps.js.map +1 -0
- package/dist/eval/rule/visibility.d.ts +18 -0
- package/dist/eval/rule/visibility.d.ts.map +1 -0
- package/dist/eval/rule/visibility.js +79 -0
- package/dist/eval/rule/visibility.js.map +1 -0
- package/dist/eval/seal.d.ts +74 -0
- package/dist/eval/seal.d.ts.map +1 -0
- package/dist/eval/seal.js +154 -0
- package/dist/eval/seal.js.map +1 -0
- package/dist/eval/signature-coverage.d.ts +19 -0
- package/dist/eval/signature-coverage.d.ts.map +1 -0
- package/dist/eval/signature-coverage.js +160 -0
- package/dist/eval/signature-coverage.js.map +1 -0
- package/dist/eval/state/derive.d.ts +72 -0
- package/dist/eval/state/derive.d.ts.map +1 -0
- package/dist/eval/state/derive.js +61 -0
- package/dist/eval/state/derive.js.map +1 -0
- package/dist/eval/state/describe.d.ts +18 -0
- package/dist/eval/state/describe.d.ts.map +1 -0
- package/dist/eval/state/describe.js +19 -0
- package/dist/eval/state/describe.js.map +1 -0
- package/dist/eval/state/field-state.d.ts +471 -0
- package/dist/eval/state/field-state.d.ts.map +1 -0
- package/dist/eval/state/field-state.js +1604 -0
- package/dist/eval/state/field-state.js.map +1 -0
- package/dist/eval/state/measurement.d.ts +136 -0
- package/dist/eval/state/measurement.d.ts.map +1 -0
- package/dist/eval/state/measurement.js +209 -0
- package/dist/eval/state/measurement.js.map +1 -0
- package/dist/eval/state/options.d.ts +21 -0
- package/dist/eval/state/options.d.ts.map +1 -0
- package/dist/eval/state/options.js +3 -0
- package/dist/eval/state/options.js.map +1 -0
- package/dist/eval/state/readiness.d.ts +400 -0
- package/dist/eval/state/readiness.d.ts.map +1 -0
- package/dist/eval/state/readiness.js +1067 -0
- package/dist/eval/state/readiness.js.map +1 -0
- package/dist/eval/state/snapshot.d.ts +130 -0
- package/dist/eval/state/snapshot.d.ts.map +1 -0
- package/dist/eval/state/snapshot.js +35 -0
- package/dist/eval/state/snapshot.js.map +1 -0
- package/dist/eval/state/unavailable-options.d.ts +54 -0
- package/dist/eval/state/unavailable-options.d.ts.map +1 -0
- package/dist/eval/state/unavailable-options.js +82 -0
- package/dist/eval/state/unavailable-options.js.map +1 -0
- package/dist/eval/state/value-state.d.ts +38 -0
- package/dist/eval/state/value-state.d.ts.map +1 -0
- package/dist/eval/state/value-state.js +52 -0
- package/dist/eval/state/value-state.js.map +1 -0
- package/dist/eval/submission/admission.d.ts +50 -0
- package/dist/eval/submission/admission.d.ts.map +1 -0
- package/dist/eval/submission/admission.js +174 -0
- package/dist/eval/submission/admission.js.map +1 -0
- package/dist/eval/submission/authority.d.ts +71 -0
- package/dist/eval/submission/authority.d.ts.map +1 -0
- package/dist/eval/submission/authority.js +118 -0
- package/dist/eval/submission/authority.js.map +1 -0
- package/dist/eval/submission/datasets.d.ts +28 -0
- package/dist/eval/submission/datasets.d.ts.map +1 -0
- package/dist/eval/submission/datasets.js +109 -0
- package/dist/eval/submission/datasets.js.map +1 -0
- package/dist/eval/submission/index.d.ts +15 -0
- package/dist/eval/submission/index.d.ts.map +1 -0
- package/dist/eval/submission/index.js +13 -0
- package/dist/eval/submission/index.js.map +1 -0
- package/dist/eval/submission/refusals.d.ts +103 -0
- package/dist/eval/submission/refusals.d.ts.map +1 -0
- package/dist/eval/submission/refusals.js +15 -0
- package/dist/eval/submission/refusals.js.map +1 -0
- package/dist/eval/submission/signatures.d.ts +7 -0
- package/dist/eval/submission/signatures.d.ts.map +1 -0
- package/dist/eval/submission/signatures.js +215 -0
- package/dist/eval/submission/signatures.js.map +1 -0
- package/dist/eval/submission/writes.d.ts +51 -0
- package/dist/eval/submission/writes.d.ts.map +1 -0
- package/dist/eval/submission/writes.js +203 -0
- package/dist/eval/submission/writes.js.map +1 -0
- package/dist/eval/submission.d.ts +53 -0
- package/dist/eval/submission.d.ts.map +1 -0
- package/dist/eval/submission.js +521 -0
- package/dist/eval/submission.js.map +1 -0
- package/dist/eval/suggestions-to-engine.d.ts +18 -0
- package/dist/eval/suggestions-to-engine.d.ts.map +1 -0
- package/dist/eval/suggestions-to-engine.js +40 -0
- package/dist/eval/suggestions-to-engine.js.map +1 -0
- package/dist/eval/suggestions.d.ts +17 -0
- package/dist/eval/suggestions.d.ts.map +1 -0
- package/dist/eval/suggestions.js +314 -0
- package/dist/eval/suggestions.js.map +1 -0
- package/dist/eval/undecided.d.ts +64 -0
- package/dist/eval/undecided.d.ts.map +1 -0
- package/dist/eval/undecided.js +101 -0
- package/dist/eval/undecided.js.map +1 -0
- package/dist/eval/verdict.d.ts +66 -0
- package/dist/eval/verdict.d.ts.map +1 -0
- package/dist/eval/verdict.js +106 -0
- package/dist/eval/verdict.js.map +1 -0
- package/dist/eval/verify-signature.d.ts +78 -0
- package/dist/eval/verify-signature.d.ts.map +1 -0
- package/dist/eval/verify-signature.js +185 -0
- package/dist/eval/verify-signature.js.map +1 -0
- package/dist/eval/version-dispatch.d.ts +38 -0
- package/dist/eval/version-dispatch.d.ts.map +1 -0
- package/dist/eval/version-dispatch.js +61 -0
- package/dist/eval/version-dispatch.js.map +1 -0
- package/dist/eval/visibility.d.ts +33 -0
- package/dist/eval/visibility.d.ts.map +1 -0
- package/dist/eval/visibility.js +83 -0
- package/dist/eval/visibility.js.map +1 -0
- package/dist/evaluate.d.ts +24 -0
- package/dist/evaluate.d.ts.map +1 -0
- package/dist/evaluate.js +18 -0
- package/dist/evaluate.js.map +1 -0
- package/dist/expr/builtin-docs.d.ts +51 -0
- package/dist/expr/builtin-docs.d.ts.map +1 -0
- package/dist/expr/builtin-docs.js +874 -0
- package/dist/expr/builtin-docs.js.map +1 -0
- package/dist/expr/builtins.d.ts +50 -0
- package/dist/expr/builtins.d.ts.map +1 -0
- package/dist/expr/builtins.js +966 -0
- package/dist/expr/builtins.js.map +1 -0
- package/dist/expr/decimal-precision.d.ts +39 -0
- package/dist/expr/decimal-precision.d.ts.map +1 -0
- package/dist/expr/decimal-precision.js +62 -0
- package/dist/expr/decimal-precision.js.map +1 -0
- package/dist/expr/decimal.d.ts +172 -0
- package/dist/expr/decimal.d.ts.map +1 -0
- package/dist/expr/decimal.js +782 -0
- package/dist/expr/decimal.js.map +1 -0
- package/dist/expr/deprecations.d.ts +34 -0
- package/dist/expr/deprecations.d.ts.map +1 -0
- package/dist/expr/deprecations.js +17 -0
- package/dist/expr/deprecations.js.map +1 -0
- package/dist/expr/diagnostics.d.ts +21 -0
- package/dist/expr/diagnostics.d.ts.map +1 -0
- package/dist/expr/diagnostics.js +231 -0
- package/dist/expr/diagnostics.js.map +1 -0
- package/dist/expr/direction.d.ts +30 -0
- package/dist/expr/direction.d.ts.map +1 -0
- package/dist/expr/direction.js +77 -0
- package/dist/expr/direction.js.map +1 -0
- package/dist/expr/example-expression.d.ts +62 -0
- package/dist/expr/example-expression.d.ts.map +1 -0
- package/dist/expr/example-expression.js +670 -0
- package/dist/expr/example-expression.js.map +1 -0
- package/dist/expr/instant.d.ts +49 -0
- package/dist/expr/instant.d.ts.map +1 -0
- package/dist/expr/instant.js +111 -0
- package/dist/expr/instant.js.map +1 -0
- package/dist/expr/logic.d.ts +17 -0
- package/dist/expr/logic.d.ts.map +1 -0
- package/dist/expr/logic.js +65 -0
- package/dist/expr/logic.js.map +1 -0
- package/dist/expr/messages.d.ts +45 -0
- package/dist/expr/messages.d.ts.map +1 -0
- package/dist/expr/messages.js +280 -0
- package/dist/expr/messages.js.map +1 -0
- package/dist/expr/money.d.ts +38 -0
- package/dist/expr/money.d.ts.map +1 -0
- package/dist/expr/money.js +127 -0
- package/dist/expr/money.js.map +1 -0
- package/dist/expr/ordering.d.ts +56 -0
- package/dist/expr/ordering.d.ts.map +1 -0
- package/dist/expr/ordering.js +167 -0
- package/dist/expr/ordering.js.map +1 -0
- package/dist/expr/pattern.d.ts +44 -0
- package/dist/expr/pattern.d.ts.map +1 -0
- package/dist/expr/pattern.js +458 -0
- package/dist/expr/pattern.js.map +1 -0
- package/dist/expr/plain-date.d.ts +90 -0
- package/dist/expr/plain-date.d.ts.map +1 -0
- package/dist/expr/plain-date.js +230 -0
- package/dist/expr/plain-date.js.map +1 -0
- package/dist/expr/plural-categories.d.ts +8 -0
- package/dist/expr/plural-categories.d.ts.map +1 -0
- package/dist/expr/plural-categories.js +15 -0
- package/dist/expr/plural-categories.js.map +1 -0
- package/dist/expr/plural-keys.d.ts +39 -0
- package/dist/expr/plural-keys.d.ts.map +1 -0
- package/dist/expr/plural-keys.js +46 -0
- package/dist/expr/plural-keys.js.map +1 -0
- package/dist/expr/plural.d.ts +33 -0
- package/dist/expr/plural.d.ts.map +1 -0
- package/dist/expr/plural.js +50 -0
- package/dist/expr/plural.js.map +1 -0
- package/dist/expr/quantity.d.ts +31 -0
- package/dist/expr/quantity.d.ts.map +1 -0
- package/dist/expr/quantity.js +83 -0
- package/dist/expr/quantity.js.map +1 -0
- package/dist/expr/reduce.d.ts +50 -0
- package/dist/expr/reduce.d.ts.map +1 -0
- package/dist/expr/reduce.js +236 -0
- package/dist/expr/reduce.js.map +1 -0
- package/dist/expr/regex.d.ts +108 -0
- package/dist/expr/regex.d.ts.map +1 -0
- package/dist/expr/regex.js +1207 -0
- package/dist/expr/regex.js.map +1 -0
- package/dist/expr/select-locale.d.ts +67 -0
- package/dist/expr/select-locale.d.ts.map +1 -0
- package/dist/expr/select-locale.js +219 -0
- package/dist/expr/select-locale.js.map +1 -0
- package/dist/expr/sequences.d.ts +123 -0
- package/dist/expr/sequences.d.ts.map +1 -0
- package/dist/expr/sequences.js +234 -0
- package/dist/expr/sequences.js.map +1 -0
- package/dist/expr/strings.d.ts +50 -0
- package/dist/expr/strings.d.ts.map +1 -0
- package/dist/expr/strings.js +184 -0
- package/dist/expr/strings.js.map +1 -0
- package/dist/expr/validation.d.ts +32 -0
- package/dist/expr/validation.d.ts.map +1 -0
- package/dist/expr/validation.js +182 -0
- package/dist/expr/validation.js.map +1 -0
- package/dist/graph/freeze.d.ts +4 -0
- package/dist/graph/freeze.d.ts.map +1 -0
- package/dist/graph/freeze.js +52 -0
- package/dist/graph/freeze.js.map +1 -0
- package/dist/graph/index.d.ts +15 -0
- package/dist/graph/index.d.ts.map +1 -0
- package/dist/graph/index.js +13 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/inspect.d.ts +76 -0
- package/dist/graph/inspect.d.ts.map +1 -0
- package/dist/graph/inspect.js +263 -0
- package/dist/graph/inspect.js.map +1 -0
- package/dist/graph/read-walk.d.ts +101 -0
- package/dist/graph/read-walk.d.ts.map +1 -0
- package/dist/graph/read-walk.js +358 -0
- package/dist/graph/read-walk.js.map +1 -0
- package/dist/graph/record-index.d.ts +24 -0
- package/dist/graph/record-index.d.ts.map +1 -0
- package/dist/graph/record-index.js +35 -0
- package/dist/graph/record-index.js.map +1 -0
- package/dist/index.d.ts +104 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +139 -0
- package/dist/index.js.map +1 -0
- package/dist/lookup/digest.d.ts +51 -0
- package/dist/lookup/digest.d.ts.map +1 -0
- package/dist/lookup/digest.js +46 -0
- package/dist/lookup/digest.js.map +1 -0
- package/dist/lookup/index.d.ts +28 -0
- package/dist/lookup/index.d.ts.map +1 -0
- package/dist/lookup/index.js +27 -0
- package/dist/lookup/index.js.map +1 -0
- package/dist/lookup/install.d.ts +48 -0
- package/dist/lookup/install.d.ts.map +1 -0
- package/dist/lookup/install.js +315 -0
- package/dist/lookup/install.js.map +1 -0
- package/dist/lookup/pass.d.ts +55 -0
- package/dist/lookup/pass.d.ts.map +1 -0
- package/dist/lookup/pass.js +212 -0
- package/dist/lookup/pass.js.map +1 -0
- package/dist/lookup/pins.d.ts +34 -0
- package/dist/lookup/pins.d.ts.map +1 -0
- package/dist/lookup/pins.js +39 -0
- package/dist/lookup/pins.js.map +1 -0
- package/dist/lookup/provenance.d.ts +23 -0
- package/dist/lookup/provenance.d.ts.map +1 -0
- package/dist/lookup/provenance.js +78 -0
- package/dist/lookup/provenance.js.map +1 -0
- package/dist/lookup/readiness.d.ts +13 -0
- package/dist/lookup/readiness.d.ts.map +1 -0
- package/dist/lookup/readiness.js +57 -0
- package/dist/lookup/readiness.js.map +1 -0
- package/dist/lookup/resolve.d.ts +24 -0
- package/dist/lookup/resolve.d.ts.map +1 -0
- package/dist/lookup/resolve.js +201 -0
- package/dist/lookup/resolve.js.map +1 -0
- package/dist/lookup/store.d.ts +41 -0
- package/dist/lookup/store.d.ts.map +1 -0
- package/dist/lookup/store.js +74 -0
- package/dist/lookup/store.js.map +1 -0
- package/dist/model/access.d.ts +200 -0
- package/dist/model/access.d.ts.map +1 -0
- package/dist/model/access.js +125 -0
- package/dist/model/access.js.map +1 -0
- package/dist/model/artifact-members.d.ts +3 -0
- package/dist/model/artifact-members.d.ts.map +1 -0
- package/dist/model/artifact-members.js +38 -0
- package/dist/model/artifact-members.js.map +1 -0
- package/dist/model/composition.d.ts +47 -0
- package/dist/model/composition.d.ts.map +1 -0
- package/dist/model/composition.js +66 -0
- package/dist/model/composition.js.map +1 -0
- package/dist/model/domain.d.ts +51 -0
- package/dist/model/domain.d.ts.map +1 -0
- package/dist/model/domain.js +75 -0
- package/dist/model/domain.js.map +1 -0
- package/dist/model/duration.d.ts +31 -0
- package/dist/model/duration.d.ts.map +1 -0
- package/dist/model/duration.js +136 -0
- package/dist/model/duration.js.map +1 -0
- package/dist/model/errors.d.ts +58 -0
- package/dist/model/errors.d.ts.map +1 -0
- package/dist/model/errors.js +81 -0
- package/dist/model/errors.js.map +1 -0
- package/dist/model/evolution.d.ts +177 -0
- package/dist/model/evolution.d.ts.map +1 -0
- package/dist/model/evolution.js +5 -0
- package/dist/model/evolution.js.map +1 -0
- package/dist/model/expr-children.d.ts +15 -0
- package/dist/model/expr-children.d.ts.map +1 -0
- package/dist/model/expr-children.js +45 -0
- package/dist/model/expr-children.js.map +1 -0
- package/dist/model/guards.d.ts +9 -0
- package/dist/model/guards.d.ts.map +1 -0
- package/dist/model/guards.js +11 -0
- package/dist/model/guards.js.map +1 -0
- package/dist/model/input.d.ts +42 -0
- package/dist/model/input.d.ts.map +1 -0
- package/dist/model/input.js +26 -0
- package/dist/model/input.js.map +1 -0
- package/dist/model/integer.d.ts +14 -0
- package/dist/model/integer.d.ts.map +1 -0
- package/dist/model/integer.js +16 -0
- package/dist/model/integer.js.map +1 -0
- package/dist/model/intrinsic.d.ts +18 -0
- package/dist/model/intrinsic.d.ts.map +1 -0
- package/dist/model/intrinsic.js +21 -0
- package/dist/model/intrinsic.js.map +1 -0
- package/dist/model/layout.d.ts +129 -0
- package/dist/model/layout.d.ts.map +1 -0
- package/dist/model/layout.js +2 -0
- package/dist/model/layout.js.map +1 -0
- package/dist/model/media.d.ts +33 -0
- package/dist/model/media.d.ts.map +1 -0
- package/dist/model/media.js +86 -0
- package/dist/model/media.js.map +1 -0
- package/dist/model/members.generated.d.ts +11 -0
- package/dist/model/members.generated.d.ts.map +1 -0
- package/dist/model/members.generated.js +71 -0
- package/dist/model/members.generated.js.map +1 -0
- package/dist/model/row-address.d.ts +27 -0
- package/dist/model/row-address.d.ts.map +1 -0
- package/dist/model/row-address.js +146 -0
- package/dist/model/row-address.js.map +1 -0
- package/dist/model/schema.d.ts +108 -0
- package/dist/model/schema.d.ts.map +1 -0
- package/dist/model/schema.js +2 -0
- package/dist/model/schema.js.map +1 -0
- package/dist/model/shape.d.ts +193 -0
- package/dist/model/shape.d.ts.map +1 -0
- package/dist/model/shape.js +2 -0
- package/dist/model/shape.js.map +1 -0
- package/dist/model/time.d.ts +61 -0
- package/dist/model/time.d.ts.map +1 -0
- package/dist/model/time.js +110 -0
- package/dist/model/time.js.map +1 -0
- package/dist/model/types.d.ts +1329 -0
- package/dist/model/types.d.ts.map +1 -0
- package/dist/model/types.js +424 -0
- package/dist/model/types.js.map +1 -0
- package/dist/model/values.d.ts +91 -0
- package/dist/model/values.d.ts.map +1 -0
- package/dist/model/values.js +195 -0
- package/dist/model/values.js.map +1 -0
- package/dist/model/wire.d.ts +356 -0
- package/dist/model/wire.d.ts.map +1 -0
- package/dist/model/wire.js +1504 -0
- package/dist/model/wire.js.map +1 -0
- package/dist/offline/index.d.ts +374 -0
- package/dist/offline/index.d.ts.map +1 -0
- package/dist/offline/index.js +422 -0
- package/dist/offline/index.js.map +1 -0
- package/dist/testing.d.ts +30 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +42 -0
- package/dist/testing.js.map +1 -0
- package/dist/version.d.ts +30 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +116 -0
- package/dist/version.js.map +1 -0
- package/package.json +98 -3
|
@@ -0,0 +1,966 @@
|
|
|
1
|
+
import { AxiomError, assertNever } from '../model/errors.js';
|
|
2
|
+
import { INTEGER_TEXT_PATTERN, isUndetermined, UNKNOWN } from '../model/types.js';
|
|
3
|
+
import { addMinutesToTime, minutesBetweenTimes, TIME_PATTERN } from '../model/time.js';
|
|
4
|
+
import { durationMinutes, durationSeconds, minutesBetweenDurations } from '../model/duration.js';
|
|
5
|
+
import { isRecord, isSafeInteger } from '../model/values.js';
|
|
6
|
+
import { compareByDomain, domained, equalByDomain } from './ordering.js';
|
|
7
|
+
import { distinctElements, reverseElements, sliceElements, sortElements } from './sequences.js';
|
|
8
|
+
import { absDecimalText, asDecimalString, ceilDecimal, floorDecimal, powDecimalTexts, powToPrecisionDecimal, roundDecimal, tryDecimalString, } from './decimal.js';
|
|
9
|
+
import { isE164PhoneNumber, isEmailAddress, isHttpUrl } from './validation.js';
|
|
10
|
+
import { addMinutesToInstant, civilDateOfInstant, minutesBetweenInstants, parseInstant, startOfDayInstant, } from './instant.js';
|
|
11
|
+
import { sumDecimals } from './logic.js';
|
|
12
|
+
import { moneyAmountText, moneyFromMinor, moneyMinor, toMoneyValue } from './money.js';
|
|
13
|
+
import { compilePattern, matchCompiledPattern } from './pattern.js';
|
|
14
|
+
import { asciiLower, asciiUpper, codePointLength, indexOfCodePoints, replaceAllLiteral, splitLiteral, substringCodePoints, trimAsciiWhitespace, } from './strings.js';
|
|
15
|
+
import { averageValue, firstValue, lastValue, medianValue, modeValue } from './reduce.js';
|
|
16
|
+
import { matchRegex, regexRefusalError } from './regex.js';
|
|
17
|
+
import { addDays, addMonths, addYears, daysBetween, daysFromCivil, formatPlainDate, monthsBetween, parsePlainDate, } from './plain-date.js';
|
|
18
|
+
/**
|
|
19
|
+
* The built-ins this module answers from evaluated arguments alone. The compiled language
|
|
20
|
+
* defines more (`BuiltinOperator`): the evaluator answers the aggregates, `present`,
|
|
21
|
+
* `is_relevant`, `is_unique`, `digest`, the dataset lookups and the gate-only built-ins
|
|
22
|
+
* itself, because each needs something an argument value does not carry — a member's
|
|
23
|
+
* declared domain, the list a key path is read inside, or the identity of a covered
|
|
24
|
+
* target.
|
|
25
|
+
*
|
|
26
|
+
* The tuple is the single source: the union is derived from it, the set used by
|
|
27
|
+
* `isImplementedOperator` is derived from it, and `applyBuiltin` ends with `assertNever`,
|
|
28
|
+
* so a name added here without a case is a compile error rather than a runtime refusal.
|
|
29
|
+
*/
|
|
30
|
+
export const IMPLEMENTED_OPERATORS = [
|
|
31
|
+
'len',
|
|
32
|
+
'lower',
|
|
33
|
+
'upper',
|
|
34
|
+
'trim',
|
|
35
|
+
'starts_with',
|
|
36
|
+
'ends_with',
|
|
37
|
+
'contains',
|
|
38
|
+
'ascii_match',
|
|
39
|
+
'is_email',
|
|
40
|
+
'is_phone',
|
|
41
|
+
'is_url',
|
|
42
|
+
'empty',
|
|
43
|
+
'between',
|
|
44
|
+
'sum',
|
|
45
|
+
'to_decimal',
|
|
46
|
+
'to_string',
|
|
47
|
+
'parse_integer',
|
|
48
|
+
'parse_decimal',
|
|
49
|
+
'round',
|
|
50
|
+
'round_up',
|
|
51
|
+
'round_down',
|
|
52
|
+
'round_even',
|
|
53
|
+
'pow',
|
|
54
|
+
'money_minor',
|
|
55
|
+
'money_from_minor',
|
|
56
|
+
'money_currency',
|
|
57
|
+
'money_scale',
|
|
58
|
+
'add_days',
|
|
59
|
+
'add_months',
|
|
60
|
+
'add_minutes',
|
|
61
|
+
'days_between',
|
|
62
|
+
'months_between',
|
|
63
|
+
'minutes_between',
|
|
64
|
+
'duration_minutes',
|
|
65
|
+
'duration_seconds',
|
|
66
|
+
'rule_ok_in',
|
|
67
|
+
'no_blocking_in',
|
|
68
|
+
'required_in',
|
|
69
|
+
'abs',
|
|
70
|
+
'ceil',
|
|
71
|
+
'floor',
|
|
72
|
+
'avg',
|
|
73
|
+
'median',
|
|
74
|
+
'first',
|
|
75
|
+
'last',
|
|
76
|
+
'replace',
|
|
77
|
+
'split',
|
|
78
|
+
'join',
|
|
79
|
+
'substring',
|
|
80
|
+
'index_of',
|
|
81
|
+
'add_years',
|
|
82
|
+
'start_of_day',
|
|
83
|
+
'civil_date',
|
|
84
|
+
'matches',
|
|
85
|
+
'mode',
|
|
86
|
+
'concat',
|
|
87
|
+
'year',
|
|
88
|
+
'month',
|
|
89
|
+
'day',
|
|
90
|
+
'weekday',
|
|
91
|
+
'parse_date',
|
|
92
|
+
'parse_instant',
|
|
93
|
+
'sort',
|
|
94
|
+
'slice',
|
|
95
|
+
'distinct',
|
|
96
|
+
'reverse',
|
|
97
|
+
];
|
|
98
|
+
const IMPLEMENTED_OPERATOR_SET = new Set(IMPLEMENTED_OPERATORS);
|
|
99
|
+
/** Whether the evaluator answers this operator from its argument values alone. */
|
|
100
|
+
export function isImplementedOperator(op) {
|
|
101
|
+
return IMPLEMENTED_OPERATOR_SET.has(op);
|
|
102
|
+
}
|
|
103
|
+
const ROUNDING_MODES = [
|
|
104
|
+
'up',
|
|
105
|
+
'down',
|
|
106
|
+
'ceiling',
|
|
107
|
+
'floor',
|
|
108
|
+
'half_up',
|
|
109
|
+
'half_even',
|
|
110
|
+
];
|
|
111
|
+
/** An integer power by repeated squaring: exact until the canonical range is left. */
|
|
112
|
+
export function integerPower(base, exponent, path = '') {
|
|
113
|
+
if (!Number.isInteger(exponent) || exponent < 0) {
|
|
114
|
+
throw new AxiomError('ENGINE_ERROR', 'pow requires a non-negative integer exponent; write `round(a / b, places)` for a negative power', path);
|
|
115
|
+
}
|
|
116
|
+
if (!isSafeInteger(base)) {
|
|
117
|
+
throw new AxiomError('ENGINE_ERROR', 'pow requires an exact integer base', path);
|
|
118
|
+
}
|
|
119
|
+
let result = 1n;
|
|
120
|
+
let factor = BigInt(base);
|
|
121
|
+
const boundary = BigInt(Number.MAX_SAFE_INTEGER);
|
|
122
|
+
const outside = (value) => value > boundary || value < -boundary;
|
|
123
|
+
let remaining = exponent;
|
|
124
|
+
while (remaining > 0) {
|
|
125
|
+
if (remaining % 2 === 1) {
|
|
126
|
+
result *= factor;
|
|
127
|
+
if (outside(result)) {
|
|
128
|
+
throw new AxiomError('ENGINE_ERROR', 'pow integer result overflows the canonical range', path);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
remaining = Math.floor(remaining / 2);
|
|
132
|
+
if (remaining > 0) {
|
|
133
|
+
factor *= factor;
|
|
134
|
+
if (outside(factor)) {
|
|
135
|
+
throw new AxiomError('ENGINE_ERROR', 'pow integer result overflows the canonical range', path);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return Number(result);
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* The non-negative integer an exponent names, or `undefined` when it names none.
|
|
143
|
+
*
|
|
144
|
+
* An exponent the artifact declares `decimal` arrives as canonical text even when its value is
|
|
145
|
+
* a whole number. It takes the same repeated-squaring path a JavaScript number takes, so
|
|
146
|
+
* `pow(1.000…1, 2)` refuses an inexact result whether the `2` was spelled as an integer or as
|
|
147
|
+
* decimal text. Text that is not a canonical integer, a negative integer, and an integer
|
|
148
|
+
* outside the safe range all take the working-precision path.
|
|
149
|
+
*/
|
|
150
|
+
function integerExponentOf(exponent) {
|
|
151
|
+
if (typeof exponent === 'number') {
|
|
152
|
+
return Number.isInteger(exponent) && exponent >= 0 ? exponent : undefined;
|
|
153
|
+
}
|
|
154
|
+
if (!INTEGER_TEXT_PATTERN.test(exponent))
|
|
155
|
+
return undefined;
|
|
156
|
+
const value = Number(exponent);
|
|
157
|
+
return isSafeInteger(value) && value >= 0 ? value : undefined;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* `pow(a, b)` at the language's arithmetic precision: an integer base stays an integer, a
|
|
161
|
+
* decimal base stays exact decimal text, and both follow the multiplication rule `*` uses.
|
|
162
|
+
*/
|
|
163
|
+
export function numericPower(base, exponent, path = '') {
|
|
164
|
+
const integerExponent = integerExponentOf(exponent);
|
|
165
|
+
if (integerExponent !== undefined) {
|
|
166
|
+
if (typeof base === 'number')
|
|
167
|
+
return integerPower(base, integerExponent, path);
|
|
168
|
+
return powDecimalTexts(asDecimalString(base, path), integerExponent, path);
|
|
169
|
+
}
|
|
170
|
+
return powToPrecisionDecimal(asDecimalString(typeof base === 'number' ? String(base) : base, path), asDecimalString(typeof exponent === 'number' ? String(exponent) : exponent, path), path);
|
|
171
|
+
}
|
|
172
|
+
function ensureArity(op, args, arity, path) {
|
|
173
|
+
if (args.length !== arity) {
|
|
174
|
+
throw new AxiomError('ENGINE_ERROR', `${op} takes ${String(arity)} arguments but received ${String(args.length)}`, path);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* One undetermined operand already decided the result ( "propagates"),
|
|
179
|
+
* with `UNKNOWN` winning over `DEFERRED`. A `null` operand is the empty
|
|
180
|
+
* value, which these built-ins lift to `UNKNOWN` rather than substituting zero or text
|
|
181
|
+
* and an empty local reading wins over a deferred one for the same
|
|
182
|
+
* reason.
|
|
183
|
+
*/
|
|
184
|
+
function propagated(args) {
|
|
185
|
+
let deferred;
|
|
186
|
+
for (const arg of args) {
|
|
187
|
+
if (arg === null)
|
|
188
|
+
return UNKNOWN;
|
|
189
|
+
if (!isUndetermined(arg))
|
|
190
|
+
continue;
|
|
191
|
+
if (arg.undetermined === 'UNKNOWN')
|
|
192
|
+
return arg;
|
|
193
|
+
deferred = arg;
|
|
194
|
+
}
|
|
195
|
+
return deferred;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* A canonical integer parsed from text, or `null` when the text is not one.
|
|
199
|
+
*
|
|
200
|
+
* `INTEGER_TEXT_PATTERN` is the one authority for the spelling — no leading `+`, no leading
|
|
201
|
+
* zeros beyond `0`, never `-0` — so a text the operand reader accepts is exactly a text this
|
|
202
|
+
* parse names. A value outside `EXPR-5.1.2`'s range is an ordinary miss, never a raised error.
|
|
203
|
+
*/
|
|
204
|
+
function parseIntegerText(text) {
|
|
205
|
+
if (!INTEGER_TEXT_PATTERN.test(text))
|
|
206
|
+
return null;
|
|
207
|
+
const value = Number(text);
|
|
208
|
+
return isSafeInteger(value) ? value : null;
|
|
209
|
+
}
|
|
210
|
+
function decimalArgument(value, op, path) {
|
|
211
|
+
if (typeof value === 'number') {
|
|
212
|
+
if (!isSafeInteger(value)) {
|
|
213
|
+
throw new AxiomError('ENGINE_ERROR', `${op} requires an exact decimal operand`, path);
|
|
214
|
+
}
|
|
215
|
+
return asDecimalString(String(value), path);
|
|
216
|
+
}
|
|
217
|
+
if (typeof value === 'string')
|
|
218
|
+
return asDecimalString(value, path);
|
|
219
|
+
throw new AxiomError('ENGINE_ERROR', `${op} requires a decimal operand`, path);
|
|
220
|
+
}
|
|
221
|
+
function integerArgument(value, op, path) {
|
|
222
|
+
if (typeof value === 'number' && isSafeInteger(value))
|
|
223
|
+
return value;
|
|
224
|
+
if (typeof value === 'string' && INTEGER_TEXT_PATTERN.test(value)) {
|
|
225
|
+
const parsed = Number(value);
|
|
226
|
+
if (isSafeInteger(parsed))
|
|
227
|
+
return parsed;
|
|
228
|
+
}
|
|
229
|
+
throw new AxiomError('ENGINE_ERROR', `${op} requires an integer operand`, path);
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Whether a runtime value has the duration shape. The built-in dispatching `minutes_between` has
|
|
233
|
+
* no declared domain, so the value's own shape selects the family: two duration records are a
|
|
234
|
+
* length pair, two clock strings are a time pair, and anything else is an instant pair.
|
|
235
|
+
*/
|
|
236
|
+
function isDurationShaped(value) {
|
|
237
|
+
if (isUndetermined(value) || !isRecord(value))
|
|
238
|
+
return false;
|
|
239
|
+
return typeof value['amount'] === 'number' && typeof value['unit'] === 'string';
|
|
240
|
+
}
|
|
241
|
+
function stringArgument(value, op, path) {
|
|
242
|
+
if (typeof value !== 'string') {
|
|
243
|
+
throw new AxiomError('ENGINE_ERROR', `${op} requires a text operand`, path);
|
|
244
|
+
}
|
|
245
|
+
return value;
|
|
246
|
+
}
|
|
247
|
+
function roundingModeArgument(value, path) {
|
|
248
|
+
const mode = ROUNDING_MODES.find((candidate) => candidate === value);
|
|
249
|
+
if (mode === undefined) {
|
|
250
|
+
throw new AxiomError('ENGINE_ERROR', `rounding mode must be one of ${ROUNDING_MODES.join(', ')}`, path);
|
|
251
|
+
}
|
|
252
|
+
return mode;
|
|
253
|
+
}
|
|
254
|
+
function moneyArgument(value, op, path) {
|
|
255
|
+
if (!isRecord(value)) {
|
|
256
|
+
throw new AxiomError('ENGINE_ERROR', `${op} requires a money operand`, path);
|
|
257
|
+
}
|
|
258
|
+
return toMoneyValue(value, path);
|
|
259
|
+
}
|
|
260
|
+
/** Reads a decimal-typed element of an aggregate operand. */
|
|
261
|
+
function elementArgument(value, op, path) {
|
|
262
|
+
if (isUndetermined(value)) {
|
|
263
|
+
throw new AxiomError('ENGINE_ERROR', `${op} reached an undetermined element`, path);
|
|
264
|
+
}
|
|
265
|
+
return decimalArgument(value, op, path);
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* The elements of a list operand for `sort`, `slice`, `distinct` and `reverse`.
|
|
269
|
+
*
|
|
270
|
+
* An element this device cannot decide aborts the whole answer with that sentinel: a list
|
|
271
|
+
* missing one member is not a sorted, deduplicated or reversed form of the input. Each kept
|
|
272
|
+
* element carries the declared element domain the caller stated, which is what makes a
|
|
273
|
+
* decimal list order numerically in the value-only door too.
|
|
274
|
+
*/
|
|
275
|
+
function sequenceOperand(op, args, operandDomains, path) {
|
|
276
|
+
ensureArity(op, args, op === 'slice' ? 3 : 1, path);
|
|
277
|
+
const operand = args[0];
|
|
278
|
+
if (operand === undefined || operand === null)
|
|
279
|
+
return UNKNOWN;
|
|
280
|
+
if (isUndetermined(operand))
|
|
281
|
+
return operand;
|
|
282
|
+
if (!Array.isArray(operand)) {
|
|
283
|
+
throw new AxiomError('ENGINE_ERROR', `${op} requires a list`, path);
|
|
284
|
+
}
|
|
285
|
+
const elements = [];
|
|
286
|
+
let deferred;
|
|
287
|
+
for (const [index, element] of operand.entries()) {
|
|
288
|
+
if (isUndetermined(element)) {
|
|
289
|
+
if (element.undetermined === 'UNKNOWN')
|
|
290
|
+
return element;
|
|
291
|
+
deferred ??= element;
|
|
292
|
+
continue;
|
|
293
|
+
}
|
|
294
|
+
elements.push({ value: element, domain: operandDomains.elementDomains?.[index] });
|
|
295
|
+
}
|
|
296
|
+
if (deferred !== undefined)
|
|
297
|
+
return deferred;
|
|
298
|
+
return elements;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* The ISO 8601 weekday of a civil date: Monday is 1 and Sunday is 7.
|
|
302
|
+
*
|
|
303
|
+
* The derivation is a day count, not a host `Date`: `daysFromCivil` puts 1970-01-01 (a
|
|
304
|
+
* Thursday) at zero, so adding three and taking the residue names Thursday as 4.
|
|
305
|
+
*/
|
|
306
|
+
function weekdayOf(date) {
|
|
307
|
+
const sinceEpoch = daysFromCivil(date.year, date.month, date.day);
|
|
308
|
+
return ((((sinceEpoch + 3) % 7) + 7) % 7) + 1;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Applies one built-in to already-evaluated arguments. This is the single place the
|
|
312
|
+
* walking-skeleton operators are implemented: `evaluate` dispatches compiled `call`
|
|
313
|
+
* nodes here, and a docs example executor reaches the same behaviour rather than a
|
|
314
|
+
* second copy of it.
|
|
315
|
+
*
|
|
316
|
+
* `operandDomains` is the caller's statement of what it knows: a compiled artifact passes
|
|
317
|
+
* the domains its declarations pin, and a documentation example passes its literals'. A
|
|
318
|
+
* caller that states nothing gets the value-only reading, never a guess that a string is a
|
|
319
|
+
* number.
|
|
320
|
+
*/
|
|
321
|
+
export function applyBuiltin(op, args, path = '', operandDomains = {}) {
|
|
322
|
+
switch (op) {
|
|
323
|
+
case 'sum': {
|
|
324
|
+
ensureArity(op, args, 1, path);
|
|
325
|
+
const operand = args[0];
|
|
326
|
+
if (operand === undefined)
|
|
327
|
+
throw new AxiomError('ENGINE_ERROR', `${op} requires a list`, path);
|
|
328
|
+
if (isUndetermined(operand))
|
|
329
|
+
return operand;
|
|
330
|
+
if (operand === null)
|
|
331
|
+
return UNKNOWN;
|
|
332
|
+
if (!Array.isArray(operand)) {
|
|
333
|
+
throw new AxiomError('ENGINE_ERROR', `${op} requires a list`, path);
|
|
334
|
+
}
|
|
335
|
+
return sumDecimals(operand.map((element) => isUndetermined(element)
|
|
336
|
+
? element
|
|
337
|
+
: element === null
|
|
338
|
+
? UNKNOWN
|
|
339
|
+
: elementArgument(element, op, path)), path);
|
|
340
|
+
}
|
|
341
|
+
case 'between': {
|
|
342
|
+
// Arity first: a call with the wrong width is refused even when an operand is
|
|
343
|
+
// undetermined, because the shape is wrong whatever the value would have been.
|
|
344
|
+
ensureArity(op, args, 3, path);
|
|
345
|
+
const undetermined = propagated(args);
|
|
346
|
+
if (undetermined !== undefined)
|
|
347
|
+
return undetermined;
|
|
348
|
+
const value = args[0];
|
|
349
|
+
const low = args[1];
|
|
350
|
+
const high = args[2];
|
|
351
|
+
if (value === undefined || low === undefined || high === undefined) {
|
|
352
|
+
throw new AxiomError('ENGINE_ERROR', 'between requires three operands', path);
|
|
353
|
+
}
|
|
354
|
+
if (value === null || low === null || high === null)
|
|
355
|
+
return UNKNOWN;
|
|
356
|
+
const domains = operandDomains.domains;
|
|
357
|
+
const at = (index, argument) => ({
|
|
358
|
+
value: argument,
|
|
359
|
+
domain: domains?.[index],
|
|
360
|
+
});
|
|
361
|
+
// The language's own order (`EXPR-6.1.14`), stated once in `ordering.ts`: numeric across
|
|
362
|
+
// integer/decimal, money by currency and scale, quantity by unit, text and dates by code
|
|
363
|
+
// point. Comparing the canonical spellings as JavaScript text answered `false` for
|
|
364
|
+
// `between(decimal "10", decimal "9", decimal "20")` and refused a money operand the
|
|
365
|
+
// compiler had admitted.
|
|
366
|
+
const lower = compareByDomain(at(1, low), at(0, value), path);
|
|
367
|
+
const upper = compareByDomain(at(0, value), at(2, high), path);
|
|
368
|
+
if (lower === undefined || upper === undefined) {
|
|
369
|
+
throw new AxiomError('ENGINE_ERROR', 'between requires comparable operands', path);
|
|
370
|
+
}
|
|
371
|
+
return lower <= 0 && upper <= 0;
|
|
372
|
+
}
|
|
373
|
+
case 'len': {
|
|
374
|
+
const undetermined = propagated(args);
|
|
375
|
+
if (undetermined !== undefined)
|
|
376
|
+
return undetermined;
|
|
377
|
+
ensureArity(op, args, 1, path);
|
|
378
|
+
const operand = args[0] ?? null;
|
|
379
|
+
if (typeof operand === 'string')
|
|
380
|
+
return codePointLength(operand);
|
|
381
|
+
if (Array.isArray(operand))
|
|
382
|
+
return operand.length;
|
|
383
|
+
throw new AxiomError('ENGINE_ERROR', 'len requires a text or list operand', path);
|
|
384
|
+
}
|
|
385
|
+
case 'lower':
|
|
386
|
+
case 'upper': {
|
|
387
|
+
const undetermined = propagated(args);
|
|
388
|
+
if (undetermined !== undefined)
|
|
389
|
+
return undetermined;
|
|
390
|
+
ensureArity(op, args, 1, path);
|
|
391
|
+
const text = stringArgument(args[0] ?? null, op, path);
|
|
392
|
+
return op === 'lower' ? asciiLower(text) : asciiUpper(text);
|
|
393
|
+
}
|
|
394
|
+
case 'trim': {
|
|
395
|
+
const undetermined = propagated(args);
|
|
396
|
+
if (undetermined !== undefined)
|
|
397
|
+
return undetermined;
|
|
398
|
+
ensureArity(op, args, 1, path);
|
|
399
|
+
return trimAsciiWhitespace(stringArgument(args[0] ?? null, op, path));
|
|
400
|
+
}
|
|
401
|
+
case 'is_email':
|
|
402
|
+
case 'is_phone':
|
|
403
|
+
case 'is_url': {
|
|
404
|
+
const undetermined = propagated(args);
|
|
405
|
+
if (undetermined !== undefined)
|
|
406
|
+
return undetermined;
|
|
407
|
+
ensureArity(op, args, 1, path);
|
|
408
|
+
const text = stringArgument(args[0] ?? null, op, path);
|
|
409
|
+
if (op === 'is_email')
|
|
410
|
+
return isEmailAddress(text);
|
|
411
|
+
return op === 'is_phone' ? isE164PhoneNumber(text) : isHttpUrl(text);
|
|
412
|
+
}
|
|
413
|
+
case 'empty': {
|
|
414
|
+
ensureArity(op, args, 1, path);
|
|
415
|
+
const operand = args[0];
|
|
416
|
+
// `empty` asks whether a value has content. An explicit `null`, empty text and an
|
|
417
|
+
// empty list have none; a zero and a false are values the author recorded, so answering
|
|
418
|
+
// `true` for them would make a meaningful `0` indistinguishable from nothing. A sentinel
|
|
419
|
+
// decides the question rather than answering `false`; absence is a property of a path, so
|
|
420
|
+
// that answer — and the access refusal — belong to the evaluator.
|
|
421
|
+
if (isUndetermined(operand))
|
|
422
|
+
return operand;
|
|
423
|
+
return operand === null || operand === '' || (Array.isArray(operand) && operand.length === 0);
|
|
424
|
+
}
|
|
425
|
+
case 'to_decimal': {
|
|
426
|
+
const undetermined = propagated(args);
|
|
427
|
+
if (undetermined !== undefined)
|
|
428
|
+
return undetermined;
|
|
429
|
+
ensureArity(op, args, 1, path);
|
|
430
|
+
return decimalArgument(args[0] ?? null, op, path);
|
|
431
|
+
}
|
|
432
|
+
case 'to_string': {
|
|
433
|
+
const undetermined = propagated(args);
|
|
434
|
+
if (undetermined !== undefined)
|
|
435
|
+
return undetermined;
|
|
436
|
+
ensureArity(op, args, 1, path);
|
|
437
|
+
const operand = args[0] ?? null;
|
|
438
|
+
// A decimal, a date and an instant are already canonical text on the wire, so the
|
|
439
|
+
// cast renders the domains that are not text and passes text through. Money renders
|
|
440
|
+
// its amount at its declared scale through the one display formatter.
|
|
441
|
+
if (typeof operand === 'string')
|
|
442
|
+
return operand;
|
|
443
|
+
if (typeof operand === 'boolean')
|
|
444
|
+
return operand ? 'true' : 'false';
|
|
445
|
+
if (typeof operand === 'number' && isSafeInteger(operand)) {
|
|
446
|
+
return String(operand);
|
|
447
|
+
}
|
|
448
|
+
if (operand !== null && typeof operand === 'object' && !Array.isArray(operand)) {
|
|
449
|
+
const members = operand;
|
|
450
|
+
if ('minor' in members || 'currency' in members || 'scale' in members) {
|
|
451
|
+
const money = toMoneyValue(members, path);
|
|
452
|
+
const text = moneyAmountText(money.minor, money.scale);
|
|
453
|
+
if (text === undefined) {
|
|
454
|
+
throw new AxiomError('ENGINE_ERROR', 'money amount is not canonical', path);
|
|
455
|
+
}
|
|
456
|
+
return text;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
throw new AxiomError('ENGINE_ERROR', 'to_string requires a scalar operand', path);
|
|
460
|
+
}
|
|
461
|
+
case 'parse_integer': {
|
|
462
|
+
const undetermined = propagated(args);
|
|
463
|
+
if (undetermined !== undefined)
|
|
464
|
+
return undetermined;
|
|
465
|
+
ensureArity(op, args, 1, path);
|
|
466
|
+
return parseIntegerText(stringArgument(args[0] ?? null, op, path));
|
|
467
|
+
}
|
|
468
|
+
case 'parse_decimal': {
|
|
469
|
+
const undetermined = propagated(args);
|
|
470
|
+
if (undetermined !== undefined)
|
|
471
|
+
return undetermined;
|
|
472
|
+
ensureArity(op, args, 1, path);
|
|
473
|
+
return tryDecimalString(stringArgument(args[0] ?? null, op, path)) ?? null;
|
|
474
|
+
}
|
|
475
|
+
case 'starts_with':
|
|
476
|
+
case 'ends_with': {
|
|
477
|
+
const undetermined = propagated(args);
|
|
478
|
+
if (undetermined !== undefined)
|
|
479
|
+
return undetermined;
|
|
480
|
+
ensureArity(op, args, 2, path);
|
|
481
|
+
const text = stringArgument(args[0] ?? null, op, path);
|
|
482
|
+
const prefix = stringArgument(args[1] ?? null, op, path);
|
|
483
|
+
return op === 'starts_with' ? text.startsWith(prefix) : text.endsWith(prefix);
|
|
484
|
+
}
|
|
485
|
+
case 'contains': {
|
|
486
|
+
const undetermined = propagated(args);
|
|
487
|
+
if (undetermined !== undefined)
|
|
488
|
+
return undetermined;
|
|
489
|
+
ensureArity(op, args, 2, path);
|
|
490
|
+
// The list form is answered by the evaluator, which keeps each member's declared
|
|
491
|
+
// domain; this path is the literal substring test of.
|
|
492
|
+
const text = stringArgument(args[0] ?? null, op, path);
|
|
493
|
+
const part = stringArgument(args[1] ?? null, op, path);
|
|
494
|
+
return text.includes(part);
|
|
495
|
+
}
|
|
496
|
+
case 'ascii_match': {
|
|
497
|
+
const undetermined = propagated(args);
|
|
498
|
+
if (undetermined !== undefined)
|
|
499
|
+
return undetermined;
|
|
500
|
+
ensureArity(op, args, 2, path);
|
|
501
|
+
const subject = stringArgument(args[0] ?? null, op, path);
|
|
502
|
+
const source = stringArgument(args[1] ?? null, op, path);
|
|
503
|
+
// A pattern the compiler could not see (it arrived as a value) is still refused
|
|
504
|
+
// before matching, and as a runtime failure the report can carry.
|
|
505
|
+
let pattern;
|
|
506
|
+
try {
|
|
507
|
+
pattern = compilePattern(source);
|
|
508
|
+
}
|
|
509
|
+
catch (error) {
|
|
510
|
+
if (!(error instanceof AxiomError))
|
|
511
|
+
throw error;
|
|
512
|
+
// The operator is not a location: the report names the path the call was reached
|
|
513
|
+
// from (empty when the evaluator has none), never `ascii_match` itself.
|
|
514
|
+
throw new AxiomError('ENGINE_ERROR', `pattern is outside the supported subset: ${error.message}`, path);
|
|
515
|
+
}
|
|
516
|
+
return matchCompiledPattern(pattern, subject);
|
|
517
|
+
}
|
|
518
|
+
case 'round':
|
|
519
|
+
case 'round_up':
|
|
520
|
+
case 'round_down':
|
|
521
|
+
case 'round_even': {
|
|
522
|
+
const undetermined = propagated(args);
|
|
523
|
+
if (undetermined !== undefined)
|
|
524
|
+
return undetermined;
|
|
525
|
+
ensureArity(op, args, 2, path);
|
|
526
|
+
const mode = op === 'round'
|
|
527
|
+
? 'half_up'
|
|
528
|
+
: op === 'round_up'
|
|
529
|
+
? 'up'
|
|
530
|
+
: op === 'round_down'
|
|
531
|
+
? 'down'
|
|
532
|
+
: 'half_even';
|
|
533
|
+
return roundDecimal(decimalArgument(args[0] ?? null, op, path), integerArgument(args[1] ?? null, op, path), mode, path);
|
|
534
|
+
}
|
|
535
|
+
case 'rule_ok_in':
|
|
536
|
+
case 'no_blocking_in':
|
|
537
|
+
case 'required_in':
|
|
538
|
+
// These read fellow rules of an evaluation, so an example notation with no rule host
|
|
539
|
+
// has nothing to fold: it answers undecided, the same answer an absent capability gives.
|
|
540
|
+
ensureArity(op, args, 1, path);
|
|
541
|
+
return UNKNOWN;
|
|
542
|
+
case 'pow': {
|
|
543
|
+
const undetermined = propagated(args);
|
|
544
|
+
if (undetermined !== undefined)
|
|
545
|
+
return undetermined;
|
|
546
|
+
ensureArity(op, args, 2, path);
|
|
547
|
+
const base = args[0];
|
|
548
|
+
const exponent = args[1];
|
|
549
|
+
if (typeof base !== 'number' && typeof base !== 'string') {
|
|
550
|
+
throw new AxiomError('ENGINE_ERROR', 'pow requires an integer or decimal base', path);
|
|
551
|
+
}
|
|
552
|
+
if (typeof exponent !== 'number' && typeof exponent !== 'string') {
|
|
553
|
+
throw new AxiomError('ENGINE_ERROR', 'pow requires an integer or decimal exponent', path);
|
|
554
|
+
}
|
|
555
|
+
return numericPower(base, exponent, path);
|
|
556
|
+
}
|
|
557
|
+
case 'money_minor':
|
|
558
|
+
case 'money_from_minor':
|
|
559
|
+
case 'money_currency':
|
|
560
|
+
case 'money_scale': {
|
|
561
|
+
const undetermined = propagated(args);
|
|
562
|
+
if (undetermined !== undefined)
|
|
563
|
+
return undetermined;
|
|
564
|
+
if (op === 'money_minor') {
|
|
565
|
+
ensureArity(op, args, 1, path);
|
|
566
|
+
return moneyMinor(moneyArgument(args[0] ?? null, op, path), path);
|
|
567
|
+
}
|
|
568
|
+
if (op === 'money_currency' || op === 'money_scale') {
|
|
569
|
+
ensureArity(op, args, 1, path);
|
|
570
|
+
const money = moneyArgument(args[0] ?? null, op, path);
|
|
571
|
+
return op === 'money_currency' ? money.currency : money.scale;
|
|
572
|
+
}
|
|
573
|
+
ensureArity(op, args, 4, path);
|
|
574
|
+
const [minor, currency, scale, mode] = args;
|
|
575
|
+
return moneyFromMinor(decimalArgument(minor ?? null, op, path), stringArgument(currency ?? null, op, path), integerArgument(scale ?? null, op, path), roundingModeArgument(mode ?? null, path), path);
|
|
576
|
+
}
|
|
577
|
+
case 'add_days':
|
|
578
|
+
case 'add_months': {
|
|
579
|
+
const undetermined = propagated(args);
|
|
580
|
+
if (undetermined !== undefined)
|
|
581
|
+
return undetermined;
|
|
582
|
+
ensureArity(op, args, 2, path);
|
|
583
|
+
const date = parsePlainDate(stringArgument(args[0] ?? null, op, path), path);
|
|
584
|
+
const amount = integerArgument(args[1] ?? null, op, path);
|
|
585
|
+
return formatPlainDate(op === 'add_days' ? addDays(date, amount, path) : addMonths(date, amount, path), path);
|
|
586
|
+
}
|
|
587
|
+
case 'add_minutes': {
|
|
588
|
+
const undetermined = propagated(args);
|
|
589
|
+
if (undetermined !== undefined)
|
|
590
|
+
return undetermined;
|
|
591
|
+
ensureArity(op, args, 2, path);
|
|
592
|
+
const first = stringArgument(args[0] ?? null, op, path);
|
|
593
|
+
const amount = integerArgument(args[1] ?? null, op, path);
|
|
594
|
+
// A `time` is a clock reading, so its arithmetic wraps inside the day; an instant is a UTC
|
|
595
|
+
// point, so its arithmetic continues into the next one. The spelling, not a declaration,
|
|
596
|
+
// distinguishes them because the function is total over both domains.
|
|
597
|
+
if (TIME_PATTERN.test(first))
|
|
598
|
+
return addMinutesToTime(first, amount, path);
|
|
599
|
+
return addMinutesToInstant(parseInstant(first, path), amount, path);
|
|
600
|
+
}
|
|
601
|
+
case 'days_between':
|
|
602
|
+
case 'months_between': {
|
|
603
|
+
const undetermined = propagated(args);
|
|
604
|
+
if (undetermined !== undefined)
|
|
605
|
+
return undetermined;
|
|
606
|
+
ensureArity(op, args, 2, path);
|
|
607
|
+
const from = parsePlainDate(stringArgument(args[0] ?? null, op, path), path);
|
|
608
|
+
const to = parsePlainDate(stringArgument(args[1] ?? null, op, path), path);
|
|
609
|
+
return op === 'days_between' ? daysBetween(from, to) : monthsBetween(from, to);
|
|
610
|
+
}
|
|
611
|
+
case 'minutes_between': {
|
|
612
|
+
const undetermined = propagated(args);
|
|
613
|
+
if (undetermined !== undefined)
|
|
614
|
+
return undetermined;
|
|
615
|
+
ensureArity(op, args, 2, path);
|
|
616
|
+
const first = args[0] ?? null;
|
|
617
|
+
const second = args[1] ?? null;
|
|
618
|
+
if (typeof first === 'string' && typeof second === 'string' && TIME_PATTERN.test(first)) {
|
|
619
|
+
return minutesBetweenTimes(first, second, path);
|
|
620
|
+
}
|
|
621
|
+
if (isDurationShaped(first) && isDurationShaped(second)) {
|
|
622
|
+
return minutesBetweenDurations(first, second, path);
|
|
623
|
+
}
|
|
624
|
+
return minutesBetweenInstants(stringArgument(first, op, path), stringArgument(second, op, path), path);
|
|
625
|
+
}
|
|
626
|
+
case 'duration_minutes':
|
|
627
|
+
case 'duration_seconds': {
|
|
628
|
+
const undetermined = propagated(args);
|
|
629
|
+
if (undetermined !== undefined)
|
|
630
|
+
return undetermined;
|
|
631
|
+
ensureArity(op, args, 1, path);
|
|
632
|
+
const value = args[0] ?? null;
|
|
633
|
+
return op === 'duration_minutes'
|
|
634
|
+
? durationMinutes(value, path)
|
|
635
|
+
: durationSeconds(value, path);
|
|
636
|
+
}
|
|
637
|
+
case 'abs': {
|
|
638
|
+
const undetermined = propagated(args);
|
|
639
|
+
if (undetermined !== undefined)
|
|
640
|
+
return undetermined;
|
|
641
|
+
ensureArity(op, args, 1, path);
|
|
642
|
+
const operand = args[0] ?? null;
|
|
643
|
+
// Money keeps its currency and scale: the magnitude is the minor amount's, never a
|
|
644
|
+
// rescale or a re-spelling through the rendered amount.
|
|
645
|
+
if (isRecord(operand)) {
|
|
646
|
+
const money = moneyArgument(operand, op, path);
|
|
647
|
+
const minor = BigInt(money.minor);
|
|
648
|
+
return { ...money, minor: (minor < 0n ? -minor : minor).toString() };
|
|
649
|
+
}
|
|
650
|
+
if (typeof operand === 'number') {
|
|
651
|
+
if (!isSafeInteger(operand)) {
|
|
652
|
+
throw new AxiomError('ENGINE_ERROR', 'abs requires an exact decimal operand', path);
|
|
653
|
+
}
|
|
654
|
+
// `Math.abs` of a safe integer is a safe integer, and `-0` cannot survive it.
|
|
655
|
+
return Math.abs(operand);
|
|
656
|
+
}
|
|
657
|
+
if (typeof operand === 'string')
|
|
658
|
+
return absDecimalText(asDecimalString(operand, path), path);
|
|
659
|
+
throw new AxiomError('ENGINE_ERROR', 'abs requires a number, decimal or money operand', path);
|
|
660
|
+
}
|
|
661
|
+
case 'ceil':
|
|
662
|
+
case 'floor': {
|
|
663
|
+
const undetermined = propagated(args);
|
|
664
|
+
if (undetermined !== undefined)
|
|
665
|
+
return undetermined;
|
|
666
|
+
ensureArity(op, args, 1, path);
|
|
667
|
+
const decimal = decimalArgument(args[0] ?? null, op, path);
|
|
668
|
+
// `ceiling` is toward positive infinity and `floor` toward negative infinity, so the
|
|
669
|
+
// negative cases are the ones a careless "away from zero" would get wrong.
|
|
670
|
+
return op === 'ceil' ? ceilDecimal(decimal, path) : floorDecimal(decimal, path);
|
|
671
|
+
}
|
|
672
|
+
case 'avg':
|
|
673
|
+
case 'median': {
|
|
674
|
+
ensureArity(op, args, 1, path);
|
|
675
|
+
const operand = args[0];
|
|
676
|
+
if (isUndetermined(operand))
|
|
677
|
+
return operand;
|
|
678
|
+
if (operand === null || operand === undefined)
|
|
679
|
+
return UNKNOWN;
|
|
680
|
+
if (!Array.isArray(operand)) {
|
|
681
|
+
throw new AxiomError('ENGINE_ERROR', `${op} requires a list`, path);
|
|
682
|
+
}
|
|
683
|
+
const values = [];
|
|
684
|
+
let deferred;
|
|
685
|
+
for (const element of operand) {
|
|
686
|
+
// `null` is the empty value and a missing reading, not a zero, so it decides the
|
|
687
|
+
// aggregate rather than being skipped (`EXPR-10.2.3`).
|
|
688
|
+
if (element === null)
|
|
689
|
+
return UNKNOWN;
|
|
690
|
+
if (isUndetermined(element)) {
|
|
691
|
+
if (element.undetermined === 'UNKNOWN')
|
|
692
|
+
return UNKNOWN;
|
|
693
|
+
deferred ??= element;
|
|
694
|
+
continue;
|
|
695
|
+
}
|
|
696
|
+
values.push(element);
|
|
697
|
+
}
|
|
698
|
+
// No partial result: a deferred element could belong to any class, so the answer waits.
|
|
699
|
+
if (deferred !== undefined)
|
|
700
|
+
return deferred;
|
|
701
|
+
return op === 'avg' ? averageValue(values, path) : medianValue(values, path);
|
|
702
|
+
}
|
|
703
|
+
case 'first':
|
|
704
|
+
case 'last': {
|
|
705
|
+
ensureArity(op, args, 1, path);
|
|
706
|
+
const operand = args[0];
|
|
707
|
+
if (isUndetermined(operand))
|
|
708
|
+
return operand;
|
|
709
|
+
if (operand === null || operand === undefined)
|
|
710
|
+
return UNKNOWN;
|
|
711
|
+
if (!Array.isArray(operand)) {
|
|
712
|
+
throw new AxiomError('ENGINE_ERROR', `${op} requires a list`, path);
|
|
713
|
+
}
|
|
714
|
+
// An empty list is the empty value `null`, the binder's own convention for a boundary
|
|
715
|
+
// with no neighbour (`EXPR-10.1.2`).
|
|
716
|
+
return op === 'first' ? firstValue(operand) : lastValue(operand);
|
|
717
|
+
}
|
|
718
|
+
case 'replace': {
|
|
719
|
+
const undetermined = propagated(args);
|
|
720
|
+
if (undetermined !== undefined)
|
|
721
|
+
return undetermined;
|
|
722
|
+
ensureArity(op, args, 3, path);
|
|
723
|
+
const text = stringArgument(args[0] ?? null, op, path);
|
|
724
|
+
const find = stringArgument(args[1] ?? null, op, path);
|
|
725
|
+
// An empty needle has no occurrence rule that is not degenerate, so it is refused here
|
|
726
|
+
// for a computed needle exactly as the checker refuses a literal one.
|
|
727
|
+
if (find === '') {
|
|
728
|
+
throw new AxiomError('ENGINE_ERROR', 'replace requires a non-empty find operand', path);
|
|
729
|
+
}
|
|
730
|
+
return replaceAllLiteral(text, find, stringArgument(args[2] ?? null, op, path));
|
|
731
|
+
}
|
|
732
|
+
case 'split': {
|
|
733
|
+
const undetermined = propagated(args);
|
|
734
|
+
if (undetermined !== undefined)
|
|
735
|
+
return undetermined;
|
|
736
|
+
ensureArity(op, args, 2, path);
|
|
737
|
+
const text = stringArgument(args[0] ?? null, op, path);
|
|
738
|
+
const separator = stringArgument(args[1] ?? null, op, path);
|
|
739
|
+
if (separator === '') {
|
|
740
|
+
throw new AxiomError('ENGINE_ERROR', 'split requires a non-empty separator operand', path);
|
|
741
|
+
}
|
|
742
|
+
return splitLiteral(text, separator);
|
|
743
|
+
}
|
|
744
|
+
case 'join': {
|
|
745
|
+
const undetermined = propagated(args);
|
|
746
|
+
if (undetermined !== undefined)
|
|
747
|
+
return undetermined;
|
|
748
|
+
ensureArity(op, args, 2, path);
|
|
749
|
+
const list = args[0] ?? null;
|
|
750
|
+
const separator = stringArgument(args[1] ?? null, op, path);
|
|
751
|
+
// `propagated` lifts a `null` list to UNKNOWN, so a non-array here is a value the list
|
|
752
|
+
// signature does not admit.
|
|
753
|
+
if (!Array.isArray(list)) {
|
|
754
|
+
throw new AxiomError('ENGINE_ERROR', 'join requires a list of text', path);
|
|
755
|
+
}
|
|
756
|
+
const parts = [];
|
|
757
|
+
for (const item of list) {
|
|
758
|
+
if (typeof item !== 'string') {
|
|
759
|
+
throw new AxiomError('ENGINE_ERROR', 'join requires a list of text', path);
|
|
760
|
+
}
|
|
761
|
+
parts.push(item);
|
|
762
|
+
}
|
|
763
|
+
return parts.join(separator);
|
|
764
|
+
}
|
|
765
|
+
case 'substring': {
|
|
766
|
+
const undetermined = propagated(args);
|
|
767
|
+
if (undetermined !== undefined)
|
|
768
|
+
return undetermined;
|
|
769
|
+
ensureArity(op, args, 3, path);
|
|
770
|
+
const text = stringArgument(args[0] ?? null, op, path);
|
|
771
|
+
const start = integerArgument(args[1] ?? null, op, path);
|
|
772
|
+
const length = integerArgument(args[2] ?? null, op, path);
|
|
773
|
+
if (start < 0 || length < 0) {
|
|
774
|
+
throw new AxiomError('ENGINE_ERROR', 'substring requires a non-negative start and length', path);
|
|
775
|
+
}
|
|
776
|
+
return substringCodePoints(text, start, length);
|
|
777
|
+
}
|
|
778
|
+
case 'index_of': {
|
|
779
|
+
const undetermined = propagated(args);
|
|
780
|
+
if (undetermined !== undefined)
|
|
781
|
+
return undetermined;
|
|
782
|
+
ensureArity(op, args, 2, path);
|
|
783
|
+
return indexOfCodePoints(stringArgument(args[0] ?? null, op, path), stringArgument(args[1] ?? null, op, path));
|
|
784
|
+
}
|
|
785
|
+
case 'add_years': {
|
|
786
|
+
const undetermined = propagated(args);
|
|
787
|
+
if (undetermined !== undefined)
|
|
788
|
+
return undetermined;
|
|
789
|
+
ensureArity(op, args, 2, path);
|
|
790
|
+
return formatPlainDate(addYears(parsePlainDate(stringArgument(args[0] ?? null, op, path), path), integerArgument(args[1] ?? null, op, path), path), path);
|
|
791
|
+
}
|
|
792
|
+
case 'start_of_day': {
|
|
793
|
+
const undetermined = propagated(args);
|
|
794
|
+
if (undetermined !== undefined)
|
|
795
|
+
return undetermined;
|
|
796
|
+
ensureArity(op, args, 1, path);
|
|
797
|
+
return startOfDayInstant(stringArgument(args[0] ?? null, op, path), path);
|
|
798
|
+
}
|
|
799
|
+
case 'civil_date': {
|
|
800
|
+
const undetermined = propagated(args);
|
|
801
|
+
if (undetermined !== undefined)
|
|
802
|
+
return undetermined;
|
|
803
|
+
ensureArity(op, args, 1, path);
|
|
804
|
+
return civilDateOfInstant(stringArgument(args[0] ?? null, op, path), path);
|
|
805
|
+
}
|
|
806
|
+
case 'matches': {
|
|
807
|
+
const undetermined = propagated(args);
|
|
808
|
+
if (undetermined !== undefined)
|
|
809
|
+
return undetermined;
|
|
810
|
+
if (args.length !== 2 && args.length !== 3) {
|
|
811
|
+
throw new AxiomError('ENGINE_ERROR', `matches takes 2 to 3 arguments but received ${String(args.length)}`, path);
|
|
812
|
+
}
|
|
813
|
+
const subject = stringArgument(args[0] ?? null, op, path);
|
|
814
|
+
const pattern = stringArgument(args[1] ?? null, op, path);
|
|
815
|
+
const flags = args.length === 3 ? stringArgument(args[2] ?? null, op, path) : '';
|
|
816
|
+
const outcome = matchRegex(subject, pattern, flags);
|
|
817
|
+
if (outcome.kind !== 'tested')
|
|
818
|
+
throw regexRefusalError(outcome, path);
|
|
819
|
+
return outcome.matched;
|
|
820
|
+
}
|
|
821
|
+
case 'mode': {
|
|
822
|
+
ensureArity(op, args, 1, path);
|
|
823
|
+
const operand = args[0];
|
|
824
|
+
if (isUndetermined(operand))
|
|
825
|
+
return operand;
|
|
826
|
+
if (operand === null || operand === undefined)
|
|
827
|
+
return UNKNOWN;
|
|
828
|
+
if (!Array.isArray(operand)) {
|
|
829
|
+
throw new AxiomError('ENGINE_ERROR', 'mode requires a list', path);
|
|
830
|
+
}
|
|
831
|
+
const values = [];
|
|
832
|
+
let deferred;
|
|
833
|
+
for (const element of operand) {
|
|
834
|
+
if (element === null)
|
|
835
|
+
return UNKNOWN;
|
|
836
|
+
if (isUndetermined(element)) {
|
|
837
|
+
if (element.undetermined === 'UNKNOWN')
|
|
838
|
+
return UNKNOWN;
|
|
839
|
+
deferred ??= element;
|
|
840
|
+
continue;
|
|
841
|
+
}
|
|
842
|
+
values.push(element);
|
|
843
|
+
}
|
|
844
|
+
if (deferred !== undefined)
|
|
845
|
+
return deferred;
|
|
846
|
+
return modeValue(values, undefined, path);
|
|
847
|
+
}
|
|
848
|
+
case 'year':
|
|
849
|
+
case 'month':
|
|
850
|
+
case 'day':
|
|
851
|
+
case 'weekday': {
|
|
852
|
+
ensureArity(op, args, 1, path);
|
|
853
|
+
const operand = args[0];
|
|
854
|
+
if (operand === undefined) {
|
|
855
|
+
throw new AxiomError('ENGINE_ERROR', `${op} requires a date operand`, path);
|
|
856
|
+
}
|
|
857
|
+
if (isUndetermined(operand))
|
|
858
|
+
return operand;
|
|
859
|
+
// The empty value lifts to `UNKNOWN`, as it does for every operator that reads a
|
|
860
|
+
// component: `year(null)` is not the year zero.
|
|
861
|
+
if (operand === null)
|
|
862
|
+
return UNKNOWN;
|
|
863
|
+
const date = parsePlainDate(stringArgument(operand, op, path), path);
|
|
864
|
+
switch (op) {
|
|
865
|
+
case 'year':
|
|
866
|
+
return date.year;
|
|
867
|
+
case 'month':
|
|
868
|
+
return date.month;
|
|
869
|
+
case 'day':
|
|
870
|
+
return date.day;
|
|
871
|
+
case 'weekday':
|
|
872
|
+
return weekdayOf(date);
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
case 'parse_date': {
|
|
876
|
+
ensureArity(op, args, 1, path);
|
|
877
|
+
const operand = args[0];
|
|
878
|
+
if (operand === undefined) {
|
|
879
|
+
throw new AxiomError('ENGINE_ERROR', 'parse_date requires a text operand', path);
|
|
880
|
+
}
|
|
881
|
+
if (isUndetermined(operand))
|
|
882
|
+
return operand;
|
|
883
|
+
if (operand === null)
|
|
884
|
+
return null;
|
|
885
|
+
if (typeof operand !== 'string') {
|
|
886
|
+
throw new AxiomError('ENGINE_ERROR', 'parse_date requires a text operand', path);
|
|
887
|
+
}
|
|
888
|
+
try {
|
|
889
|
+
return formatPlainDate(parsePlainDate(operand, path));
|
|
890
|
+
}
|
|
891
|
+
catch {
|
|
892
|
+
// A miss is the empty value, never an error: the text a caller typed is data, and a
|
|
893
|
+
// calendar day that does not exist (`2026-02-30`) is a miss like any other.
|
|
894
|
+
return null;
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
case 'parse_instant': {
|
|
898
|
+
ensureArity(op, args, 1, path);
|
|
899
|
+
const operand = args[0];
|
|
900
|
+
if (operand === undefined) {
|
|
901
|
+
throw new AxiomError('ENGINE_ERROR', 'parse_instant requires a text operand', path);
|
|
902
|
+
}
|
|
903
|
+
if (isUndetermined(operand))
|
|
904
|
+
return operand;
|
|
905
|
+
if (operand === null)
|
|
906
|
+
return null;
|
|
907
|
+
if (typeof operand !== 'string') {
|
|
908
|
+
throw new AxiomError('ENGINE_ERROR', 'parse_instant requires a text operand', path);
|
|
909
|
+
}
|
|
910
|
+
try {
|
|
911
|
+
return parseInstant(operand, path);
|
|
912
|
+
}
|
|
913
|
+
catch {
|
|
914
|
+
return null;
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
case 'sort':
|
|
918
|
+
case 'distinct':
|
|
919
|
+
case 'reverse':
|
|
920
|
+
case 'slice': {
|
|
921
|
+
const read = sequenceOperand(op, args, operandDomains, path);
|
|
922
|
+
if (isUndetermined(read))
|
|
923
|
+
return read;
|
|
924
|
+
const algebra = {
|
|
925
|
+
compare: (left, right, operandPath) => compareByDomain(left, right, operandPath),
|
|
926
|
+
equal: (left, right, operandPath) => equalByDomain(left, right, operandPath),
|
|
927
|
+
};
|
|
928
|
+
switch (op) {
|
|
929
|
+
case 'sort':
|
|
930
|
+
return sortElements(read, algebra, path).map((element) => element.value);
|
|
931
|
+
case 'distinct':
|
|
932
|
+
return distinctElements(read, algebra, path).map((element) => element.value);
|
|
933
|
+
case 'reverse':
|
|
934
|
+
return reverseElements(read).map((element) => element.value);
|
|
935
|
+
case 'slice': {
|
|
936
|
+
const start = integerArgument(args[1] ?? null, op, path);
|
|
937
|
+
const count = integerArgument(args[2] ?? null, op, path);
|
|
938
|
+
return sliceElements(read, start, count, path).map((element) => element.value);
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
case 'concat': {
|
|
943
|
+
// Variadic with the signature's bound; the compiler refuses a count outside it, and this
|
|
944
|
+
// is the refusal a hand-built artifact meets. An undetermined operand propagates with
|
|
945
|
+
// `UNKNOWN` beating `DEFERRED`, the same fold the fixed-arity operators use.
|
|
946
|
+
if (args.length < 2 || args.length > 32) {
|
|
947
|
+
throw new AxiomError('ENGINE_ERROR', `concat takes 2 to 32 arguments but received ${String(args.length)}`, path);
|
|
948
|
+
}
|
|
949
|
+
const undetermined = propagated(args);
|
|
950
|
+
if (undetermined !== undefined)
|
|
951
|
+
return undetermined;
|
|
952
|
+
// One pass, one accumulator: the common call allocates no intermediate list.
|
|
953
|
+
let text = '';
|
|
954
|
+
for (const [index, argument] of args.entries()) {
|
|
955
|
+
if (typeof argument !== 'string') {
|
|
956
|
+
throw new AxiomError('ENGINE_ERROR', `concat argument ${String(index + 1)} requires a text operand, got ${argument === null ? 'null' : typeof argument}`, path);
|
|
957
|
+
}
|
|
958
|
+
text += argument;
|
|
959
|
+
}
|
|
960
|
+
return text;
|
|
961
|
+
}
|
|
962
|
+
default:
|
|
963
|
+
return assertNever(op);
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
//# sourceMappingURL=builtins.js.map
|