import { mergeWith , isObject , set } from 'lodash-es' ; import { ɵMarker as Marker } from 'ts-auto-mock/extension' ; import { PartialDeep } from '../partial/partial' ; export class Merge { public static merge < T > ( a , b ) { return mergeWith ( a , b , ( objValue , srcValue , oneLevelPath , objContainer , srcContainer ) => { if ( isObject ( srcValue ) && srcValue [ Marker . instance . get ( ) ] ) { return srcValue ; } if ( srcContainer . hasOwnProperty ( oneLevelPath ) && srcValue === undefined ) { set ( objContainer , [ oneLevelPath ] , undefined ) ; } } ) ; } public static mergeIterator < T > ( a , b , index ) { return Merge . merge ( a , b ( index ) ) ; } }