Skip to content
Shapemetry

@huukhanhnguyen/model / validate/expressions

validate/expressions

BARE_SCENE_CALL

const BARE_SCENE_CALL: RegExp

Stale bare scene() call (settings-functions §B.1) — named rejection.


EXPR_MAX_AST_DEPTH

const EXPR_MAX_AST_DEPTH: 100 = 100


collectExpressions()

collectExpressions(model): { expr: string; path: string; }[]

Parameters

model

ModelJSON

Returns

{ expr: string; path: string; }[]


collectNodeExpressions()

collectNodeExpressions(nodes, pathPrefix): { expr: string; path: string; }[]

Parameters

nodes

(Operation | Group)[]

pathPrefix

string

Returns

{ expr: string; path: string; }[]


validateExpressions()

validateExpressions(model): ExpressionError[]

Syntax-check every expression with the ENGINE's parser (jsep + the ternary/object/arrow plugins — the exact grammar eval uses), so a typo fails here instead of silently rendering an empty node at eval time.

Parameters

model

ModelJSON

Returns

ExpressionError[]

Last updated: 📖 1 min readEdit on GitHub