CORE_2026_1_BUDGET
const
The default budget of `core-2026.1` (Spec-5.42, Spec-6.48, Spec-6.49).
| Package | @formscript/cost |
|---|---|
| Specification | 6.6 |
| Depends on | ast, profile |
@formscript/costThe static cost model of §6.6 of the specification.
The static cost of an expression is a compile-time property: it needs the declared maximum size of an iterated collection, which is a property of the document, not of the current state. That is why this package depends on the AST and not on the evaluator.
| Expression | Cost |
|---|---|
| A literal | 0 |
| A reference | 1 |
| A binary operator | 1 + left + right |
| A call | 1 + Σ arguments |
| An array literal | its length |
| A comprehension | body × iterations |
import { CORE_2026_1_BUDGET, costOf, UNBOUNDED } from '@formscript/cost';
const breakdown = costOf(expression, resolver);
resolver answers one question: how many times may this collection be
iterated? Returning null means unbounded, which the model reports as such
rather than guessing. An unbounded iteration is E-COST-01.
CORE_2026_1_BUDGET is the profile's budget: 100,000 for one expression and
1,000,000 for a document.
7 exported symbols.
CORE_2026_1_BUDGET
const
The default budget of `core-2026.1` (Spec-5.42, Spec-6.48, Spec-6.49).
CostBreakdown
typeCostBudget
interfacecostNumber
functioncostOf
function
The static cost of an expression (Spec-6.45). Literals cost 0, a field reference costs 1, and a binary operator costs `1 + left + right`.
IterationResolver
interface
Resolves the declared maximum size of an iterated collection. `null` means the collection is unbounded, which is rejected (Spec-6.47).
UNBOUNDED
const
A resolver that treats every collection as unbounded.