mirror of
https://github.com/litruv/picoGraph.git
synced 2026-07-24 02:36:04 +10:00
- Created test_cart.p8 with basic drawing functionality and a print statement. - Created test_unix.p8 with a simple initialization function.
39 lines
954 B
JavaScript
39 lines
954 B
JavaScript
/**
|
|
* @typedef {import('./LuaLiteralTypes.js').LuaLiteralHandler} LuaLiteralHandler
|
|
*/
|
|
|
|
/** @type {LuaLiteralHandler} */
|
|
export const LuaLiteralString = {
|
|
/**
|
|
* @param {unknown} value
|
|
* @returns {string}
|
|
*/
|
|
format(value) {
|
|
return JSON.stringify(String(value ?? ""));
|
|
},
|
|
|
|
/** @returns {string} */
|
|
defaultLiteral() {
|
|
return '""';
|
|
},
|
|
|
|
spawnableByDefault: true,
|
|
|
|
nodeModule: {
|
|
definition: {
|
|
id: "string_literal",
|
|
title: "String",
|
|
category: "Values",
|
|
description: "Constant string literal.",
|
|
searchTags: ["string", "literal", "text", "value"],
|
|
inputs: [],
|
|
outputs: [{ id: "value", name: "Value", direction: "output", kind: "string" }],
|
|
properties: [{ key: "value", label: "Text", type: "string", defaultValue: "hello" }],
|
|
},
|
|
behavior: {
|
|
evaluateValue: ({ node, formatLiteral }) =>
|
|
formatLiteral("string", node.properties.value ?? ""),
|
|
},
|
|
},
|
|
};
|