@tokens-studio/graph-engine
Version:
An execution engine to handle Token Studios generators and resolvers
21 lines • 735 B
JavaScript
import { AnySchema, BooleanSchema } from '../../schemas/index.js';
import { Node } from '../../programmatic/node.js';
export default class NodeDefinition extends Node {
static title = 'Has Value';
static type = 'studio.tokens.typing.hasValue';
static description = 'Checks if a value is defined. Returns true if undefined or null.';
constructor(props) {
super(props);
this.addInput('value', {
type: AnySchema
});
this.addOutput('undefined', {
type: BooleanSchema
});
}
execute() {
const { value } = this.getAllInputs();
this.outputs.undefined.set(value === null || value === undefined);
}
}
//# sourceMappingURL=hasValue.js.map