mirror of
https://github.com/litruv/picoGraph.git
synced 2026-07-24 02:36:04 +10:00
28 lines
783 B
JavaScript
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})`;
|
|
},
|
|
}
|
|
);
|