UNPKG

cpt-waffle-lotide

Version:
26 lines (25 loc) 722 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const primatives = ['number', 'string', 'boolean']; const eqArrays = (a, a2) => { if (a.length !== a2.length) return false; for (let i in a) { if (primatives.indexOf(typeof a[i]) !== -1 && primatives.indexOf(typeof a2[i]) !== -1) { if (a[i] !== a2[i]) return false; } else { if (Array.isArray(a[i]) && Array.isArray(a2[i])) { if (!eqArrays(a[i], a2[i])) { return false; } } else { return false; } } } return true; }; exports.default = eqArrays;