@tokens-studio/graph-engine
Version:
An execution engine to handle Token Studios generators and resolvers
21 lines • 722 B
JavaScript
import { Node } from '../../programmatic/node.js';
import { NumberSchema } from '../../schemas/index.js';
export default class NodeDefinition extends Node {
static title = 'Exponentiation';
static type = 'studio.tokens.math.exponent';
static description = "Specifically calculates e (Euler's number, approximately 2.71828) raised to a power.";
constructor(props) {
super(props);
this.addInput('exponent', {
type: NumberSchema
});
this.addOutput('value', {
type: NumberSchema
});
}
execute() {
const { exponent } = this.getAllInputs();
this.outputs.value.set(Math.exp(exponent));
}
}
//# sourceMappingURL=exp.js.map