From 2e051fcc4efcfe6af2d3ef22d6a4ba63c9f1c65d Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sat, 5 Apr 2025 11:49:48 +0530 Subject: Add package path to lua (only current build dir) --- lua/api.lua | 13 ------------- lua/null-browser/api.lua | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 13 deletions(-) delete mode 100644 lua/api.lua create mode 100644 lua/null-browser/api.lua (limited to 'lua') diff --git a/lua/api.lua b/lua/api.lua deleted file mode 100644 index b6495e0..0000000 --- a/lua/api.lua +++ /dev/null @@ -1,13 +0,0 @@ -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 or {} - - __internals.register_event(opts) -end diff --git a/lua/null-browser/api.lua b/lua/null-browser/api.lua new file mode 100644 index 0000000..d2e0be7 --- /dev/null +++ b/lua/null-browser/api.lua @@ -0,0 +1,17 @@ +print("FOOOOOOOOOOBARRRRRR") + +local function shallow_copy(t) + local t2 = {} + for k, v in pairs(t) do t2[k] = v end + return t2 +end + +web.event = web.event or {} + +web.event.add_listener = function(events, opts) + opts = shallow_copy(opts or {}) + if type(events) ~= "table" then events = { events } end + opts.events = events or {} + + __internals.register_event(opts) +end -- cgit v1.3.1