Skip to content

Commit

Permalink
fix lint and address code review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Dec 26, 2024
1 parent d9c7051 commit ae001e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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 ??schemaType.constructor.options.castNonArrays;
const castNonArraysOption = schemaType.options?.castNonArrays ?? schemaType.constructor.options.castNonArrays;
if (!Array.isArray(val)) {
if (!castNonArraysOption) {
if (!options.ignoreCastErrors) {
Expand Down
2 changes: 1 addition & 1 deletion types/indexes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ declare module 'mongoose' {
function syncIndexes(options?: SyncIndexesOptions): Promise<ConnectionSyncIndexesResult>;

interface IndexManager {
/* Deletes all indexes that aren't defined in this model's schema. Used by `syncIndexes()`. */
/* Deletes all indexes that aren't defined in this model's schema. Used by `syncIndexes()`. Returns list of dropped index names. */
cleanIndexes(options?: { toDrop?: string[], hideIndexes?: boolean }): Promise<string[]>;

/**
Expand Down

0 comments on commit ae001e7

Please sign in to comment.