Skip to content

Commit d9ed40c

Browse files
fix interface function name && fix lint
1 parent 9335280 commit d9ed40c

File tree

6 files changed

+6
-7
lines changed

6 files changed

+6
-7
lines changed

src/change_stream.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ export class ChangeStream<
554554
/** @beta */
555555
declare [Symbol.asyncDispose]: () => Promise<void>;
556556
/** @internal */
557-
async dispose() {
557+
async asyncDispose() {
558558
await this.close();
559559
}
560560

src/cursor/abstract_cursor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ export abstract class AbstractCursor<
282282
/** @beta */
283283
declare [Symbol.asyncDispose]: () => Promise<void>;
284284
/** @internal */
285-
async dispose() {
285+
async asyncDispose() {
286286
await this.close();
287287
}
288288

src/mongo_client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ export class MongoClient extends TypedEventEmitter<MongoClientEvents> implements
408408
/** @beta */
409409
declare [Symbol.asyncDispose]: () => Promise<void>;
410410
/** @internal */
411-
async dispose() {
411+
async asyncDispose() {
412412
await this.close();
413413
}
414414

src/resource_management.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ export interface AsyncDisposable {
1010
*
1111
* A method that wraps disposal semantics for a given resource in the class.
1212
*/
13-
dispose(): Promise<void>;
13+
asyncDispose(): Promise<void>;
1414
}
1515

1616
/** @internal */
1717
export function configureResourceManagement(target: AsyncDisposable) {
1818
Symbol.asyncDispose &&
1919
Object.defineProperty(target, Symbol.asyncDispose, {
2020
value: async function asyncDispose(this: AsyncDisposable) {
21-
await this.dispose();
21+
await this.asyncDispose();
2222
},
2323
enumerable: false,
2424
configurable: true,

src/sessions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ export class ClientSession
293293
/** @beta */
294294
declare [Symbol.asyncDispose]: () => Promise<void>;
295295
/** @internal */
296-
async dispose() {
296+
async asyncDispose() {
297297
await this.endSession({ force: true });
298298
}
299299

src/utils.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import type { CommandOperationOptions, OperationParent } from './operations/comm
3131
import type { Hint, OperationOptions } from './operations/operation';
3232
import { ReadConcern } from './read_concern';
3333
import { ReadPreference } from './read_preference';
34-
import type { AsyncDisposable } from './resource_management';
3534
import { ServerType } from './sdam/common';
3635
import type { Server } from './sdam/server';
3736
import type { Topology } from './sdam/topology';

0 commit comments

Comments
 (0)