Skip to content
Shapemetry

@huukhanhnguyen/model / schema/expression

schema/expression

Arr

Arr = Expression & { elements: Expression[]; type: "ArrayExpression"; }


Arrow

Arrow = Expression & { body: Expression; params?: Ident[]; type: "ArrowFunctionExpression"; }


Bin

Bin = Expression & { left: Expression; operator: string; right: Expression; type: "BinaryExpression"; }


Call

Call = Expression & { arguments: Expression[]; callee: Expression; type: "CallExpression"; }


Comp

Comp = Expression & { body: Expression[]; type: "Compound"; }


Cond

Cond = Expression & { alternate: Expression; consequent: Expression; test: Expression; type: "ConditionalExpression"; }


EvalContext

EvalContext = Record<string, unknown>


Fuel

Fuel = { remaining: number; }

remaining

remaining: number


Ident

Ident = Expression & { name: string; start?: number; type: "Identifier"; }


Lit

Lit = Expression & { raw?: string; type: "Literal"; value: unknown; }


Mem

Mem = Expression & { computed: boolean; object: Expression; property: Expression; type: "MemberExpression"; }


Obj

Obj = Expression & { properties: ObjProp[]; type: "ObjectExpression"; }


ObjProp

ObjProp = { key: Ident | Lit; value: Expression; }

key

key: Ident | Lit

value

value: Expression


Un

Un = Expression & { argument: Expression; operator: string; type: "UnaryExpression"; }

Last updated: 📖 1 min readEdit on GitHub