Skip to content

Commit ae001e7

Browse files
committed
fix lint and address code review comments
1 parent d9c7051 commit ae001e7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/model.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3688,7 +3688,7 @@ Model.castObject = function castObject(obj, options) {
36883688
}
36893689

36903690
if (schemaType.$isMongooseDocumentArray) {
3691-
const castNonArraysOption = schemaType.options?.castNonArrays ??schemaType.constructor.options.castNonArrays;
3691+
const castNonArraysOption = schemaType.options?.castNonArrays ?? schemaType.constructor.options.castNonArrays;
36923692
if (!Array.isArray(val)) {
36933693
if (!castNonArraysOption) {
36943694
if (!options.ignoreCastErrors) {

types/indexes.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ declare module 'mongoose' {
1010
function syncIndexes(options?: SyncIndexesOptions): Promise<ConnectionSyncIndexesResult>;
1111

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

1616
/**

0 commit comments

Comments
 (0)