Closed rbalet closed 4 weeks ago
Once the ngx-translate library have exported mergeDeep, remove the local created one for them.
ngx-translate
mergeDeep
... return forkJoin(requests).pipe( map((response) => response.reduce((acc, curr) => this.mergeDeep(acc, curr), {})), ) } // @ToDo: Use it from ngx-translate once it gets exported: isObject(item: any): boolean { return item && typeof item === 'object' && !Array.isArray(item) } mergeDeep(target: any, source: any): any { const output = Object.assign({}, target) if (!this.isObject(target)) { return this.mergeDeep({}, source) } if (this.isObject(target) && this.isObject(source)) { Object.keys(source).forEach((key: any) => { if (this.isObject(source[key])) { if (!(key in target)) { Object.assign(output, { [key]: source[key] }) } else { output[key] = this.mergeDeep(target[key], source[key]) } } else { Object.assign(output, { [key]: source[key] }) } }) } return output }
import { mergeDeep } from '@ngx-translate/core' ... return forkJoin(requests).pipe( map((response) => response.reduce((acc, curr) => this.mergeDeep(acc, curr), {})), ) }
Description
Once the
ngx-translate
library have exportedmergeDeep
, remove the local created one for them.From
To