mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
test(common): fix isempty issue in context
This commit is contained in:
@@ -5,7 +5,7 @@ import { NestContainer } from '../injector/container.js';
|
||||
import { InstanceWrapper } from '../injector/instance-wrapper.js';
|
||||
import {
|
||||
FILTER_CATCH_EXCEPTIONS,
|
||||
isEmptyArray,
|
||||
isEmpty,
|
||||
isFunction,
|
||||
} from '@nestjs/common/internal';
|
||||
import type { Type, ExceptionFilter } from '@nestjs/common';
|
||||
@@ -22,7 +22,7 @@ export class BaseExceptionFilterContext extends ContextCreator {
|
||||
contextId = STATIC_CONTEXT,
|
||||
inquirerId?: string,
|
||||
): R {
|
||||
if (isEmptyArray(metadata)) {
|
||||
if (isEmpty(metadata)) {
|
||||
return [] as any[] as R;
|
||||
}
|
||||
return iterate(metadata)
|
||||
|
||||
@@ -8,7 +8,7 @@ import { InstanceWrapper } from '../injector/instance-wrapper.js';
|
||||
import {
|
||||
GUARDS_METADATA,
|
||||
type Controller,
|
||||
isEmptyArray,
|
||||
isEmpty,
|
||||
isFunction,
|
||||
} from '@nestjs/common/internal';
|
||||
import type { Type } from '@nestjs/common';
|
||||
@@ -45,7 +45,7 @@ export class GuardsContextCreator extends ContextCreator {
|
||||
contextId = STATIC_CONTEXT,
|
||||
inquirerId?: string,
|
||||
): R {
|
||||
if (isEmptyArray(metadata)) {
|
||||
if (isEmpty(metadata)) {
|
||||
return [] as unknown[] as R;
|
||||
}
|
||||
return iterate(metadata)
|
||||
|
||||
@@ -7,7 +7,7 @@ import { InstanceWrapper } from '../injector/instance-wrapper.js';
|
||||
import {
|
||||
INTERCEPTORS_METADATA,
|
||||
type Controller,
|
||||
isEmptyArray,
|
||||
isEmpty,
|
||||
isFunction,
|
||||
} from '@nestjs/common/internal';
|
||||
import type { NestInterceptor, Type } from '@nestjs/common';
|
||||
@@ -44,7 +44,7 @@ export class InterceptorsContextCreator extends ContextCreator {
|
||||
contextId = STATIC_CONTEXT,
|
||||
inquirerId?: string,
|
||||
): R {
|
||||
if (isEmptyArray(metadata)) {
|
||||
if (isEmpty(metadata)) {
|
||||
return [] as any[] as R;
|
||||
}
|
||||
return iterate(metadata)
|
||||
|
||||
@@ -7,7 +7,7 @@ import { InstanceWrapper } from '../injector/instance-wrapper.js';
|
||||
import {
|
||||
PIPES_METADATA,
|
||||
type Controller,
|
||||
isEmptyArray,
|
||||
isEmpty,
|
||||
isFunction,
|
||||
} from '@nestjs/common/internal';
|
||||
import type { PipeTransform, Type } from '@nestjs/common';
|
||||
@@ -44,7 +44,7 @@ export class PipesContextCreator extends ContextCreator {
|
||||
contextId = STATIC_CONTEXT,
|
||||
inquirerId?: string,
|
||||
): R {
|
||||
if (isEmptyArray(metadata)) {
|
||||
if (isEmpty(metadata)) {
|
||||
return [] as any[] as R;
|
||||
}
|
||||
return iterate(metadata)
|
||||
|
||||
Reference in New Issue
Block a user