Files
picoGraph/scripts/nodes/library/lua/rawGet.js
Max Litruv Boonzaayer e64f3e881e Initial commit
moved from private version control
2025-10-19 21:12:41 +11:00

30 lines
850 B
JavaScript

import { createNodeModule } from "../../nodeTypes.js";
/**
* Retrieves a raw table entry using rawget().
*/
export const luaRawGetNode = createNodeModule(
{
id: "lua_rawget",
title: "Raw Get",
category: "Lua",
description: "Access a table entry without metamethods using rawget().",
searchTags: ["rawget", "table", "lua"],
inputs: [
{ id: "table", name: "Table", direction: "input", kind: "table" },
{ id: "key", name: "Key", direction: "input", kind: "any" },
],
outputs: [
{ id: "value", name: "Value", direction: "output", kind: "any" },
],
properties: [],
},
{
evaluateValue: ({ resolveValueInput }) => {
const tableValue = resolveValueInput("table", "{}");
const key = resolveValueInput("key", "nil");
return `rawget(${tableValue}, ${key})`;
},
}
);