Skip to content

Commit 9a2a83f

Browse files
refactor: cleanup after merge
1 parent f6ef267 commit 9a2a83f

File tree

3 files changed

+32
-39
lines changed

3 files changed

+32
-39
lines changed

lib/namespace.ts

+1-8
Original file line numberDiff line numberDiff line change
@@ -662,14 +662,7 @@ export class Namespace<
662662
*
663663
* @param timeout
664664
*/
665-
public timeout(
666-
timeout: number
667-
): BroadcastOperator<
668-
DecorateAcknowledgements<
669-
DecorateAcknowledgementsWithMultipleResponses<EmitEvents>
670-
>,
671-
SocketData
672-
> {
665+
public timeout(timeout: number) {
673666
return new BroadcastOperator<
674667
DecorateAcknowledgementsWithMultipleResponses<EmitEvents>,
675668
SocketData

lib/typed-events.ts

+24-24
Original file line numberDiff line numberDiff line change
@@ -234,37 +234,37 @@ export abstract class StrictEventEmitter<
234234
}
235235
}
236236
/**
237-
Returns a boolean for whether the given type is `any`.
238-
239-
@link https://stackoverflow.com/a/49928360/1490091
240-
241-
Useful in type utilities, such as disallowing `any`s to be passed to a function.
242-
243-
@author sindresorhus
244-
@link https://github.com/sindresorhus/type-fest
245-
*/
237+
* Returns a boolean for whether the given type is `any`.
238+
*
239+
* @link https://stackoverflow.com/a/49928360/1490091
240+
*
241+
* Useful in type utilities, such as disallowing `any`s to be passed to a function.
242+
*
243+
* @author sindresorhus
244+
* @link https://github.com/sindresorhus/type-fest
245+
*/
246246
type IsAny<T> = 0 extends 1 & T ? true : false;
247247

248248
/**
249-
An if-else-like type that resolves depending on whether the given type is `any`.
250-
251-
@see {@link IsAny}
252-
253-
@author sindresorhus
254-
@link https://github.com/sindresorhus/type-fest
255-
*/
249+
* An if-else-like type that resolves depending on whether the given type is `any`.
250+
*
251+
* @see {@link IsAny}
252+
*
253+
* @author sindresorhus
254+
* @link https://github.com/sindresorhus/type-fest
255+
*/
256256
type IfAny<T, TypeIfAny = true, TypeIfNotAny = false> = IsAny<T> extends true
257257
? TypeIfAny
258258
: TypeIfNotAny;
259259

260260
/**
261-
Extracts the type of the last element of an array.
262-
263-
Use-case: Defining the return type of functions that extract the last element of an array, for example [`lodash.last`](https://lodash.com/docs/4.17.15#last).
264-
265-
@author sindresorhus
266-
@link https://github.com/sindresorhus/type-fest
267-
*/
261+
* Extracts the type of the last element of an array.
262+
*
263+
* Use-case: Defining the return type of functions that extract the last element of an array, for example [`lodash.last`](https://lodash.com/docs/4.17.15#last).
264+
*
265+
* @author sindresorhus
266+
* @link https://github.com/sindresorhus/type-fest
267+
*/
268268
export type Last<ValueType extends readonly unknown[]> =
269269
ValueType extends readonly [infer ElementType]
270270
? ElementType
@@ -284,7 +284,7 @@ export type AllButLast<T extends any[]> = T extends [...infer H, infer L]
284284
* Like `Parameters<T>`, but doesn't require `T` to be a function ahead of time.
285285
*/
286286
type LooseParameters<T> = T extends (...args: infer P) => any ? P : never;
287-
export type FirstArg<T> = T extends (arg: infer Param) => any ? Param : any;
287+
288288
export type FirstNonErrorArg<T> = T extends (...args: infer Params) => any
289289
? FirstNonErrorTuple<Params>
290290
: any;

test/socket.io.test-d.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
import { createServer } from "http";
33
import { Adapter } from "socket.io-adapter";
44
import { expectType } from "tsd";
5-
import { BroadcastOperator, Server, Socket } from "../lib/index";
6-
import type { DisconnectReason } from "../lib/socket";
7-
import type {
8-
DefaultEventsMap,
9-
EventNamesWithoutAck,
10-
EventsMap,
11-
} from "../lib/typed-events";
5+
import {
6+
BroadcastOperator,
7+
Server,
8+
Socket,
9+
type DisconnectReason,
10+
} from "../lib/index";
11+
import type { DefaultEventsMap, EventsMap } from "../lib/typed-events";
1212

1313
// This file is run by tsd, not mocha.
1414

0 commit comments

Comments
 (0)