Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix(NODE-6259): replace dynamic property assignment with a static getter
  • Loading branch information
sis0k0 committed Jul 11, 2024
commit 0301748a67ce5f07b4767209f50984fd2981be64
13 changes: 4 additions & 9 deletions src/bulk/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -911,8 +911,6 @@ export class BulkWriteShimOperation extends AbstractOperation {
/** @public */
export abstract class BulkOperationBase {
isOrdered: boolean;
// Declare dynamically assigned property
declare length: number;
/** @internal */
s: BulkOperationPrivate;
operationId?: number;
Expand Down Expand Up @@ -1180,6 +1178,10 @@ export abstract class BulkOperationBase {
);
}

get length(): number {
return this.s.currentIndex;
}

get bsonOptions(): BSONSerializeOptions {
return this.s.bsonOptions;
}
Expand Down Expand Up @@ -1276,13 +1278,6 @@ export abstract class BulkOperationBase {
}
}

Object.defineProperty(BulkOperationBase.prototype, 'length', {
enumerable: true,
get() {
return this.s.currentIndex;
}
});

function isInsertBatch(batch: Batch): boolean {
return batch.batchType === BatchType.INSERT;
}
Expand Down