Skip to content

Commit be7b696

Browse files
committed
feat: enable strict: true
1 parent f4ad3f7 commit be7b696

2 files changed

Lines changed: 6 additions & 15 deletions

File tree

src/lib/AbstractBulkOperationResults.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ export abstract class AbstractBulkOperationResults<TSchema extends Document> {
5454
this.collection = collection;
5555
this.totalOperations = totalOperations;
5656
this.logger = logger;
57+
this.bulk = this.collection.initializeUnorderedBulkOp();
5758
this.totalBulkOps = 0;
5859
this.results = _.cloneDeep(INITIAL_BULK_INFOS);
59-
this.initialize();
6060
}
6161

6262
abstract logExecutionStatus(executionResults: BulkOperationResult): this;
@@ -78,12 +78,6 @@ export abstract class AbstractBulkOperationResults<TSchema extends Document> {
7878
);
7979
}
8080

81-
private initialize(): this {
82-
this.bulk = this.collection.initializeUnorderedBulkOp();
83-
this.totalBulkOps = 0;
84-
return this;
85-
}
86-
8781
public async execute(continueOnBulkWriteError = false): Promise<this> {
8882
if (this.totalBulkOps === 0) {
8983
return this;
@@ -117,7 +111,10 @@ export abstract class AbstractBulkOperationResults<TSchema extends Document> {
117111
this.mergeResults(resultPartial);
118112
this.logExecutionStatus(resultPartial);
119113

120-
return this.initialize();
114+
this.bulk = this.collection.initializeUnorderedBulkOp();
115+
this.totalBulkOps = 0;
116+
117+
return this;
121118
}
122119

123120
private mergeResults(resultB: BulkOperationResult): this {

tsconfig.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,8 @@
77
"noImplicitAny": true,
88
"noImplicitReturns": true,
99
"noImplicitThis": true,
10-
"noUnusedLocals": true,
11-
"noUnusedParameters": true,
1210
"skipLibCheck": true,
13-
"strict": false,
14-
"strictBindCallApply": true,
15-
"strictBuiltinIteratorReturn": true,
16-
"strictFunctionTypes": true,
17-
"strictNullChecks": true,
11+
"strict": true,
1812
"useUnknownInCatchVariables": true,
1913

2014
"target": "es2022",

0 commit comments

Comments
 (0)