Skip to content
Shapemetry

Model - Node args

API reference for src/schema/nodeArgs on @huukhanhnguyen/model, reachable from ..

See the Guide for the ModelJSON / evaluate pipeline.

API reference

Signatures are generated from the live package .d.ts - not hand-written.

ArgCarrier

type

A node carrying args — every operation-shaped lane entry and chain step. The element is the canonical Argument from @huukhanhnguyen/types (Operation/LaneNode carry the same array); the helpers here only read and write the key/input pair, so the optional constraint fields ride through untouched.

type ArgCarrier
// = {
    args?: Argument[];
}

clearNodeArg

function

Remove one arg. dropEmpty also deletes an args array left empty.

clearNodeArg(node: ArgCarrier, key: string, dropEmpty?: boolean): void

nodeArgInput

function

One arg's expression input, or undefined when absent.

nodeArgInput(node: ArgCarrier, key: string): string | undefined

setNodeArg

function

Write one arg input (mutates in place). clearEmpty makes a blank input REMOVE the arg (and drop an emptied args) instead of storing "".

setNodeArg(node: ArgCarrier, key: string, input: string, clearEmpty?: boolean): void
Last updated: 📖 1 min readEdit on GitHub