跳到主要内容

std/build/reckon/deps

std/build/reckon/deps

Classes

CycleError

Defined in: apps/website/.api-docs-entry/std/build/reckon/deps.d.ts:21

Cycle error thrown when topo-sort detects a cycle.

Extends

  • Error

Constructors

Constructor
new CycleError(nodes): CycleError;

Defined in: apps/website/.api-docs-entry/std/build/reckon/deps.d.ts:23

Parameters
Parameter Type
nodes string[]
Returns

CycleError

Overrides
Error.constructor

Properties

nodes
readonly nodes: string[];

Defined in: apps/website/.api-docs-entry/std/build/reckon/deps.d.ts:22

Functions

extractIdentifiers()

function extractIdentifiers(ast): Set<string>;

Defined in: apps/website/.api-docs-entry/std/build/reckon/deps.d.ts:6

Extract all free identifiers from a CEL AST. Returns identifiers that are NOT bound by macros.

Parameters

Parameter Type
ast ASTNode

Returns

Set<string>


partitionDependencies()

function partitionDependencies(identifiers, exprNames): object;

Defined in: apps/website/.api-docs-entry/std/build/reckon/deps.d.ts:16

Given a set of identifiers, separate them into expr dependencies and other references.

Parameters

Parameter Type Description
identifiers Set<string> All free identifiers from an expr's AST
exprNames Set<string> The set of all expr names in the definition

Returns

object

{ exprDeps, others } where exprDeps are identifiers that match other expr names (topo-sort dependencies), and others are input field references or unknown identifiers.

exprDeps
exprDeps: Set<string>;
others
others: Set<string>;

topoSort()

function topoSort(exprs): string[];

Defined in: apps/website/.api-docs-entry/std/build/reckon/deps.d.ts:32

Topologically sort expr names by their dependencies.

Parameters

Parameter Type Description
exprs Map<string, Set<string>> Map of expr name → set of expr names it depends on

Returns

string[]

Evaluation order (dependencies first)

Throws

if a cycle is detected