-- Copyright (C) 2015 Tomoyuki Fujimori -- -- This file is part of dromozoa-commons. -- -- dromozoa-commons is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- dromozoa-commons is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with dromozoa-commons. If not, see . local pairs = require "dromozoa.commons.pairs" local function equal(a, b) if a == b then return true else if type(a) == "table" and type(b) == "table" then for k, u in pairs(a) do local v = b[k] if v == nil or not equal(u, v) then return false end end for k, v in pairs(b) do local u = a[k] if u == nil then return false end end -- not check metatable return true else return false end end end return equal