Skip to content

Commit

Permalink
chore: clean up a couple of lingering issues with #12680
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Apr 27, 2023
1 parent 7a3585e commit 2e8cff3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion scripts/tsc-diagnostics-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const fs = require('fs');

const stdin = fs.readFileSync(0).toString('utf8');
const maxInstantiations = isNaN(process.argv[2]) ? 110000 : parseInt(process.argv[2], 10);
const maxInstantiations = isNaN(process.argv[2]) ? 120000 : parseInt(process.argv[2], 10);

console.log(stdin);

Expand Down
4 changes: 1 addition & 3 deletions test/types/document.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,7 @@ function gh11435() {
const ItemSchema = new Schema<Item>({ name: String });

ItemSchema.pre('validate', function preValidate() {
if (!(this instanceof Query)) {
expectType<Model<unknown>>(this.$model('Item1'));
}
expectType<Model<unknown>>(this.$model('Item1'));
});
}

Expand Down
4 changes: 2 additions & 2 deletions types/middlewares.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
declare module 'mongoose' {

type MongooseQueryAndDocumentMiddleware = 'updateOne' | 'deleteOne' | 'validate';
type MongooseQueryAndDocumentMiddleware = 'updateOne' | 'deleteOne';

type MongooseDistinctDocumentMiddleware = 'save' | 'init';
type MongooseDistinctDocumentMiddleware = 'save' | 'init' | 'validate';
type MongooseDocumentMiddleware = MongooseDistinctDocumentMiddleware | MongooseQueryAndDocumentMiddleware;

type MongooseDistinctQueryMiddleware = 'count' | 'estimatedDocumentCount' | 'countDocuments' | 'deleteMany' | 'distinct' | 'find' | 'findOne' | 'findOneAndDelete' | 'findOneAndRemove' | 'findOneAndReplace' | 'findOneAndUpdate' | 'replaceOne' | 'updateMany';
Expand Down

0 comments on commit 2e8cff3

Please sign in to comment.