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

egg-validate-parse

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

egg-validate-parse

validate and parse request

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

egg-validate-parse

Install

$ npm i egg-validate-parse --save

Usage

// {app_root}/config/plugin.js
exports.validateParse = {
  enable: true,
  package: 'egg-validate-parse',
};

see egg-validate for base usage

validate rule

rules.test = {
  id: { type: 'string', required: true, scope: 'params', name: 'innerId' }
}
  • scope means where to fetch the params (body | params | query | queries | state)
  • name means prop name in output object

use in controller

ctx.validateParse(rules.test)

output

output is a object get all parsed params together.

see test for more detail.

Configuration

// {app_root}/config/config.default.js
exports.validateParse = {
  defaultScope: 'body'
};

see config/config.default.js for more detail.

Example

Questions & Suggestions

Please open an issue here.

License

MIT

Keywords

FAQs

Package last updated on 20 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