silverwolf-x's picture
download
raw
793 Bytes
export function deepMerge(target: any, source: any): any {
if (!source || typeof source !== 'object' || Array.isArray(source)) {
return source
}
if (!target || typeof target !== 'object' || Array.isArray(target)) {
return source
}
const result = { ...target }
for (const key in source) {
const sourceValue = source[key]
const targetValue = target[key]
if (sourceValue !== undefined) {
if (
sourceValue &&
typeof sourceValue === 'object' &&
!Array.isArray(sourceValue) &&
targetValue &&
typeof targetValue === 'object' &&
!Array.isArray(targetValue)
) {
result[key] = deepMerge(targetValue, sourceValue)
} else {
result[key] = sourceValue
}
}
}
return result
}

Xet Storage Details

Size:
793 Bytes
·
Xet hash:
f50248750c044f1b8e02d87aa4bb049f0f58c961993bbb4076b0a23bebb43cf1

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.