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