updated npm modules
This commit is contained in:
23
node_modules/type-is/HISTORY.md
generated
vendored
23
node_modules/type-is/HISTORY.md
generated
vendored
@@ -1,3 +1,26 @@
|
||||
1.6.18 / 2019-04-26
|
||||
===================
|
||||
|
||||
* Fix regression passing request object to `typeis.is`
|
||||
|
||||
1.6.17 / 2019-04-25
|
||||
===================
|
||||
|
||||
* deps: mime-types@~2.1.24
|
||||
- Add Apple file extensions from IANA
|
||||
- Add extension `.csl` to `application/vnd.citationstyles.style+xml`
|
||||
- Add extension `.es` to `application/ecmascript`
|
||||
- Add extension `.nq` to `application/n-quads`
|
||||
- Add extension `.nt` to `application/n-triples`
|
||||
- Add extension `.owl` to `application/rdf+xml`
|
||||
- Add extensions `.siv` and `.sieve` to `application/sieve`
|
||||
- Add extensions from IANA for `image/*` types
|
||||
- Add extensions from IANA for `model/*` types
|
||||
- Add extensions to HEIC image types
|
||||
- Add new mime types
|
||||
- Add `text/mdx` with extension `.mdx`
|
||||
* perf: prevent internal `throw` on invalid type
|
||||
|
||||
1.6.16 / 2018-02-16
|
||||
===================
|
||||
|
||||
|
||||
96
node_modules/type-is/README.md
generated
vendored
96
node_modules/type-is/README.md
generated
vendored
@@ -1,7 +1,7 @@
|
||||
# type-is
|
||||
|
||||
[![NPM Version][npm-image]][npm-url]
|
||||
[![NPM Downloads][downloads-image]][downloads-url]
|
||||
[![NPM Version][npm-version-image]][npm-url]
|
||||
[![NPM Downloads][npm-downloads-image]][npm-url]
|
||||
[![Node.js Version][node-version-image]][node-version-url]
|
||||
[![Build Status][travis-image]][travis-url]
|
||||
[![Test Coverage][coveralls-image]][coveralls-url]
|
||||
@@ -30,21 +30,39 @@ http.createServer(function (req, res) {
|
||||
})
|
||||
```
|
||||
|
||||
### type = typeis(request, types)
|
||||
### typeis(request, types)
|
||||
|
||||
`request` is the node HTTP request. `types` is an array of types.
|
||||
Checks if the `request` is one of the `types`. If the request has no body,
|
||||
even if there is a `Content-Type` header, then `null` is returned. If the
|
||||
`Content-Type` header is invalid or does not matches any of the `types`, then
|
||||
`false` is returned. Otherwise, a string of the type that matched is returned.
|
||||
|
||||
The `request` argument is expected to be a Node.js HTTP request. The `types`
|
||||
argument is an array of type strings.
|
||||
|
||||
Each type in the `types` array can be one of the following:
|
||||
|
||||
- A file extension name such as `json`. This name will be returned if matched.
|
||||
- A mime type such as `application/json`.
|
||||
- A mime type with a wildcard such as `*/*` or `*/json` or `application/*`.
|
||||
The full mime type will be returned if matched.
|
||||
- A suffix such as `+json`. This can be combined with a wildcard such as
|
||||
`*/vnd+json` or `application/*+json`. The full mime type will be returned
|
||||
if matched.
|
||||
|
||||
Some examples to illustrate the inputs and returned value:
|
||||
|
||||
<!-- eslint-disable no-undef -->
|
||||
|
||||
```js
|
||||
// req.headers.content-type = 'application/json'
|
||||
|
||||
typeis(req, ['json']) // 'json'
|
||||
typeis(req, ['html', 'json']) // 'json'
|
||||
typeis(req, ['application/*']) // 'application/json'
|
||||
typeis(req, ['application/json']) // 'application/json'
|
||||
typeis(req, ['json']) // => 'json'
|
||||
typeis(req, ['html', 'json']) // => 'json'
|
||||
typeis(req, ['application/*']) // => 'application/json'
|
||||
typeis(req, ['application/json']) // => 'application/json'
|
||||
|
||||
typeis(req, ['html']) // false
|
||||
typeis(req, ['html']) // => false
|
||||
```
|
||||
|
||||
### typeis.hasBody(request)
|
||||
@@ -68,34 +86,41 @@ if (typeis.hasBody(req)) {
|
||||
}
|
||||
```
|
||||
|
||||
### type = typeis.is(mediaType, types)
|
||||
### typeis.is(mediaType, types)
|
||||
|
||||
`mediaType` is the [media type](https://tools.ietf.org/html/rfc6838) string. `types` is an array of types.
|
||||
Checks if the `mediaType` is one of the `types`. If the `mediaType` is invalid
|
||||
or does not matches any of the `types`, then `false` is returned. Otherwise, a
|
||||
string of the type that matched is returned.
|
||||
|
||||
The `mediaType` argument is expected to be a
|
||||
[media type](https://tools.ietf.org/html/rfc6838) string. The `types` argument
|
||||
is an array of type strings.
|
||||
|
||||
Each type in the `types` array can be one of the following:
|
||||
|
||||
- A file extension name such as `json`. This name will be returned if matched.
|
||||
- A mime type such as `application/json`.
|
||||
- A mime type with a wildcard such as `*/*` or `*/json` or `application/*`.
|
||||
The full mime type will be returned if matched.
|
||||
- A suffix such as `+json`. This can be combined with a wildcard such as
|
||||
`*/vnd+json` or `application/*+json`. The full mime type will be returned
|
||||
if matched.
|
||||
|
||||
Some examples to illustrate the inputs and returned value:
|
||||
|
||||
<!-- eslint-disable no-undef -->
|
||||
|
||||
```js
|
||||
var mediaType = 'application/json'
|
||||
|
||||
typeis.is(mediaType, ['json']) // 'json'
|
||||
typeis.is(mediaType, ['html', 'json']) // 'json'
|
||||
typeis.is(mediaType, ['application/*']) // 'application/json'
|
||||
typeis.is(mediaType, ['application/json']) // 'application/json'
|
||||
typeis.is(mediaType, ['json']) // => 'json'
|
||||
typeis.is(mediaType, ['html', 'json']) // => 'json'
|
||||
typeis.is(mediaType, ['application/*']) // => 'application/json'
|
||||
typeis.is(mediaType, ['application/json']) // => 'application/json'
|
||||
|
||||
typeis.is(mediaType, ['html']) // false
|
||||
typeis.is(mediaType, ['html']) // => false
|
||||
```
|
||||
|
||||
### Each type can be:
|
||||
|
||||
- An extension name such as `json`. This name will be returned if matched.
|
||||
- A mime type such as `application/json`.
|
||||
- A mime type with a wildcard such as `*/*` or `*/json` or `application/*`. The full mime type will be returned if matched.
|
||||
- A suffix such as `+json`. This can be combined with a wildcard such as `*/vnd+json` or `application/*+json`. The full mime type will be returned if matched.
|
||||
|
||||
`false` will be returned if no type matches or the content type is invalid.
|
||||
|
||||
`null` will be returned if the request does not have a body.
|
||||
|
||||
## Examples
|
||||
|
||||
### Example body parser
|
||||
@@ -134,13 +159,12 @@ app.use(function bodyParser (req, res, next) {
|
||||
|
||||
[MIT](LICENSE)
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/type-is.svg
|
||||
[npm-url]: https://npmjs.org/package/type-is
|
||||
[node-version-image]: https://img.shields.io/node/v/type-is.svg
|
||||
[node-version-url]: https://nodejs.org/en/download/
|
||||
[travis-image]: https://img.shields.io/travis/jshttp/type-is/master.svg
|
||||
[travis-url]: https://travis-ci.org/jshttp/type-is
|
||||
[coveralls-image]: https://img.shields.io/coveralls/jshttp/type-is/master.svg
|
||||
[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/type-is/master
|
||||
[coveralls-url]: https://coveralls.io/r/jshttp/type-is?branch=master
|
||||
[downloads-image]: https://img.shields.io/npm/dm/type-is.svg
|
||||
[downloads-url]: https://npmjs.org/package/type-is
|
||||
[node-version-image]: https://badgen.net/npm/node/type-is
|
||||
[node-version-url]: https://nodejs.org/en/download
|
||||
[npm-downloads-image]: https://badgen.net/npm/dm/type-is
|
||||
[npm-url]: https://npmjs.org/package/type-is
|
||||
[npm-version-image]: https://badgen.net/npm/v/type-is
|
||||
[travis-image]: https://badgen.net/travis/jshttp/type-is/master
|
||||
[travis-url]: https://travis-ci.org/jshttp/type-is
|
||||
|
||||
4
node_modules/type-is/index.js
generated
vendored
4
node_modules/type-is/index.js
generated
vendored
@@ -254,6 +254,10 @@ function normalizeType (value) {
|
||||
*/
|
||||
|
||||
function tryNormalizeType (value) {
|
||||
if (!value) {
|
||||
return null
|
||||
}
|
||||
|
||||
try {
|
||||
return normalizeType(value)
|
||||
} catch (err) {
|
||||
|
||||
44
node_modules/type-is/package.json
generated
vendored
44
node_modules/type-is/package.json
generated
vendored
@@ -1,27 +1,27 @@
|
||||
{
|
||||
"_from": "type-is@~1.6.16",
|
||||
"_id": "type-is@1.6.16",
|
||||
"_from": "type-is@~1.6.18",
|
||||
"_id": "type-is@1.6.18",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==",
|
||||
"_integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
|
||||
"_location": "/type-is",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "type-is@~1.6.16",
|
||||
"raw": "type-is@~1.6.18",
|
||||
"name": "type-is",
|
||||
"escapedName": "type-is",
|
||||
"rawSpec": "~1.6.16",
|
||||
"rawSpec": "~1.6.18",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "~1.6.16"
|
||||
"fetchSpec": "~1.6.18"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/body-parser",
|
||||
"/express"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz",
|
||||
"_shasum": "f89ce341541c672b25ee7ae3c73dee3b2be50194",
|
||||
"_spec": "type-is@~1.6.16",
|
||||
"_resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
|
||||
"_shasum": "4e552cd05df09467dcbc4ef739de89f2cf37c131",
|
||||
"_spec": "type-is@~1.6.18",
|
||||
"_where": "C:\\xampp\\htdocs\\w4rpservices\\node_modules\\express",
|
||||
"bugs": {
|
||||
"url": "https://github.com/jshttp/type-is/issues"
|
||||
@@ -40,20 +40,20 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"media-typer": "0.3.0",
|
||||
"mime-types": "~2.1.18"
|
||||
"mime-types": "~2.1.24"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Infer the content-type of a request.",
|
||||
"devDependencies": {
|
||||
"eslint": "3.19.0",
|
||||
"eslint-config-standard": "10.2.1",
|
||||
"eslint-plugin-import": "2.8.0",
|
||||
"eslint-plugin-markdown": "1.0.0-beta.6",
|
||||
"eslint-plugin-node": "5.2.1",
|
||||
"eslint-plugin-promise": "3.6.0",
|
||||
"eslint-plugin-standard": "3.0.1",
|
||||
"istanbul": "0.4.5",
|
||||
"mocha": "1.21.5"
|
||||
"eslint": "5.16.0",
|
||||
"eslint-config-standard": "12.0.0",
|
||||
"eslint-plugin-import": "2.17.2",
|
||||
"eslint-plugin-markdown": "1.0.0",
|
||||
"eslint-plugin-node": "8.0.1",
|
||||
"eslint-plugin-promise": "4.1.1",
|
||||
"eslint-plugin-standard": "4.0.0",
|
||||
"mocha": "6.1.4",
|
||||
"nyc": "14.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
@@ -78,8 +78,8 @@
|
||||
"scripts": {
|
||||
"lint": "eslint --plugin markdown --ext js,md .",
|
||||
"test": "mocha --reporter spec --check-leaks --bail test/",
|
||||
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
|
||||
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
|
||||
"test-cov": "nyc --reporter=html --reporter=text npm test",
|
||||
"test-travis": "nyc --reporter=text npm test"
|
||||
},
|
||||
"version": "1.6.16"
|
||||
"version": "1.6.18"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user