UNPKG

autumn-js

Version:
48 lines (45 loc) 1.73 kB
"use client"; "use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/libraries/react/utils/compareParams.ts var compareParams_exports = {}; __export(compareParams_exports, { compareParams: () => compareParams }); module.exports = __toCommonJS(compareParams_exports); var compareParams = (a, b) => { if (a === b) return true; if (a === null || b === null) return false; if (typeof a !== "object" || typeof b !== "object") return false; if (Array.isArray(a) && Array.isArray(b)) { if (a.length !== b.length) return false; return a.every((item, index) => compareParams(item, b[index])); } const keysA = Object.keys(a); const keysB = Object.keys(b); if (keysA.length !== keysB.length) return false; return keysA.every((key) => { if (!Object.prototype.hasOwnProperty.call(b, key)) return false; return compareParams(a[key], b[key]); }); }; // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { compareParams });