T-29: lint:check fails on existing issues, so bun run check (M0 exit criterion 1) can't go green
This commit is contained in:
parent
88023ba643
commit
1720e45f70
5 changed files with 43 additions and 31 deletions
|
|
@ -249,7 +249,7 @@ export class MongoDBClient {
|
|||
|
||||
cursor.next().then(
|
||||
doc => {
|
||||
if (doc == null) {
|
||||
if (doc === null || doc === undefined) {
|
||||
readInProgress = false;
|
||||
closeCursor().then(
|
||||
() => {
|
||||
|
|
@ -279,7 +279,7 @@ export class MongoDBClient {
|
|||
this.destroy(err instanceof Error ? err : new Error(String(err)));
|
||||
return;
|
||||
}
|
||||
if (output == null) {
|
||||
if (output === null || output === undefined) {
|
||||
readNext();
|
||||
return;
|
||||
}
|
||||
|
|
@ -542,10 +542,10 @@ export class MongoDBClient {
|
|||
if (typeof fn !== 'function') {
|
||||
throw new TypeError('Cursor does not implement "map"');
|
||||
}
|
||||
let receiver: unknown;
|
||||
const receiverRef: { current: unknown } = { current: undefined };
|
||||
const guardedTransform =
|
||||
typeof transform === 'function'
|
||||
? (doc: unknown) => transform.call(receiver, doc)
|
||||
? (doc: unknown) => transform.call(receiverRef.current, doc)
|
||||
: transform;
|
||||
const mapped = fn.call(cursor, guardedTransform);
|
||||
const result =
|
||||
|
|
@ -554,7 +554,7 @@ export class MongoDBClient {
|
|||
: mapped && typeof mapped === 'object'
|
||||
? this.wrapReadOnlyCursor(mapped as object)
|
||||
: mapped;
|
||||
receiver = result;
|
||||
receiverRef.current = result;
|
||||
return result;
|
||||
},
|
||||
clone: () => {
|
||||
|
|
@ -751,17 +751,17 @@ export class MongoDBClient {
|
|||
return wrapped;
|
||||
},
|
||||
map: <TMapped>(transform: (doc: T) => TMapped) => {
|
||||
let receiver: unknown;
|
||||
const receiverRef: { current: unknown } = { current: undefined };
|
||||
const guardedTransform =
|
||||
typeof transform === 'function'
|
||||
? (doc: T) => transform.call(receiver, doc)
|
||||
? (doc: T) => transform.call(receiverRef.current, doc)
|
||||
: transform;
|
||||
const mapped = cursor.map(guardedTransform);
|
||||
const result =
|
||||
mapped === (cursor as unknown)
|
||||
? wrapped
|
||||
: this.wrapReadOnlyAggregationCursor(mapped as unknown as AggregationCursor<Document>);
|
||||
receiver = result;
|
||||
receiverRef.current = result;
|
||||
return result;
|
||||
},
|
||||
clone: () => this.wrapReadOnlyAggregationCursor(cursor.clone()),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue