Comparing version 8.0.0 to 8.0.1
{ | ||
"name": "celebrate", | ||
"version": "8.0.0", | ||
"version": "8.0.1", | ||
"description": "A joi validation middleware for Express.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
[![celebrate](https://github.com/arb/celebrate/raw/master/images/logo.svg?sanitize=1)](https://www.npmjs.org/package/celebrate) | ||
[![Current Version](https://img.shields.io/npm/v/celebrate.svg)](https://www.npmjs.org/package/celebrate) | ||
[![Build Status](https://travis-ci.org/arb/celebrate.svg?branch=master)](https://travis-ci.org/arb/celebrate) | ||
[![airbnb-style](https://img.shields.io/badge/eslint-airbnb-4B32C3.svg)](https://github.com/airbnb/javascript) | ||
[![Current Version](https://flat.badgen.net/npm/v/celebrate)](https://www.npmjs.org/package/celebrate) | ||
[![Build Status](https://flat.badgen.net/travis/arb/celebrate)](https://travis-ci.org/arb/celebrate) | ||
[![airbnb-style](https://flat.badgen.net/badge/eslint/airbnb/ff5a5f)](https://github.com/airbnb/javascript) | ||
@@ -24,3 +24,3 @@ <table> | ||
`celebrate` is an express middleware function that wraps the [joi](https://github.com/hapijs/joi/tree/v12.0.0) validation library. This allows you to use this middleware in any single route, or globally, and ensure that all of your inputs are correct before any handler function. The middleware allows you to validate `req.params`, `req.headers`, `req.query` and `req.body` (provided you are using `body-parser`). | ||
`celebrate` is an express middleware function that wraps the [joi](https://github.com/hapijs/joi/tree/master) validation library. This allows you to use this middleware in any single route, or globally, and ensure that all of your inputs are correct before any handler function. The middleware allows you to validate `req.params`, `req.headers`, `req.query` and `req.body` (provided you are using `body-parser`). | ||
@@ -90,3 +90,3 @@ `celebrate` lists joi as a formal dependency. This means that celebrate will always use a predictable, known version of joi during the validation and compilation steps. There are two reasons for this: | ||
- `schema` - a object where `key` can be one of `'params'`, `'headers'`, `'query'`, and `'body'` and the `value` is a [joi](https://github.com/hapijs/joi/blob/master/API.md) validation schema. Only the keys specified will be validated against the incoming request object. If you omit a key, that part of the `req` object will not be validated. A schema must contain at least one of the valid keys. | ||
- `[options]` - `joi` [options](https://github.com/hapijs/joi/blob/v12.0.0/API.md#validatevalue-schema-options-callback) that are passed directly into the `validate` function. Defaults to `{ escapeHtml: true }`. | ||
- `[options]` - `joi` [options](https://github.com/hapijs/joi/blob/master/API.md#validatevalue-schema-options-callback) that are passed directly into the `validate` function. Defaults to `{ escapeHtml: true }`. | ||
@@ -97,7 +97,7 @@ ### `errors()` | ||
If the error format does not suite your needs, you are encouraged to write your own error handler and check `isCelebrate(err)` to format celebrate errors to your liking. The full [joi error object](https://github.com/hapijs/joi/blob/v12.0.0/API.md#errors) will be available in your own error handler. | ||
If the error format does not suite your needs, you are encouraged to write your own error handler and check `isCelebrate(err)` to format celebrate errors to your liking. The full [joi error object](https://github.com/hapijs/joi/blob/master/API.md#errors) will be available in your own error handler. | ||
### `Joi` | ||
`celebrate` exports the version of joi it is using internally. For maximum compatibility, you should use this version when passing in any validation schemas. | ||
`celebrate` exports the version of joi it is using internally. For maximum compatibility, you should use this version when creating schemas used with celebrate. | ||
@@ -104,0 +104,0 @@ ### `isCelebrate(err)` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12556