"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.shallowEqual = shallowEqual; /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License * 2.0 and the Server Side Public License, v 1; you may not use this file except * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ /** * Shallow Equal check adapted from react-redux * Copy-pasted to avoid importing copy of react-redux into data plugin async chunk **/ function shallowEqual(objA, objB) { if (Object.is(objA, objB)) return true; if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { return false; } const keysA = Object.keys(objA); const keysB = Object.keys(objB); if (keysA.length !== keysB.length) return false; for (let i = 0; i < keysA.length; i++) { if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || // @ts-ignore !Object.is(objA[keysA[i]], objB[keysA[i]])) { return false; } } return true; }