Skip to content

Commit

Permalink
fix: code cleanup in getStrictQuery function
Browse files Browse the repository at this point in the history
  • Loading branch information
lpizzinidev committed Nov 24, 2022
1 parent d909525 commit aad988d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/cast.js
Original file line number Diff line number Diff line change
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 aad988d

Please sign in to comment.