Skip to content

Commit

Permalink
style(): minor style improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed May 24, 2020
1 parent fa10ab7 commit 07cb5a8
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 15 deletions.
3 changes: 1 addition & 2 deletions packages/common/cache/interceptors/cache.interceptor.ts
Expand Up @@ -51,8 +51,7 @@ export class CacheInterceptor implements NestInterceptor {

return next.handle().pipe(
tap(response => {
const args =
isNil(ttl) ? [key, response] : [key, response, { ttl }];
const args = isNil(ttl) ? [key, response] : [key, response, { ttl }];
this.cacheManager.set(...args);
}),
);
Expand Down
8 changes: 4 additions & 4 deletions packages/common/test/decorators/use-guards.decorator.spec.ts
Expand Up @@ -8,17 +8,17 @@ class Guard {}
describe('@UseGuards', () => {
const guards = [Guard, Guard];

@UseGuards(...(guards as any))
@UseGuards(...guards)
class Test {}

class TestWithMethod {
@UseGuards(...(guards as any))
@UseGuards(...guards)
public static test() {}
}

class Test2 {
@UseGuards(...(guards as any))
@UseGuards(...(guards as any))
@UseGuards(...guards)
@UseGuards(...guards)
public static test() {}
}

Expand Down
Expand Up @@ -8,11 +8,11 @@ class Interceptor {}
describe('@UseInterceptors', () => {
const interceptors = [Interceptor, Interceptor];

@UseInterceptors(...(interceptors as any))
@UseInterceptors(...interceptors)
class Test {}

class TestWithMethod {
@UseInterceptors(...(interceptors as any))
@UseInterceptors(...interceptors)
public static test() {}
}

Expand Down
4 changes: 2 additions & 2 deletions packages/common/test/decorators/use-pipes.decorator.spec.ts
Expand Up @@ -10,11 +10,11 @@ class Pipe {
describe('@UsePipes', () => {
const pipes = [new Pipe(), new Pipe()];

@UsePipes(...(pipes as any))
@UsePipes(...pipes)
class Test {}

class TestWithMethod {
@UsePipes(...(pipes as any))
@UsePipes(...pipes)
public static test() {}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/websockets/context/ws-context-creator.ts
Expand Up @@ -134,7 +134,7 @@ export class WsContextCreator {
public createGuardsFn<TContext extends string = ContextType>(
guards: any[],
instance: Controller,
callback: (...args: any[]) => any,
callback: (...args: unknown[]) => any,
contextType?: TContext,
): Function | null {
const canActivateFn = async (args: any[]) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/websockets/socket-server-provider.ts
Expand Up @@ -64,7 +64,7 @@ export class SocketServerProvider {
) {
const adapter = this.applicationConfig.getIoAdapter();
return adapter.create(port, {
...(options as any),
...options,
namespace: this.validateNamespace(options.namespace || ''),
server,
});
Expand Down
6 changes: 3 additions & 3 deletions packages/websockets/web-sockets-controller.ts
Expand Up @@ -30,7 +30,7 @@ export class WebSocketsController {

public mergeGatewayAndServer(
instance: NestGateway,
metatype: Type<any> | Function,
metatype: Type<unknown> | Function,
moduleKey: string,
) {
const options = Reflect.getMetadata(GATEWAY_OPTIONS, metatype) || {};
Expand Down Expand Up @@ -122,7 +122,7 @@ export class WebSocketsController {
.pipe(
distinctUntilChanged((prev, curr) => compareElementAt(prev, curr, 0)),
)
.subscribe((args: any[]) => instance.handleConnection(...args));
.subscribe((args: unknown[]) => instance.handleConnection(...args));
}
}

Expand Down Expand Up @@ -164,7 +164,7 @@ export class WebSocketsController {

private assignServerToProperties<T = any>(
instance: NestGateway,
server: any,
server: object,
) {
for (const propertyKey of this.metadataExplorer.scanForServerHooks(
instance,
Expand Down

0 comments on commit 07cb5a8

Please sign in to comment.