UNPKG

@tokens-studio/graph-engine

Version:

An execution engine to handle Token Studios generators and resolvers

27 lines 874 B
import { AnyArraySchema, StringSchema } from '../../schemas/index.js'; import { Node } from '../../programmatic/node.js'; export default class NodeDefinition extends Node { static title = 'Join Array'; static type = 'studio.tokens.string.join'; static description = 'Join node allows you to join an array into a string using a delimiter.'; constructor(props) { super(props); this.addInput('array', { type: AnyArraySchema }); this.addInput('delimiter', { type: { ...StringSchema, default: '-' } }); this.addOutput('value', { type: StringSchema }); } execute() { const { delimiter, array } = this.getAllInputs(); this.outputs.value.set(array.join(delimiter)); } } //# sourceMappingURL=join.js.map