@stackmeister/equals
Advanced tools
| export declare type EqualsOptions = { | ||
| propertyOrder?: 'ignore' | 'exact'; | ||
| }; | ||
| /** | ||
| * Checks for deep equality between two arbitrary values. | ||
| * | ||
| * Objects and arrays need to equal structurally, not referentially. | ||
| * | ||
| * @param left | ||
| * @param right | ||
| * @returns | ||
| */ | ||
| declare const equals: <Value>(left: Value, right: Value, options?: EqualsOptions) => boolean; | ||
| export default equals; |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.default = void 0; | ||
| var _types = require("@stackmeister/types"); | ||
| function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } | ||
| /** | ||
| * Checks for deep equality between two arbitrary values. | ||
| * | ||
| * Objects and arrays need to equal structurally, not referentially. | ||
| * | ||
| * @param left | ||
| * @param right | ||
| * @returns | ||
| */ | ||
| var equals = function equals(left, right, options) { | ||
| if (_typeof(left) !== _typeof(right)) { | ||
| return false; | ||
| } | ||
| if (left === right) { | ||
| return true; | ||
| } | ||
| if ((0, _types.isArray)(left) && (0, _types.isArray)(right)) { | ||
| return left.length === right.length && left.every(function (value, index) { | ||
| return equals(value, right[index]); | ||
| }); | ||
| } | ||
| if ((0, _types.isObject)(left) && (0, _types.isObject)(right)) { | ||
| var leftKeys = Object.keys(left); | ||
| var rightKeys = Object.keys(right); | ||
| var exactOrder = (options === null || options === void 0 ? void 0 : options.propertyOrder) !== 'exact'; | ||
| return leftKeys.length === Object.keys(right).length && leftKeys.every(function (key, index) { | ||
| return equals(left[key], right[key]) && (!exactOrder || key === rightKeys[index]); | ||
| }); | ||
| } | ||
| return false; | ||
| }; | ||
| var _default = equals; | ||
| exports.default = _default; |
| export type { EqualsOptions } from './equals'; | ||
| export { default as default } from './equals'; |
+13
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| Object.defineProperty(exports, "default", { | ||
| enumerable: true, | ||
| get: function get() { | ||
| return _equals.default; | ||
| } | ||
| }); | ||
| var _equals = _interopRequireDefault(require("./equals")); | ||
| function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
+2
-2
| { | ||
| "name": "@stackmeister/equals", | ||
| "version": "0.1.4", | ||
| "version": "0.1.5", | ||
| "license": "MIT", | ||
@@ -42,3 +42,3 @@ "main": "cjs/index.js", | ||
| }, | ||
| "gitHead": "10afb42327a036a31985be857f0a68c765e99a66" | ||
| "gitHead": "7cda2f247123d83cf1a4c697dc6748885d336561" | ||
| } |
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
5303
81.98%7
133.33%67
Infinity%0
-100%