Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@travetto/schema

Package Overview
Dependencies
Maintainers
1
Versions
323
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@travetto/schema

travetto: Schema ===

  • 0.0.22
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
71
decreased by-80.28%
Maintainers
1
Weekly downloads
 
Created
Source

travetto: Schema

This module provide validation for data schemas. The module uses AST transformations to modify classes at runtime, to annotate with types, and whether or not fields are required/optional. Additionally, for constraints that are not immediately discernable, the following are available:

  • Class level

    • @Schema defines a class to be a validated, will auto detect schema from typescript annotations
  • Decorator based definition of Mongoose validators as well as general metadata

    • @Field defines a field that will be serialized (if not using auto @Schema())
    • @Require defines a required field
    • @Enum defines a field with only enumerated values
    • @Trimmed whitespace trims the field
    • @Match allows for regex validation on a field
    • @MinLength enforces min length of a string
    • @MaxLength enforces max length of a string
    • @Min enforces min value for a date or a number
    • @Max enforces max value for a date or a number
    • @Email ensures string field matches basic email regex
    • @Telephone ensures string field matches basic telephone regex
    • @Url ensures string field matches basic url regex
    • @Ignore exclude from auto schema registration

FAQs

Package last updated on 04 Jun 2018

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