JSPM

koa-yup-error

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q24227F
  • License MIT

Koa middleware to convert yup validation errors into 400 responses.

Package Exports

  • koa-yup-error

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (koa-yup-error) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

koa-yup-error

Intercept yup validation errors and convert them into 400 for koa-error middleware.

Requirements

  • node ^7.6.0

Installation

npm install --save koa koa-error koa-yup-error

Usage

import Koa from 'koa';
import error from 'koa-error';
import yupError from 'koa-yup-error';

// make sure to use after koa-error
const app = new Koa();
app.use(error());
app.use(yupError());

License

MIT