UNPKG

@tokens-studio/graph-engine

Version:

An execution engine to handle Token Studios generators and resolvers

24 lines 731 B
import { Node } from '../../programmatic/node.js'; import { NumberSchema } from '../../schemas/index.js'; export default class NodeDefinition extends Node { static title = 'Modulo'; static type = 'studio.tokens.math.mod'; static description = 'Modulo node allows you to get the remainder of a division.'; constructor(props) { super(props); this.addInput('a', { type: NumberSchema }); this.addInput('b', { type: NumberSchema }); this.addOutput('value', { type: NumberSchema }); } execute() { const { a, b } = this.getAllInputs(); this.outputs.value.set(a % b); } } //# sourceMappingURL=mod.js.map