UNPKG

@naverpay/vanilla-store

Version:

![NPM Version](https://img.shields.io/npm/v/%40naverpay%2Fvanilla-store) ![NPM bundle size](https://img.shields.io/bundlephobia/min/%40naverpay%2Fvanilla-store) ![NPM Downloads](https://img.shields.io/npm/dw/%40naverpay%2Fvanilla-store)

27 lines (26 loc) 745 B
"use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); function is(x, y) { return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y; } const objectIs = typeof Object.is === "function" ? Object.is : is; function shallowEqual(a, b) { if (objectIs(a, b)) { return true; } if (typeof a !== "object" || a === null || typeof b !== "object" || b === null) { return false; } const keysA = Object.keys(a); const keysB = Object.keys(b); if (keysA.length !== keysB.length) { return false; } for (const key of keysA) { if (!Object.prototype.hasOwnProperty.call(b, key) || a[key] !== b[key]) { return false; } } return true; } exports.shallowEqual = shallowEqual;