Skip to content

Commit f01b0b7

Browse files
committed
chore: prettier format
1 parent a807056 commit f01b0b7

24 files changed

+33
-33
lines changed

src/bulk/common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const BatchType = Object.freeze({
4747
} as const);
4848

4949
/** @public */
50-
export type BatchType = typeof BatchType[keyof typeof BatchType];
50+
export type BatchType = (typeof BatchType)[keyof typeof BatchType];
5151

5252
/** @public */
5353
export interface InsertOneModel<TSchema extends Document = Document> {

src/cmap/auth/gssapi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const GSSAPICanonicalizationValue = Object.freeze({
2323

2424
/** @public */
2525
export type GSSAPICanonicalizationValue =
26-
typeof GSSAPICanonicalizationValue[keyof typeof GSSAPICanonicalizationValue];
26+
(typeof GSSAPICanonicalizationValue)[keyof typeof GSSAPICanonicalizationValue];
2727

2828
type MechanismProperties = {
2929
/** @deprecated use `CANONICALIZE_HOST_NAME` instead */

src/cmap/auth/providers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const AuthMechanism = Object.freeze({
1111
} as const);
1212

1313
/** @public */
14-
export type AuthMechanism = typeof AuthMechanism[keyof typeof AuthMechanism];
14+
export type AuthMechanism = (typeof AuthMechanism)[keyof typeof AuthMechanism];
1515

1616
/** @internal */
1717
export const AUTH_MECHS_AUTH_SRC_EXTERNAL = new Set<AuthMechanism>([

src/cmap/connect.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ function parseSslOptions(options: MakeConnectionOptions): TLSConnectionOpts {
348348
}
349349

350350
const SOCKET_ERROR_EVENT_LIST = ['error', 'close', 'timeout', 'parseError'] as const;
351-
type ErrorHandlerEventName = typeof SOCKET_ERROR_EVENT_LIST[number] | 'cancel';
351+
type ErrorHandlerEventName = (typeof SOCKET_ERROR_EVENT_LIST)[number] | 'cancel';
352352
const SOCKET_ERROR_EVENTS = new Set(SOCKET_ERROR_EVENT_LIST);
353353

354354
function makeConnection(options: MakeConnectionOptions, _callback: Callback<Stream>) {

src/cmap/connection_pool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export type ConnectionPoolEvents = {
138138
*/
139139
export class ConnectionPool extends TypedEventEmitter<ConnectionPoolEvents> {
140140
options: Readonly<ConnectionPoolOptions>;
141-
[kPoolState]: typeof PoolState[keyof typeof PoolState];
141+
[kPoolState]: (typeof PoolState)[keyof typeof PoolState];
142142
[kServer]: Server;
143143
[kLogger]: Logger;
144144
[kConnections]: List<Connection>;

src/cmap/wire_protocol/compression.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const Compressor = Object.freeze({
1515
} as const);
1616

1717
/** @public */
18-
export type Compressor = typeof Compressor[CompressorName];
18+
export type Compressor = (typeof Compressor)[CompressorName];
1919

2020
/** @public */
2121
export type CompressorName = keyof typeof Compressor;

src/cursor/abstract_cursor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export interface CursorStreamOptions {
7474
}
7575

7676
/** @public */
77-
export type CursorFlag = typeof CURSOR_FLAGS[number];
77+
export type CursorFlag = (typeof CURSOR_FLAGS)[number];
7878

7979
/** @public */
8080
export interface AbstractCursorOptions extends BSONSerializeOptions {

src/deps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ export const AutoEncryptionLoggerLevel = Object.freeze({
209209

210210
/** @public */
211211
export type AutoEncryptionLoggerLevel =
212-
typeof AutoEncryptionLoggerLevel[keyof typeof AutoEncryptionLoggerLevel];
212+
(typeof AutoEncryptionLoggerLevel)[keyof typeof AutoEncryptionLoggerLevel];
213213

214214
/** @public */
215215
export interface AutoEncryptionTlsOptions {

src/error.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export const MongoErrorLabel = Object.freeze({
9696
} as const);
9797

9898
/** @public */
99-
export type MongoErrorLabel = typeof MongoErrorLabel[keyof typeof MongoErrorLabel];
99+
export type MongoErrorLabel = (typeof MongoErrorLabel)[keyof typeof MongoErrorLabel];
100100

101101
/** @public */
102102
export interface ErrorDescription extends Document {

src/logger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const LoggerLevel = Object.freeze({
3434
* @public
3535
* @deprecated The Legacy Logger is deprecated and will be removed in the next major version.
3636
*/
37-
export type LoggerLevel = typeof LoggerLevel[keyof typeof LoggerLevel];
37+
export type LoggerLevel = (typeof LoggerLevel)[keyof typeof LoggerLevel];
3838

3939
/**
4040
* @public

src/mongo_client.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const ServerApiVersion = Object.freeze({
4242
} as const);
4343

4444
/** @public */
45-
export type ServerApiVersion = typeof ServerApiVersion[keyof typeof ServerApiVersion];
45+
export type ServerApiVersion = (typeof ServerApiVersion)[keyof typeof ServerApiVersion];
4646

4747
/** @public */
4848
export interface ServerApi {
@@ -74,19 +74,19 @@ export interface PkFactory {
7474
/** @public */
7575
export type SupportedTLSConnectionOptions = Pick<
7676
TLSConnectionOptions,
77-
Extract<keyof TLSConnectionOptions, typeof LEGAL_TLS_SOCKET_OPTIONS[number]>
77+
Extract<keyof TLSConnectionOptions, (typeof LEGAL_TLS_SOCKET_OPTIONS)[number]>
7878
>;
7979

8080
/** @public */
8181
export type SupportedTLSSocketOptions = Pick<
8282
TLSSocketOptions,
83-
Extract<keyof TLSSocketOptions, typeof LEGAL_TLS_SOCKET_OPTIONS[number]>
83+
Extract<keyof TLSSocketOptions, (typeof LEGAL_TLS_SOCKET_OPTIONS)[number]>
8484
>;
8585

8686
/** @public */
8787
export type SupportedSocketOptions = Pick<
8888
TcpNetConnectOpts,
89-
typeof LEGAL_TCP_SOCKET_OPTIONS[number]
89+
(typeof LEGAL_TCP_SOCKET_OPTIONS)[number]
9090
>;
9191

9292
/** @public */
@@ -308,7 +308,7 @@ export interface MongoClientPrivate {
308308
}
309309

310310
/** @public */
311-
export type MongoClientEvents = Pick<TopologyEvents, typeof MONGO_CLIENT_EVENTS[number]> & {
311+
export type MongoClientEvents = Pick<TopologyEvents, (typeof MONGO_CLIENT_EVENTS)[number]> & {
312312
// In previous versions the open event emitted a topology, in an effort to no longer
313313
// expose internals but continue to expose this useful event API, it now emits a mongoClient
314314
open(mongoClient: MongoClient): void;

src/mongo_logger.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const SeverityLevel = Object.freeze({
1717
} as const);
1818

1919
/** @internal */
20-
export type SeverityLevel = typeof SeverityLevel[keyof typeof SeverityLevel];
20+
export type SeverityLevel = (typeof SeverityLevel)[keyof typeof SeverityLevel];
2121

2222
/** @internal */
2323
export const MongoLoggableComponent = Object.freeze({
@@ -29,7 +29,7 @@ export const MongoLoggableComponent = Object.freeze({
2929

3030
/** @internal */
3131
export type MongoLoggableComponent =
32-
typeof MongoLoggableComponent[keyof typeof MongoLoggableComponent];
32+
(typeof MongoLoggableComponent)[keyof typeof MongoLoggableComponent];
3333

3434
/** @internal */
3535
export interface MongoLoggerEnvOptions {

src/mongo_types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ export const BSONType = Object.freeze({
188188
} as const);
189189

190190
/** @public */
191-
export type BSONType = typeof BSONType[keyof typeof BSONType];
191+
export type BSONType = (typeof BSONType)[keyof typeof BSONType];
192192
/** @public */
193193
export type BSONTypeAlias = keyof typeof BSONType;
194194

src/operations/find_and_modify.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const ReturnDocument = Object.freeze({
1717
} as const);
1818

1919
/** @public */
20-
export type ReturnDocument = typeof ReturnDocument[keyof typeof ReturnDocument];
20+
export type ReturnDocument = (typeof ReturnDocument)[keyof typeof ReturnDocument];
2121

2222
/** @public */
2323
export interface FindOneAndDeleteOptions extends CommandOperationOptions {

src/operations/set_profiling_level.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const ProfilingLevel = Object.freeze({
1616
} as const);
1717

1818
/** @public */
19-
export type ProfilingLevel = typeof ProfilingLevel[keyof typeof ProfilingLevel];
19+
export type ProfilingLevel = (typeof ProfilingLevel)[keyof typeof ProfilingLevel];
2020

2121
/** @public */
2222
export type SetProfilingLevelOptions = CommandOperationOptions;

src/read_concern.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const ReadConcernLevel = Object.freeze({
1010
} as const);
1111

1212
/** @public */
13-
export type ReadConcernLevel = typeof ReadConcernLevel[keyof typeof ReadConcernLevel];
13+
export type ReadConcernLevel = (typeof ReadConcernLevel)[keyof typeof ReadConcernLevel];
1414

1515
/** @public */
1616
export type ReadConcernLike = ReadConcern | { level: ReadConcernLevel } | ReadConcernLevel;

src/read_preference.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const ReadPreferenceMode = Object.freeze({
1616
} as const);
1717

1818
/** @public */
19-
export type ReadPreferenceMode = typeof ReadPreferenceMode[keyof typeof ReadPreferenceMode];
19+
export type ReadPreferenceMode = (typeof ReadPreferenceMode)[keyof typeof ReadPreferenceMode];
2020

2121
/** @public */
2222
export interface HedgeOptions {

src/sdam/common.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const TopologyType = Object.freeze({
2424
} as const);
2525

2626
/** @public */
27-
export type TopologyType = typeof TopologyType[keyof typeof TopologyType];
27+
export type TopologyType = (typeof TopologyType)[keyof typeof TopologyType];
2828

2929
/**
3030
* An enumeration of server types we know about
@@ -44,7 +44,7 @@ export const ServerType = Object.freeze({
4444
} as const);
4545

4646
/** @public */
47-
export type ServerType = typeof ServerType[keyof typeof ServerType];
47+
export type ServerType = (typeof ServerType)[keyof typeof ServerType];
4848

4949
/** @internal */
5050
export type TimerQueue = Set<NodeJS.Timeout>;

src/transactions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const TxnState = Object.freeze({
1818
} as const);
1919

2020
/** @internal */
21-
export type TxnState = typeof TxnState[keyof typeof TxnState];
21+
export type TxnState = (typeof TxnState)[keyof typeof TxnState];
2222

2323
const stateMachine: { [state in TxnState]: TxnState[] } = {
2424
[TxnState.NO_TRANSACTION]: [TxnState.NO_TRANSACTION, TxnState.STARTING_TRANSACTION],

test/integration/crud/aggregation.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ describe('Aggregation', function () {
725725
// is executed
726726
const command = db.command.bind(db);
727727
// Validate the command
728-
db.command = function (...args: Parameters<typeof db['command']>) {
728+
db.command = function (...args: Parameters<(typeof db)['command']>) {
729729
const c = args[0];
730730
expect(err).to.not.exist;
731731
expect(c.maxTimeMS).to.equal(1000);
@@ -741,7 +741,7 @@ describe('Aggregation', function () {
741741
expect(result.authors).to.eql(['bob']);
742742

743743
// Validate the command
744-
db.command = function (...args: Parameters<typeof db['command']>) {
744+
db.command = function (...args: Parameters<(typeof db)['command']>) {
745745
const c = args[0];
746746
expect(err).to.not.exist;
747747
expect(c.maxTimeMS).to.equal(1000);
@@ -792,7 +792,7 @@ describe('Aggregation', function () {
792792

793793
const command = db.command.bind(db);
794794

795-
db.command = function (...args: Parameters<typeof db['command']>) {
795+
db.command = function (...args: Parameters<(typeof db)['command']>) {
796796
const c = args[0];
797797
expect(c).to.be.an('object');
798798
expect(c.comment).to.be.a('string').and.to.equal('comment');

test/integration/node-specific/comment_with_falsy_values.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Collection, CommandStartedEvent, Long, MongoClient } from '../../../src
44
import { TestBuilder, UnifiedTestSuiteBuilder } from '../../tools/utils';
55

66
const falsyValues = [0, false, '', Long.ZERO, null, NaN] as const;
7-
const falsyToString = (value: typeof falsyValues[number]) => {
7+
const falsyToString = (value: (typeof falsyValues)[number]) => {
88
if (Number.isNaN(value)) {
99
return 'NaN';
1010
}

test/tools/unified-spec-runner/schema.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export const OperationNames = [
6969
'removeKeyAltName',
7070
'getKeyByAltName'
7171
] as const;
72-
export type OperationName = typeof OperationNames[number];
72+
export type OperationName = (typeof OperationNames)[number];
7373

7474
export interface OperationDescription {
7575
name: OperationName;
@@ -97,7 +97,7 @@ export const TopologyType = Object.freeze({
9797
shardedReplicaset: 'sharded-replicaset',
9898
loadBalanced: 'load-balanced'
9999
} as const);
100-
export type TopologyId = typeof TopologyType[keyof typeof TopologyType];
100+
export type TopologyId = (typeof TopologyType)[keyof typeof TopologyType];
101101
export interface RunOnRequirement {
102102
serverless?: 'forbid' | 'allow' | 'require';
103103
auth?: boolean;

test/types/community/collection/insertX.test-d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ type TestModelWithId = TestModel & { _id: ObjectId };
4444
const collection = db.collection<TestModel>('testCollection');
4545

4646
const testDoc: OptionalId<TestModelWithId> = { stringField: 'a', fruitTags: [] };
47-
expectType<Parameters<typeof collection['insertOne']>[0]>(testDoc);
47+
expectType<Parameters<(typeof collection)['insertOne']>[0]>(testDoc);
4848

4949
const resultOne = await collection.insertOne({
5050
stringField: 'hola',

test/unit/assorted/server_discovery_and_monitoring.spec.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ type SDAMPhase =
106106
};
107107

108108
interface MonitoringOutcome {
109-
events: typeof SDAM_EVENT_CLASSES[keyof typeof SDAM_EVENT_CLASSES][];
109+
events: (typeof SDAM_EVENT_CLASSES)[keyof typeof SDAM_EVENT_CLASSES][];
110110
}
111111
interface OutcomeServerDescription {
112112
type?: string;

0 commit comments

Comments
 (0)