Approach request optimization differently
This commit is contained in:
@@ -197,6 +197,19 @@ export const isPojo = (obj: any) => {
|
||||
export const equals = (a: any, b: any) => {
|
||||
if (a === b) return true
|
||||
|
||||
if (a instanceof Set && b instanceof Set) {
|
||||
a = Array.from(a)
|
||||
b = Array.from(b)
|
||||
}
|
||||
|
||||
if (a instanceof Set) {
|
||||
if (!(b instanceof Set) || a.size !== b.size) {
|
||||
return false
|
||||
}
|
||||
|
||||
return Array.from(a).every(x => b.has(x))
|
||||
}
|
||||
|
||||
if (Array.isArray(a)) {
|
||||
if (!Array.isArray(b) || a.length !== b.length) {
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user