Advertisement
9551

Untitled

Jul 17th, 2021
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.54 KB | None | 0 0
  1. --------table compare by fat boy chummy--------
  2. local function t_eq(a, b, noflip)
  3.     if type(a) ~= "table" or type(b) ~= "table" then
  4.         return false, t_eq_error
  5.     end
  6.     for k, v in pairs(a) do
  7.         if type(v) == "table" then
  8.             if not t_eq(v, b[k]) then
  9.                 return false, t_eq_error
  10.             end
  11.         elseif v ~= b[k] then
  12.             return false, t_eq_error
  13.         end
  14.     end
  15.  
  16.     if not noflip then
  17.         return t_eq(b, a, true)
  18.     end
  19.  
  20.     return true, ""
  21. end
  22.  
  23. return {t_eq = t_eq}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement