@@ -301,22 +301,30 @@ export function _renameKeys<M extends { [key: string]: string }>(
301301 entityArray : NilOr < T [ ] >
302302) => NilOr < ( Omit < T , keyof M > & { [ key : string ] : any } ) [ ] > ;
303303
304- export function replaceBy < T > ( pattern : MatchPattern < T > , entityArray : T [ ] ) : T [ ] ;
305- export function replaceBy ( pattern : MatchPattern ) : < T > ( entityArray : T [ ] ) => T [ ] ;
304+ export function replaceBy < T > ( pattern : MatchPattern < T > , newItem : T , entityArray : T [ ] ) : T [ ] ;
305+ export function replaceBy ( pattern : MatchPattern ) : < T > ( newItem : T , entityArray : T [ ] ) => T [ ] ;
306+ export function replaceBy < T > ( pattern : MatchPattern < T > , newItem : T ) : ( entityArray : T [ ] ) => T [ ] ;
306307export function _replaceBy < T > (
307308 pattern : MatchPattern < T > ,
309+ newItem : T ,
308310 entityArray : NilOr < T [ ] >
309311) : NilOr < T [ ] > ;
310312export function _replaceBy (
311313 pattern : MatchPattern
312- ) : < T > ( entityArray : NilOr < T [ ] > ) => NilOr < T [ ] > ;
314+ ) : < T > ( newItem : T , entityArray : NilOr < T [ ] > ) => NilOr < T [ ] > ;
315+ export function _replaceBy < T > (
316+ pattern : MatchPattern < T > ,
317+ newItem : T
318+ ) : ( entityArray : NilOr < T [ ] > ) => NilOr < T [ ] > ;
313319
314- export function replaceById < T > ( id : any , entityArray : T [ ] ) : T [ ] ;
315- export function replaceById ( id : any ) : < T > ( entityArray : T [ ] ) => T [ ] ;
316- export function _replaceById < T > ( id : any , entityArray : NilOr < T [ ] > ) : NilOr < T [ ] > ;
320+ export function replaceById < T > ( id : any , newItem : T , entityArray : T [ ] ) : T [ ] ;
321+ export function replaceById ( id : any ) : < T > ( newItem : T , entityArray : T [ ] ) => T [ ] ;
322+ export function replaceById < T > ( id : any , newItem : T ) : ( entityArray : T [ ] ) => T [ ] ;
323+ export function _replaceById < T > ( id : any , newItem : T , entityArray : NilOr < T [ ] > ) : NilOr < T [ ] > ;
317324export function _replaceById (
318325 id : any
319- ) : < T > ( entityArray : NilOr < T [ ] > ) => NilOr < T [ ] > ;
326+ ) : < T > ( newItem : T , entityArray : NilOr < T [ ] > ) => NilOr < T [ ] > ;
327+ export function _replaceById < T > ( id : any , newItem : T ) : ( entityArray : NilOr < T [ ] > ) => NilOr < T [ ] > ;
320328
321329export function serializeKeysToSnakeCase ( object : object ) : object ;
322330export function preprocessForSerialization ( object : object ) : object ;
0 commit comments