fix: avoid sending query params to planet
This commit is contained in:
19
utils/merge.ts
Normal file
19
utils/merge.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import merge from "deepmerge"
|
||||
|
||||
export function arrayMerge(
|
||||
target: any[],
|
||||
source: any[],
|
||||
options: merge.ArrayMergeOptions
|
||||
) {
|
||||
const destination = target.slice()
|
||||
source.forEach((item, index) => {
|
||||
if (typeof destination[index] === "undefined") {
|
||||
destination[index] = options.cloneUnlessOtherwiseSpecified(item, options)
|
||||
} else if (options?.isMergeableObject(item)) {
|
||||
destination[index] = merge(target[index], item, options)
|
||||
} else if (target.indexOf(item) === -1) {
|
||||
destination.push(item)
|
||||
}
|
||||
})
|
||||
return destination
|
||||
}
|
||||
Reference in New Issue
Block a user