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

@join-com/class-validator-ismoney

Package Overview
Dependencies
Maintainers
14
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@join-com/class-validator-ismoney

@IsMoney decorator for class-validator

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
14
Weekly downloads
 
Created
Source

IsMoney validator for class-validator

Custom validator for class-validator

It validates correctness of money type. Money type is represented as:

interface IMoney {
  currency: string;
  amount: number;
}

Installation

npm install @join-com/class-validator-ismoney --save

Usage

You can use the validator as any other class-validator:

class GuineaPig {
  @IsMoney({ max: 1200 })
  public price: any;
}

class CustomGuineaPig {
  @IsMoney({
    allowNegative: true,
    min: -1100,
    currencies: ['EUR', 'USD', 'CHF'],
  })
  public price: any;
}

class DefaultGuineaPig {
  @IsMoney()
  public price: any;
}

Keywords

FAQs

Package last updated on 20 Apr 2021

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