@notenoughupdates/discord-akairo
Advanced tools
Comparing version 9.0.10-dev.1640802099.e1a1cb3 to 9.0.10-dev.1640802836.d87cb1e
{ | ||
"name": "@notenoughupdates/discord-akairo", | ||
"version": "9.0.10-dev.1640802099.e1a1cb3", | ||
"version": "9.0.10-dev.1640802836.d87cb1e", | ||
"description": "A highly customizable bot framework for Discord.js.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/src/index.js", |
@@ -91,28 +91,28 @@ "use strict"; | ||
} | ||
static deepEquals(_a, _b, _ignoreUndefined = true) { | ||
function deepEquals(a, b, ignoreUndefined) { | ||
if (a === b) | ||
return true; | ||
if (typeof a !== "object" || typeof b !== "object") | ||
throw new TypeError("Not objects"); | ||
for (const key in a) { | ||
if (ignoreUndefined && a[key] === undefined && b[key] === undefined) | ||
continue; | ||
if (!(key in b)) | ||
static deepEquals(a, b, ignoreUndefined = true) { | ||
if (a === b) | ||
return true; | ||
if (typeof a !== "object" || typeof b !== "object") | ||
throw new TypeError("Not objects"); | ||
for (const key in a) { | ||
if (ignoreUndefined && a[key] === undefined && b[key] === undefined) | ||
continue; | ||
if (!(key in b)) { | ||
console.log("======================================"); | ||
console.dir(a, { depth: 4 }); | ||
console.dir(b, { depth: 4 }); | ||
return false; | ||
} | ||
if (typeof a[key] === "object" && typeof b[key] === "object") { | ||
if (!this.deepEquals(a[key], b[key], ignoreUndefined)) | ||
return false; | ||
if (typeof a[key] === "object" && typeof b[key] === "object") { | ||
if (!( /* this. */deepEquals(a[key], b[key], ignoreUndefined))) | ||
return false; | ||
} | ||
else if (a[key] !== b[key]) | ||
return false; | ||
} | ||
return true; | ||
else if (a[key] !== b[key]) { | ||
console.log("======================================"); | ||
console.dir(a[key], { depth: 4 }); | ||
console.dir(b[key], { depth: 4 }); | ||
return false; | ||
} | ||
} | ||
const result = deepEquals(_a, _b, _ignoreUndefined); | ||
if (result === false) { | ||
console.dir(_a, { depth: 4 }); | ||
console.dir(_b, { depth: 4 }); | ||
} | ||
return result; | ||
return true; | ||
} | ||
@@ -119,0 +119,0 @@ /** |
{ | ||
"name": "@notenoughupdates/discord-akairo", | ||
"version": "9.0.10-dev.1640802099.e1a1cb3", | ||
"version": "9.0.10-dev.1640802836.d87cb1e", | ||
"description": "A highly customizable bot framework for Discord.js.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/src/index.js", |
@@ -113,22 +113,23 @@ /* eslint-disable @typescript-eslint/ban-types */ | ||
public static deepEquals<T>(a: unknown, b: T, ignoreUndefined?: boolean): a is T; | ||
public static deepEquals(_a: any, _b: any, _ignoreUndefined = true): boolean { | ||
function deepEquals(a: any, b: any, ignoreUndefined?: boolean) { | ||
if (a === b) return true; | ||
if (typeof a !== "object" || typeof b !== "object") throw new TypeError("Not objects"); | ||
for (const key in a) { | ||
if (ignoreUndefined && a[key] === undefined && b[key] === undefined) continue; | ||
if (!(key in b)) return false; | ||
if (typeof a[key] === "object" && typeof b[key] === "object") { | ||
if (!(/* this. */ deepEquals(a[key], b[key], ignoreUndefined))) return false; | ||
} else if (a[key] !== b[key]) return false; | ||
public static deepEquals(a: any, b: any, ignoreUndefined = true): boolean { | ||
if (a === b) return true; | ||
if (typeof a !== "object" || typeof b !== "object") throw new TypeError("Not objects"); | ||
for (const key in a) { | ||
if (ignoreUndefined && a[key] === undefined && b[key] === undefined) continue; | ||
if (!(key in b)) { | ||
console.log("======================================"); | ||
console.dir(a, { depth: 4 }); | ||
console.dir(b, { depth: 4 }); | ||
return false; | ||
} | ||
return true; | ||
if (typeof a[key] === "object" && typeof b[key] === "object") { | ||
if (!this.deepEquals(a[key], b[key], ignoreUndefined)) return false; | ||
} else if (a[key] !== b[key]) { | ||
console.log("======================================"); | ||
console.dir(a[key], { depth: 4 }); | ||
console.dir(b[key], { depth: 4 }); | ||
return false; | ||
} | ||
} | ||
const result = deepEquals(_a, _b, _ignoreUndefined); | ||
if (result === false) { | ||
console.dir(_a, { depth: 4 }); | ||
console.dir(_b, { depth: 4 }); | ||
} | ||
return result; | ||
return true; | ||
} | ||
@@ -135,0 +136,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
911880
16365