@tokens-studio/graph-engine
Version:
An execution engine to handle Token Studios generators and resolvers
20 lines • 644 B
JavaScript
import { AnyArraySchema, NumberSchema } from '../../schemas/index.js';
import { Node } from '../../programmatic/node.js';
export default class NodeDefinition extends Node {
static title = 'Count';
static type = 'studio.tokens.math.count';
static description = 'Counts the amount of items in an array.';
constructor(props) {
super(props);
this.addInput('value', {
type: AnyArraySchema
});
this.addOutput('value', {
type: NumberSchema
});
}
execute() {
this.outputs.value.set(this.inputs.value.value.length);
}
}
//# sourceMappingURL=count.js.map