Skip to content

Commit

Permalink
fix: Use correct clone method
Browse files Browse the repository at this point in the history
  • Loading branch information
notheotherben committed Feb 22, 2016
1 parent 309f2d0 commit 30cc850
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/ModelHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export class ModelHelpers<TDocument extends { _id?: any }, TInstance> {
* @param {any} The document you wish to clone deeply.
*/
cloneDocument<T>(original: T): T {
return _.cloneDeep(original, (value) => {
return _.cloneDeepWith(original, (value) => {
if(Buffer.isBuffer(value)) {
return value;
}
Expand Down
16 changes: 8 additions & 8 deletions typings/DefinitelyTyped/lodash/lodash.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10791,7 +10791,7 @@ declare module _ {
* console.log(shallow[0] === objects[0]);
* // => true
*/
clone<T>(
cloneWith<T>(
value: T,
customizer: (value: any) => any): T;
}
Expand All @@ -10800,22 +10800,22 @@ declare module _ {
/**
* @see _.clone
*/
clone(customizer: (value: any) => any): T;
cloneWith(customizer: (value: any) => any): T;
}

interface LoDashImplicitArrayWrapper<T> {

/**
* @see _.clone
*/
clone(customizer: (value: any) => any): T[];
cloneWith(customizer: (value: any) => any): T[];
}

interface LoDashImplicitObjectWrapper<T> {
/**
* @see _.clone
*/
clone(customizer: (value: any) => any): T;
cloneWith(customizer: (value: any) => any): T;
}

//_.cloneDeepWith
Expand All @@ -10832,7 +10832,7 @@ declare module _ {
* @param thisArg The this binding of customizer.
* @return Returns the deep cloned value.
*/
cloneDeep<T>(
cloneDeepWith<T>(
value: T,
customizer: (value: any) => any): T;
}
Expand All @@ -10841,21 +10841,21 @@ declare module _ {
/**
* @see _.cloneDeep
*/
cloneDeep(customizer: (value: any) => any): T;
cloneDeepWith(customizer: (value: any) => any): T;
}

interface LoDashImplicitArrayWrapper<T> {
/**
* @see _.cloneDeep
*/
cloneDeep(customizer: (value: any) => any): T[];
cloneDeepWith(customizer: (value: any) => any): T[];
}

interface LoDashImplicitObjectWrapper<T> {
/**
* @see _.cloneDeep
*/
cloneDeep(customizer: (value: any) => any): T;
cloneDeepWith(customizer: (value: any) => any): T;
}

//_.eq
Expand Down

0 comments on commit 30cc850

Please sign in to comment.