mirror of
https://github.com/litruv/picoGraph.git
synced 2026-07-24 10:46:06 +10:00
Initial commit
moved from private version control
This commit is contained in:
26
scripts/nodes/library/booleanLiteral.js
Normal file
26
scripts/nodes/library/booleanLiteral.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import { createNodeModule } from "../nodeTypes.js";
|
||||
|
||||
/**
|
||||
* Constant boolean literal.
|
||||
*/
|
||||
export const booleanLiteralNode = createNodeModule(
|
||||
{
|
||||
id: "boolean_literal",
|
||||
title: "Boolean",
|
||||
category: "Values",
|
||||
description: "Constant boolean literal.",
|
||||
searchTags: ["boolean", "literal", "true", "false"],
|
||||
inputs: [],
|
||||
outputs: [
|
||||
{ id: "value", name: "Value", direction: "output", kind: "boolean" },
|
||||
],
|
||||
properties: [
|
||||
{ key: "value", label: "Value", type: "boolean", defaultValue: true },
|
||||
],
|
||||
},
|
||||
{
|
||||
evaluateValue: ({ node, formatLiteral }) => {
|
||||
return formatLiteral("boolean", node.properties.value ?? true);
|
||||
},
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user