@tokens-studio/graph-engine
Version:
An execution engine to handle Token Studios generators and resolvers
25 lines • 809 B
JavaScript
import { Node } from '../../programmatic/node.js';
import { NumberSchema, Vec2Schema } from '../../schemas/index.js';
export default class NodeDefinition extends Node {
static title = 'Destructure vector2';
static type = 'studio.tokens.vector2.destructure';
static description = 'Allows you to destructure a vector2 into its components';
constructor(props) {
super(props);
this.addInput('value', {
type: Vec2Schema
});
this.addOutput('x', {
type: NumberSchema
});
this.addOutput('y', {
type: NumberSchema
});
}
execute() {
const { value } = this.getAllInputs();
this.outputs.x.set(value[0]);
this.outputs.y.set(value[1]);
}
}
//# sourceMappingURL=destructure.js.map