Skip to content

Commit

Permalink
fix interface function name && fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
baileympearson committed Jul 26, 2024
1 parent 9335280 commit d9ed40c
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/change_stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ export class ChangeStream<
/** @beta */
declare [Symbol.asyncDispose]: () => Promise<void>;
/** @internal */
async dispose() {
async asyncDispose() {
await this.close();
}

Expand Down
2 changes: 1 addition & 1 deletion src/cursor/abstract_cursor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ export abstract class AbstractCursor<
/** @beta */
declare [Symbol.asyncDispose]: () => Promise<void>;
/** @internal */
async dispose() {
async asyncDispose() {
await this.close();
}

Expand Down
2 changes: 1 addition & 1 deletion src/mongo_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ export class MongoClient extends TypedEventEmitter<MongoClientEvents> implements
/** @beta */
declare [Symbol.asyncDispose]: () => Promise<void>;
/** @internal */
async dispose() {
async asyncDispose() {
await this.close();
}

Expand Down
4 changes: 2 additions & 2 deletions src/resource_management.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ export interface AsyncDisposable {
*
* A method that wraps disposal semantics for a given resource in the class.
*/
dispose(): Promise<void>;
asyncDispose(): Promise<void>;
}

/** @internal */
export function configureResourceManagement(target: AsyncDisposable) {
Symbol.asyncDispose &&
Object.defineProperty(target, Symbol.asyncDispose, {
value: async function asyncDispose(this: AsyncDisposable) {
await this.dispose();
await this.asyncDispose();
},
enumerable: false,
configurable: true,
Expand Down
2 changes: 1 addition & 1 deletion src/sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ export class ClientSession
/** @beta */
declare [Symbol.asyncDispose]: () => Promise<void>;
/** @internal */
async dispose() {
async asyncDispose() {
await this.endSession({ force: true });
}

Expand Down
1 change: 0 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import type { CommandOperationOptions, OperationParent } from './operations/comm
import type { Hint, OperationOptions } from './operations/operation';
import { ReadConcern } from './read_concern';
import { ReadPreference } from './read_preference';
import type { AsyncDisposable } from './resource_management';
import { ServerType } from './sdam/common';
import type { Server } from './sdam/server';
import type { Topology } from './sdam/topology';
Expand Down

0 comments on commit d9ed40c

Please sign in to comment.