aboutsummaryrefslogtreecommitdiff
path: root/src/lib/env.lua
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2026-04-20 13:43:01 +0200
committerNathan Reiner <nathan@nathanreiner.xyz>2026-04-20 13:43:01 +0200
commit0686b40f979f4607b3fd8cca21c463e98f617666 (patch)
tree355e8a7bfd4b37510d05370876a9d8cedfdcd5d7 /src/lib/env.lua
parentba561ebd063b391013b6c9c1fcc9b1838dd422e6 (diff)
implement builder and instance
Diffstat (limited to 'src/lib/env.lua')
-rw-r--r--src/lib/env.lua27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/lib/env.lua b/src/lib/env.lua
new file mode 100644
index 0000000..fd55444
--- /dev/null
+++ b/src/lib/env.lua
@@ -0,0 +1,27 @@
+Env = {}
+
+function Env.Sandbox(opts)
+ local env = {
+ string = string,
+ table = table,
+ type = type,
+ utf8 = utf8,
+ pairs = pairs,
+ ipairs = ipairs,
+ select = select,
+ tonumber = tonumber,
+ tostring = tostring,
+ next = next,
+ math = math,
+ error = error,
+ getmetatable = getmetatable,
+ }
+
+ opts = opts or {}
+
+ for key, value in pairs(opts) do
+ env[key] = value
+ end
+
+ return env
+end