UNPKG

@tokens-studio/graph-engine

Version:

An execution engine to handle Token Studios generators and resolvers

21 lines 680 B
import { AnyArraySchema, NumberSchema } from '../../schemas/index.js'; import { Node } from '../../programmatic/node.js'; export default class NodeDefinition extends Node { static title = 'Array Length'; static type = 'studio.tokens.array.length'; static description = 'Determines the length of an array.'; constructor(props) { super(props); this.addInput('array', { type: AnyArraySchema }); this.addOutput('length', { type: NumberSchema }); } execute() { const { array } = this.getAllInputs(); this.outputs.length.set(array.length); } } //# sourceMappingURL=length.js.map