Skip to content

Commit 4eda38b

Browse files
committed
chore: fix lint and ts errors
1 parent 4bdfaba commit 4eda38b

File tree

4 files changed

+16
-59
lines changed

4 files changed

+16
-59
lines changed

src/cmap/wire_protocol/on_data.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ export function onData(
8787

8888
[Symbol.asyncIterator]() {
8989
return this;
90+
},
91+
92+
[Symbol.asyncDispose]: function (): PromiseLike<void> {
93+
return closeHandler().then(() => undefined);
9094
}
9195
};
9296

src/operations/distinct.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export class DistinctOperation extends CommandOperation<any[]> {
9696

9797
const result = await super.executeCommand(server, session, cmd, timeoutContext);
9898

99-
// @ts-expect-error Explain always returns a document
99+
// @ts-expect-error: Explain always returns a document
100100
return this.explain ? result : result.values;
101101
}
102102
}

test/types/community/slow-model.test-d.ts

Lines changed: 9 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ export interface SlowModelBase {
108108
prop10: boolean;
109109
prop11: string | null;
110110
prop12: string[];
111-
prop13: ExtraType4 | null;
112-
prop14: ExtraType5 | null;
113111
prop15: ExtraType6 | null;
114112
prop16: string[];
115113
prop17: string | null;
@@ -253,13 +251,15 @@ export interface ExtraType2 {
253251

254252
export type ExtraType9 = ExtraType6;
255253

256-
export enum UnitType3 {
257-
unit_ = 'unit_',
258-
unit__ = 'unit__',
259-
unit___ = 'unit___',
260-
unit____ = 'unit____',
261-
unit_____ = 'unit_____'
262-
}
254+
const UnitType3 = {
255+
unit_: 'unit_',
256+
unit__: 'unit__',
257+
unit___: 'unit___',
258+
unit____: 'unit____',
259+
unit_____: 'unit_____'
260+
} as const;
261+
262+
export type UnitType3 = (typeof UnitType3)[keyof typeof UnitType3];
263263

264264
export interface ExtraType10 {
265265
prop34?: UnitType3;
@@ -308,54 +308,6 @@ export interface SpecialType extends SlowModel {
308308
prop51: string;
309309
}
310310

311-
export enum ExtraType17 {
312-
Key16 = 'key16',
313-
Key17 = 'key17'
314-
}
315-
316-
export interface IType1 {
317-
type: ExtraType17;
318-
}
319-
export interface Key17IType1 extends IType1 {
320-
type: ExtraType17.Key17;
321-
prop52: string;
322-
prop53?: string;
323-
prop54?: string;
324-
}
325-
export interface Key16IType1 extends IType1 {
326-
type: ExtraType17.Key16;
327-
prop55: string;
328-
prop56: string | null;
329-
}
330-
331-
export type ExtraType4 = Key17IType1 | Key16IType1;
332-
333-
export enum ExtraType18 {
334-
Key18 = 'key18',
335-
Key19 = 'key19'
336-
}
337-
338-
interface IType2 {
339-
type: ExtraType18;
340-
}
341-
export type ExtraType5 = Key18IType2 | Key19IType2;
342-
343-
export interface Key18IType2 extends IType2 {
344-
type: ExtraType18.Key18;
345-
prop57: string;
346-
prop58: string;
347-
prop59: boolean;
348-
prop60: string | null;
349-
prop61: boolean;
350-
prop62?: string;
351-
}
352-
export interface Key19IType2 extends IType2 {
353-
type: ExtraType18.Key19;
354-
prop63: string;
355-
prop64?: string;
356-
prop65: boolean;
357-
}
358-
359311
export type ExtraType19 = ExtraType15[] | ExtraType20;
360312
export interface ExtraType7<T extends ExtraType19 = ExtraType19> {
361313
id: UUID;

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"lib": [
1313
"es2021",
1414
"ES2022.Error",
15-
"ES2022.Object"
15+
"ES2022.Object",
16+
"esnext.disposable"
1617
],
1718
// We don't make use of tslib helpers, all syntax used is supported by target engine
1819
"importHelpers": false,

0 commit comments

Comments
 (0)