diff options
Diffstat (limited to 'src/lib/env.lua')
| -rw-r--r-- | src/lib/env.lua | 27 |
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 |