New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@regionaalenergieloket/nest-class-validator-decorator

Package Overview
Dependencies
Maintainers
7
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@regionaalenergieloket/nest-class-validator-decorator

Forked from https://github.com/Bholtland/nest-class-validator-decorator/

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
7
Created
Source

nest-class-validator-decorator

A custom decorator that uses the class-transformer and class-validator npm packages under the hood to deserialize method response data and validate it according to a supplied "class-validator" class.

Getting started

Add the decorator as a dependency to your project npm install -S nest-class-validator-decorator or yarn add -S nest class-validator-decorator.

You can now import the decorator into your code like so:

import {ValidateResponse} from "nest-class-validator-decorator"

...

@ValidateResponse(YourSchema)
public yourMethod() {
    // Your logic...
}

Any JSON returned from "yourMethod" will now be validated according to "YourSchema".

Options

As a secondary param you can add an "options" object containing ValidatorOptions from "class-validator".

FAQs

Package last updated on 29 Jan 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc