From 8433630d1f315d1b66e8dd8f914c1fb73dade9ae Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 4 Apr 2025 14:33:19 +0530 Subject: Static link libuv and luajit + minor changes --- lua/api.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 lua/api.lua (limited to 'lua/api.lua') diff --git a/lua/api.lua b/lua/api.lua new file mode 100644 index 0000000..d078d72 --- /dev/null +++ b/lua/api.lua @@ -0,0 +1,13 @@ +local function shallow_copy(t) + local t2 = {} + for k, v in pairs(t) do t2[k] = v end + return t2 +end + +web.event.add_listener = function(events, opts) + opts = shallow_copy(opts or {}) + if type(events) ~= "table" then events = { events } end + opts.events = events + + __internals.register_event(opts) +end -- cgit v1.3.1