
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@eddaic/nestjs-decorators
Advanced tools
Additional decorators intended for use with NestJS framework.
A variety of decorators, pipes and transformers intended for use with NestJS framework.
Included with each decorator are Swagger ApiProperty definitions to reduce boiler plate in DTOs.
npm install @eddaic/nestjs-decorators
ApiPropertyBigIntApiPropertyBigIntOptionalApiPropertyDateApiPropertyDateOptionalApiPropertyIntApiPropertyIntOptionalIsBigIntParseBigIntPipeSplitStringToBooleanToLowerTransformBigIntTransformIntTrimParseBigIntPipePipe parameters as bigint values. A BadRequestException is thrown if unable to tranform.
import { ParseBigIntPipe } from '@eddaic/nestjs-decorators';
import { Controller, Get, Param } from '@nestjs/common';
@Controller()
export class AppController {
@Get(':id')
async getId(@Param('id', ParseBigIntPipe) id: bigint): bigint {
return id;
}
}
ApiPropertyBigInt, ApiPropertyBigIntOptional, IsBigInt, TransformBigIntValidate bigint values or transform decimal values to bigint through a rounding policy.
import {
ApiPropertyBigInt,
ApiPropertyBigIntOptional,
IsBigInt,
RoundingPolicy,
TransformBigInt,
} from '@eddaic/nestjs-decorators';
import { IsNumber, IsOptional } from 'class-validator';
export class MyDto {
@IsBigInt()
@ApiPropertyBigInt()
id: bigint;
@IsBigInt()
@IsOptional()
@ApiPropertyBigIntOptional()
limit?: bigint;
@IsNumber()
@TransformBigInt({ rounding: RoundingPolicy.CEIL })
@ApiPropertyBigInt()
ceil: bigint;
}
ApiPropertyInt, TransformIntTransform decimal values to integer number values through a rounding policy.
import {
ApiPropertyInt,
RoundingPolicy,
TransformInt,
} from '@eddaic/nestjs-decorators';
import { IsNumber } from 'class-validator';
export class MyDto {
@IsNumber()
@TransformInt({ rounding: RoundingPolicy.FLOOR })
@ApiPropertyInt()
floor: number;
}
import {
ApiPropertyInt,
RoundingPolicy,
TransformInt,
} from '@eddaic/nestjs-decorators';
import { IsNumber } from 'class-validator';
export class MyDto {
@IsNumber({ each: true })
@TransformInt({ each: true, rounding: RoundingPolicy.FLOOR })
@ApiPropertyInt({ isArray: true })
floors: number[];
}
ApiPropertyDate, ApiPropertyDateOptionalimport {
ApiPropertyDate,
ApiPropertyDateOptional,
} from '@eddaic/nestjs-decorators';
import { IsDate, IsOptional } from 'class-validator';
export class MyDto {
@IsDate()
@ApiPropertyDate()
date: date;
@IsDate()
@IsOptional()
@ApiPropertyDateOptional()
optional_date?: date;
}
SplitStringReturns string array using specified separator (defaults to ,). Supporting RegExp also.
import { SplitString } from '@eddaic/nestjs-decorators';
import { ApiProperty } from '@nestjs/swagger';
import { IsString, IsNotEmpty } from 'class-validator';
export class MyDto {
@IsString({ each: true })
@SplitString({ separator: '|' })
@ApiProperty({ isArray: true, type: 'string' })
strings: string[];
}
TransformIntimport { SplitString, TransformInt } from '@eddaic/nestjs-decorators';
import { ApiProperty } from '@nestjs/swagger';
import { IsNumber } from 'class-validator';
export class MyDto {
@IsNumber({ each: true })
@SplitString({ separator: ',' })
@TransformInt({ each: true })
@ApiPropertyInt({ isArray: true })
integers: number[];
}
Trimimport { Trim } from '@eddaic/nestjs-decorators';
import { ApiProperty } from '@nestjs/swagger';
import { IsString, IsNotEmpty } from 'class-validator';
export class MyDto {
@IsString()
@IsNotEmpty()
@Trim()
@ApiProperty()
nonEmptyString: string;
}
FAQs
Additional decorators intended for use with NestJS framework.
The npm package @eddaic/nestjs-decorators receives a total of 51 weekly downloads. As such, @eddaic/nestjs-decorators popularity was classified as not popular.
We found that @eddaic/nestjs-decorators demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.