UNPKG

devextreme-react

Version:

DevExtreme React UI and Visualization Components

50 lines (48 loc) 1.58 kB
/*! * devextreme-react * Version: 24.2.6 * Build date: Mon Mar 17 2025 * * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file in the root of the project for details. * * https://github.com/DevExpress/devextreme-react */ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.shallowEquals = exports.isIE = exports.parseOptionName = exports.mergeNameParts = void 0; function mergeNameParts(...args) { return args.filter((value) => value).join('.'); } exports.mergeNameParts = mergeNameParts; function parseOptionName(name) { const parts = name.split('['); if (parts.length === 1) { return { isCollectionItem: false, name, }; } return { isCollectionItem: true, name: parts[0], index: Number(parts[1].slice(0, -1)), }; } exports.parseOptionName = parseOptionName; const isIE = () => { const ua = window?.navigator?.userAgent ?? ''; // Check the userAgent property of the window.navigator object const msie = ua.indexOf('MSIE'); // IE 10 or older const trident = ua.indexOf('Trident/'); // IE 11 return msie > 0 || trident > 0; }; exports.isIE = isIE; const shallowEquals = (first, second) => { if (Object.keys(first).length !== Object.keys(second).length) { return false; } return Object.keys(first).every((key) => first[key] === second[key]); }; exports.shallowEquals = shallowEquals;