Script Luar ★ Deluxe & Exclusive

-- Merge table t2 into t1 (overwrites t1 keys) function table_utils.merge(t1, t2) for k, v in pairs(t2) do t1[k] = v end return t1 end

-- Check if a value exists in a table (linear search) function table_utils.contains(tbl, value) for _, v in pairs(tbl) do if v == value then return true end end return false end script luar

-- Read entire file as string (returns nil + error on failure) function file_utils.read_file(filename) local f, err = io.open(filename, "r") if not f then return nil, err end local content = f:read("*all") f:close() return content end -- Merge table t2 into t1 (overwrites t1

-- Check if string ends with a suffix function string_utils.ends_with(str, suffix) return #suffix == 0 or str:sub(-#suffix) == suffix end t2) for k

-- -------------------------------------------- -- 2. TABLE UTILITIES -- -------------------------------------------- local table_utils = {}

debug_utils.log("Script started") debug_utils.time_function(string_utils.trim, " test ") --]]

-- Append string to file function file_utils.append_file(filename, content) local f, err = io.open(filename, "a") if not f then return false, err end f:write(content) f:close() return true end