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

28 lines
783 B
JavaScript

import { createNodeModule } from "../../nodeTypes.js";
/**
* Retrieves the metatable associated with a table via getmetatable().
*/
export const luaGetMetatableNode = createNodeModule(
{
id: "lua_getmetatable",
title: "Get Metatable",
category: "Lua",
description: "Fetch a table's metatable using getmetatable().",
searchTags: ["getmetatable", "metatable", "lua"],
inputs: [
{ id: "table", name: "Table", direction: "input", kind: "table" },
],
outputs: [
{ id: "metatable", name: "Metatable", direction: "output", kind: "table" },
],
properties: [],
},
{
evaluateValue: ({ resolveValueInput }) => {
const tableValue = resolveValueInput("table", "{}");
return `getmetatable(${tableValue})`;
},
}
);