Socket
Socket
Sign inDemoInstall

@domql/utils

Package Overview
Dependencies
Maintainers
3
Versions
168
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@domql/utils - npm Package Compare versions

Comparing version 2.5.13 to 2.5.14

28

dist/cjs/object.js

@@ -24,2 +24,3 @@ "use strict";

deepCloneExclude: () => deepCloneExclude,
deepContains: () => deepContains,
deepDestringify: () => deepDestringify,

@@ -410,2 +411,29 @@ deepMerge: () => deepMerge,

};
const deepContains = (obj1, obj2) => {
if (typeof obj1 !== typeof obj2) {
return false;
}
if ((0, import_types.isObjectLike)(obj1)) {
if (Array.isArray(obj1) && Array.isArray(obj2)) {
if (obj1.length !== obj2.length) {
return false;
}
for (let i = 0; i < obj1.length; i++) {
if (!deepContains(obj1[i], obj2[i])) {
return false;
}
}
} else if ((0, import_types.isObjectLike)(obj1) && obj2 !== null) {
for (const key in obj1) {
const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj2, key);
if (!hasOwnProperty || !deepContains(obj1[key], obj2[key])) {
return false;
}
}
}
} else {
return obj2 === obj1;
}
return true;
};
const removeFromObject = (obj, props) => {

@@ -412,0 +440,0 @@ if (props === void 0 || props === null)

@@ -452,2 +452,32 @@ 'use strict'

export const deepContains = (obj1, obj2) => {
if (typeof obj1 !== typeof obj2) {
return false
}
if (isObjectLike(obj1)) {
if (Array.isArray(obj1) && Array.isArray(obj2)) {
if (obj1.length !== obj2.length) {
return false
}
for (let i = 0; i < obj1.length; i++) {
if (!deepContains(obj1[i], obj2[i])) {
return false
}
}
} else if (isObjectLike(obj1) && obj2 !== null) {
for (const key in obj1) {
const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj2, key)
if (!hasOwnProperty || !deepContains(obj1[key], obj2[key])) {
return false
}
}
}
} else {
return obj2 === obj1
}
return true
}
export const removeFromObject = (obj, props) => {

@@ -454,0 +484,0 @@ if (props === undefined || props === null) return obj

4

package.json
{
"name": "@domql/utils",
"version": "2.5.13",
"version": "2.5.14",
"license": "MIT",

@@ -26,3 +26,3 @@ "type": "module",

},
"gitHead": "3bbff7f4e2ced6f104572489a2779a5cf0dbb450",
"gitHead": "ab852cb3a435b154f6b32a9a664f65ec56a9c49f",
"devDependencies": {

@@ -29,0 +29,0 @@ "@babel/core": "^7.12.0"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc