Skip to content

Commit 2bdf47a

Browse files
committed
refactor: use some method
1 parent 9e6cf1f commit 2bdf47a

5 files changed

Lines changed: 6 additions & 6 deletions

File tree

packages/common/pipes/validation.pipe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export class ValidationPipe implements PipeTransform<any> {
5959
return false;
6060
}
6161
const types = [String, Boolean, Number, Array, Object];
62-
return !types.find(t => metatype === t) && !isNil(metatype);
62+
return !types.some(t => metatype === t) && !isNil(metatype);
6363
}
6464

6565
toEmptyIfNil<T = any, R = any>(value: T): R | {} {

packages/core/exceptions/exceptions-handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class ExceptionsHandler extends BaseExceptionFilter {
3232
const filter = this.filters.find(({ exceptionMetatypes, func }) => {
3333
const hasMetatype =
3434
!exceptionMetatypes.length ||
35-
!!exceptionMetatypes.find(
35+
exceptionMetatypes.some(
3636
ExceptionMetatype => exception instanceof ExceptionMetatype,
3737
);
3838
return hasMetatype;

packages/core/helpers/external-context-creator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ export class ExternalContextCreator {
6666

6767
public findComponentByClassName(module: Module, className: string): boolean {
6868
const { components } = module;
69-
const hasComponent = [...components.keys()].find(
69+
const hasComponent = [...components.keys()].some(
7070
component => component === className,
7171
);
72-
return !!hasComponent;
72+
return hasComponent;
7373
}
7474
}

packages/microservices/exceptions/rpc-exceptions-handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class RpcExceptionsHandler extends BaseRpcExceptionFilter {
3636
const filter = this.filters.find(({ exceptionMetatypes, func }) => {
3737
const hasMetatype =
3838
!exceptionMetatypes.length ||
39-
!!exceptionMetatypes.find(
39+
exceptionMetatypes.some(
4040
ExceptionMetatype => exception instanceof ExceptionMetatype,
4141
);
4242
return hasMetatype;

packages/websockets/exceptions/ws-exceptions-handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class WsExceptionsHandler extends BaseWsExceptionFilter {
2929
const filter = this.filters.find(({ exceptionMetatypes, func }) => {
3030
const hasMetatype =
3131
!exceptionMetatypes.length ||
32-
!!exceptionMetatypes.find(
32+
exceptionMetatypes.some(
3333
ExceptionMetatype => exception instanceof ExceptionMetatype,
3434
);
3535
return hasMetatype;

0 commit comments

Comments
 (0)