(target: any, source: any)
| 209 | * ``` |
| 210 | */ |
| 211 | export function deepMergeSnapshot(target: any, source: any): any { |
| 212 | if (isObject(target) && isObject(source)) { |
| 213 | const mergedOutput = { ...target } |
| 214 | Object.keys(source).forEach((key) => { |
| 215 | if (isObject(source[key]) && !source[key].$$typeof) { |
| 216 | if (!(key in target)) { |
| 217 | Object.assign(mergedOutput, { [key]: source[key] }) |
| 218 | } |
| 219 | else { |
| 220 | mergedOutput[key] = deepMergeSnapshot(target[key], source[key]) |
| 221 | } |
| 222 | } |
| 223 | else if (Array.isArray(source[key])) { |
| 224 | mergedOutput[key] = deepMergeArray(target[key], source[key]) |
| 225 | } |
| 226 | else { |
| 227 | Object.assign(mergedOutput, { [key]: source[key] }) |
| 228 | } |
| 229 | }) |
| 230 | |
| 231 | return mergedOutput |
| 232 | } |
| 233 | else if (Array.isArray(target) && Array.isArray(source)) { |
| 234 | return deepMergeArray(target, source) |
| 235 | } |
| 236 | return target |
| 237 | } |
| 238 | |
| 239 | export class DefaultMap<K, V> extends Map<K, V> { |
| 240 | constructor( |
no test coverage detected