diff --git a/lib/ModelHelpers.ts b/lib/ModelHelpers.ts index d6be515..9036523 100644 --- a/lib/ModelHelpers.ts +++ b/lib/ModelHelpers.ts @@ -116,7 +116,7 @@ export class ModelHelpers { * @param {any} The document you wish to clone deeply. */ cloneDocument(original: T): T { - return _.cloneDeep(original, (value) => { + return _.cloneDeepWith(original, (value) => { if(Buffer.isBuffer(value)) { return value; } diff --git a/typings/DefinitelyTyped/lodash/lodash.d.ts b/typings/DefinitelyTyped/lodash/lodash.d.ts index 4f2ffdb..48b1422 100644 --- a/typings/DefinitelyTyped/lodash/lodash.d.ts +++ b/typings/DefinitelyTyped/lodash/lodash.d.ts @@ -10791,7 +10791,7 @@ declare module _ { * console.log(shallow[0] === objects[0]); * // => true */ - clone( + cloneWith( value: T, customizer: (value: any) => any): T; } @@ -10800,7 +10800,7 @@ declare module _ { /** * @see _.clone */ - clone(customizer: (value: any) => any): T; + cloneWith(customizer: (value: any) => any): T; } interface LoDashImplicitArrayWrapper { @@ -10808,14 +10808,14 @@ declare module _ { /** * @see _.clone */ - clone(customizer: (value: any) => any): T[]; + cloneWith(customizer: (value: any) => any): T[]; } interface LoDashImplicitObjectWrapper { /** * @see _.clone */ - clone(customizer: (value: any) => any): T; + cloneWith(customizer: (value: any) => any): T; } //_.cloneDeepWith @@ -10832,7 +10832,7 @@ declare module _ { * @param thisArg The this binding of customizer. * @return Returns the deep cloned value. */ - cloneDeep( + cloneDeepWith( value: T, customizer: (value: any) => any): T; } @@ -10841,21 +10841,21 @@ declare module _ { /** * @see _.cloneDeep */ - cloneDeep(customizer: (value: any) => any): T; + cloneDeepWith(customizer: (value: any) => any): T; } interface LoDashImplicitArrayWrapper { /** * @see _.cloneDeep */ - cloneDeep(customizer: (value: any) => any): T[]; + cloneDeepWith(customizer: (value: any) => any): T[]; } interface LoDashImplicitObjectWrapper { /** * @see _.cloneDeep */ - cloneDeep(customizer: (value: any) => any): T; + cloneDeepWith(customizer: (value: any) => any): T; } //_.eq