@tokens-studio/graph-engine
Version:
An execution engine to handle Token Studios generators and resolvers
21 lines • 755 B
JavaScript
import { Node } from '../../programmatic/node.js';
import { NumberSchema } from '../../schemas/index.js';
export default class NodeDefinition extends Node {
static title = 'Square Root';
static type = 'studio.tokens.math.sqrt';
static description = 'Calculates the square root of a number. This finds the value which, when multiplied by itself, equals the original number.';
constructor(props) {
super(props);
this.addInput('radicand', {
type: NumberSchema
});
this.addOutput('value', {
type: NumberSchema
});
}
execute() {
const { radicand } = this.getAllInputs();
this.outputs.value.set(Math.sqrt(radicand));
}
}
//# sourceMappingURL=sqrt.js.map