
Research
/Security News
Shai Hulud Strikes Again (v2)
Another wave of Shai-Hulud campaign has hit npm with more than 500 packages and 700+ versions affected.
@betsys-nestjs/decorators
Advanced tools
This library is a collection of various decorators using class-validator.
@betsys-nestjs/decoratorsThis is a simple library containing decorators helping you to validate types of properites
| Package | Version |
|---|---|
| @nestjs/common | ^10.0.0 |
| class-validator | ^0.13.2 |
The basic usage is similar to the class-validator. Use decorators in your DTOs or commands.
An example of usage - imagine a DTO as following:
export class SomeNiceDto {
booleanProperty!: boolean;
intProperty!: number;
};
Which you want to use in the following controller while it is automatically converted from the request:
import { Body, Controller, Post, Req } from '@nestjs/common';
import { Request } from 'express';
@Controller()
export class SomeController {
@Post('/some-url')
saveKittens(@Req() request: Request, @Body() body: SomeNiceDto) {
...
}
}
For the DTO you want to be sure, that booleanProperty is of type boolan
as well as that intProperty is really an integer.
You can easily enforce that by using the decorators from this lib:
import { IsFieldBoolean, IsFieldInteger, Language } from '@betsys-nestjs/decorators';
export class SomeNiceDto {
@IsFieldBoolean('booleanProperty', Language.PL)
booleanProperty!: boolean;
@IsFieldInteger('intProperty', Language.EN)
intProperty!: number;
};
The language settings concern the error message. If you do not provide any language, English is returned.
FAQs
This library is a collection of various decorators using class-validator.
The npm package @betsys-nestjs/decorators receives a total of 4 weekly downloads. As such, @betsys-nestjs/decorators popularity was classified as not popular.
We found that @betsys-nestjs/decorators demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 open source maintainers 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.

Research
/Security News
Another wave of Shai-Hulud campaign has hit npm with more than 500 packages and 700+ versions affected.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.