feat(core-flows,types,utils,medusa): Update existing line items when adding the same variant to cart (#7470)
* feat(core-flows,types,utils,medusa): Update existing line items when adding the same variant to cart * chore: split steps into 2 for add-to-cart * chore: split steps into 2 for add-to-cart * chore: iterate safely * chore: parallelize upsert
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
export function deepEqualObj(obj1: object, obj2: object): boolean {
|
||||
export function deepEqualObj(obj1: unknown, obj2: unknown): boolean {
|
||||
if (typeof obj1 !== typeof obj2) {
|
||||
return false
|
||||
}
|
||||
@@ -7,6 +7,10 @@ export function deepEqualObj(obj1: object, obj2: object): boolean {
|
||||
return obj1 === obj2
|
||||
}
|
||||
|
||||
if (typeof obj2 !== "object" || obj2 === null) {
|
||||
return obj2 === obj1
|
||||
}
|
||||
|
||||
const obj1Keys = Object.keys(obj1)
|
||||
const obj2Keys = Object.keys(obj2)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user