UNPKG

@tokens-studio/graph-engine

Version:

An execution engine to handle Token Studios generators and resolvers

21 lines 697 B
import { Node } from '../../programmatic/node.js'; import { NumberSchema } from '../../schemas/index.js'; export default class NodeDefinition extends Node { static title = 'Floor'; static type = 'studio.tokens.math.floor'; static description = 'Floor node allows you to adjusts a floating-point number to the nearest lower integer.'; constructor(props) { super(props); this.addInput('value', { type: NumberSchema }); this.addOutput('value', { type: NumberSchema }); } execute() { const { value } = this.getAllInputs(); this.outputs.value.set(~~value); } } //# sourceMappingURL=floor.js.map