mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 23:37:04 +00:00
Merge pull request #32641 from frontendmonster/master
[@types/mongoose] Make "MongooseDocument.invalidate" value param optional
This commit is contained in:
Vendored
+2
-1
@@ -16,6 +16,7 @@
|
||||
// Dan Manastireanu <https://github.com/danmana>
|
||||
// stablio <https://github.com/stablio>
|
||||
// Emmanuel Gautier <https://github.com/emmanuelgautier>
|
||||
// Frontend Monster <https://github.com/frontendmonster>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -1310,7 +1311,7 @@ declare module "mongoose" {
|
||||
* @param kind optional kind property for the error
|
||||
* @returns the current ValidationError, with all currently invalidated paths
|
||||
*/
|
||||
invalidate(path: string, errorMsg: string | NativeError, value: any, kind?: string): Error.ValidationError | boolean;
|
||||
invalidate(path: string, errorMsg: string | NativeError, value?: any, kind?: string): Error.ValidationError | boolean;
|
||||
|
||||
/** Returns true if path was directly set and modified, else false. */
|
||||
isDirectModified(path: string): boolean;
|
||||
|
||||
@@ -726,6 +726,7 @@ doc.execPopulate().then(function (arg) {
|
||||
doc.get('path', Number);
|
||||
doc.init(doc).init(doc, {});
|
||||
doc.inspect();
|
||||
doc.invalidate('path', new Error('hi')).toString();
|
||||
doc.invalidate('path', new Error('hi'), 999).toString();
|
||||
doc.isDirectModified('path').valueOf();
|
||||
doc.isInit('path').valueOf();
|
||||
|
||||
Reference in New Issue
Block a user