UNPKG

@tokens-studio/graph-engine

Version:

An execution engine to handle Token Studios generators and resolvers

25 lines 912 B
import { AnyArraySchema, AnySchema, createVariadicSchema } from '../../schemas/index.js'; import { Node } from '../../programmatic/node.js'; export default class NodeDefinition extends Node { static title = 'Arrify'; static type = 'studio.tokens.array.arrify'; static description = 'Accepts a wide range of input types and formats, ensuring they are converted into a uniform array structure. The output is always an array.'; constructor(props) { super(props); this.addInput('items', { type: { ...createVariadicSchema(AnySchema), default: [] }, variadic: true }); this.addOutput('value', { type: AnyArraySchema }); } execute() { const items = this.inputs.items; this.outputs.value.set(items.value, items.type); } } //# sourceMappingURL=arrify.js.map