BREAKING CHANGES: plugin rewrite

This commit is contained in:
Pocco81
2022-07-31 00:27:43 -05:00
parent 8df684bcb3
commit 0288839edd
18 changed files with 430 additions and 807 deletions
+25
View File
@@ -0,0 +1,25 @@
local M = {}
local cnf = require("auto-save.config").options
function M.set_of(list)
local set = {}
for i = 1, #list do
set[list[i]] = true
end
return set
end
function M.not_in(var, arr)
if M.set_of(arr)[var] == nil then
return true
end
end
function M.do_callback(callback_name)
if type(cnf.callbacks[callback_name]) == "function" then
cnf.callbacks[callback_name]()
end
end
return M