Skip to content

Commit

Permalink
Update lib/model.js
Browse files Browse the repository at this point in the history
Co-authored-by: Djamel Benali <[email protected]>
  • Loading branch information
vkarpov15 and BenaliDjamel authored Dec 22, 2024
1 parent 3696a0d commit dfd96dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -3688,7 +3688,7 @@ Model.castObject = function castObject(obj, options) {
}

if (schemaType.$isMongooseDocumentArray) {
const castNonArraysOption = schemaType.options.castNonArrays != null ? schemaType.options.castNonArrays : schemaType.constructor.options.castNonArrays;
const castNonArraysOption = schemaType.options?.castNonArrays ??schemaType.constructor.options.castNonArrays;

Check failure on line 3691 in lib/model.js

View workflow job for this annotation

GitHub Actions / Lint JS-Files

Operator '??' must be spaced

Check failure on line 3691 in lib/model.js

View workflow job for this annotation

GitHub Actions / Lint JS-Files

Operator '??' must be spaced
if (!Array.isArray(val)) {
if (!castNonArraysOption) {
if (!options.ignoreCastErrors) {
Expand Down

0 comments on commit dfd96dc

Please sign in to comment.