Skip to content

Commit

Permalink
Merge pull request #12721 from lpizzinidev/fix-cast-cleanup
Browse files Browse the repository at this point in the history
fix: code cleanup in `getStrictQuery` function
  • Loading branch information
vkarpov15 committed Nov 26, 2022
2 parents 8a4fe03 + aad988d commit dc42cb2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/cast.js
Expand Up @@ -387,12 +387,11 @@ function getStrictQuery(queryOptions, schemaUserProvidedOptions, schemaOptions,
if ('strict' in schemaUserProvidedOptions) {
return schemaUserProvidedOptions.strict;
}
if (
context.mongooseCollection &&
const mongooseOptions = context.mongooseCollection &&
context.mongooseCollection.conn &&
context.mongooseCollection.conn.base &&
context.mongooseCollection.conn.base.options) {
const mongooseOptions = context.mongooseCollection.conn.base.options;
context.mongooseCollection.conn.base.options;
if (mongooseOptions) {
if ('strictQuery' in mongooseOptions) {
return mongooseOptions.strictQuery;
}
Expand Down

0 comments on commit dc42cb2

Please sign in to comment.