mirror of
https://github.com/litruv/picoGraph.git
synced 2026-07-24 02:36:04 +10:00
Initial commit
moved from private version control
This commit is contained in:
29
scripts/nodes/library/lua/rawGet.js
Normal file
29
scripts/nodes/library/lua/rawGet.js
Normal file
@@ -0,0 +1,29 @@
|
||||
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})`;
|
||||
},
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user