update node_modules

This commit is contained in:
bitkarrot
2022-03-20 22:29:16 -07:00
parent c97bfff58e
commit ff7f8a6ab0
115 changed files with 5651 additions and 2419 deletions

16
node_modules/http-errors/HISTORY.md generated vendored
View File

@@ -1,3 +1,19 @@
2021-11-14 / 1.8.1
==================
* deps: toidentifier@1.0.1
2020-06-29 / 1.8.0
==================
* Add `isHttpError` export to determine if value is an HTTP error
* deps: setprototypeof@1.2.0
2019-06-24 / 1.7.3
==================
* deps: inherits@2.0.4
2019-02-18 / 1.7.2
==================

18
node_modules/http-errors/README.md generated vendored
View File

@@ -3,7 +3,7 @@
[![NPM Version][npm-version-image]][npm-url]
[![NPM Downloads][npm-downloads-image]][node-url]
[![Node.js Version][node-image]][node-url]
[![Build Status][travis-image]][travis-url]
[![Build Status][ci-image]][ci-url]
[![Test Coverage][coveralls-image]][coveralls-url]
Create HTTP errors for Express, Koa, Connect, etc. with ease.
@@ -53,8 +53,6 @@ This is the current API, currently extracted from Koa and subject to change.
Create a new error object with the given message `msg`.
The error object inherits from `createError.HttpError`.
<!-- eslint-disable no-undef, no-unused-vars -->
```js
var err = createError(404, 'This video does not exist!')
```
@@ -70,7 +68,7 @@ properties. This will not alter the inheritance of the given
`error` object, and the modified `error` object is the
return value.
<!-- eslint-disable no-redeclare, no-undef, no-unused-vars -->
<!-- eslint-disable no-redeclare -->
```js
fs.readFile('foo.txt', function (err, buf) {
@@ -88,13 +86,19 @@ fs.readFile('foo.txt', function (err, buf) {
- `error` - the error object to extend
- `properties` - custom properties to attach to the object
### createError.isHttpError(val)
Determine if the provided `val` is an `HttpError`. This will return `true`
if the error inherits from the `HttpError` constructor of this module or
matches the "duck type" for an error this module creates. All outputs from
the `createError` factory will return `true` for this function, including
if an non-`HttpError` was passed into the factory.
### new createError\[code || name\](\[msg]\))
Create a new error object with the given message `msg`.
The error object inherits from `createError.HttpError`.
<!-- eslint-disable no-undef, no-unused-vars -->
```js
var err = new createError.NotFound()
```
@@ -152,6 +156,8 @@ var err = new createError.NotFound()
[MIT](LICENSE)
[ci-image]: https://badgen.net/github/checks/jshttp/http-errors/master?label=ci
[ci-url]: https://github.com/jshttp/http-errors/actions?query=workflow%3Aci
[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/http-errors/master
[coveralls-url]: https://coveralls.io/r/jshttp/http-errors?branch=master
[node-image]: https://badgen.net/npm/node/http-errors

37
node_modules/http-errors/index.js generated vendored
View File

@@ -25,6 +25,7 @@ var toIdentifier = require('toidentifier')
module.exports = createError
module.exports.HttpError = createHttpErrorConstructor()
module.exports.isHttpError = createIsHttpErrorFunction(module.exports.HttpError)
// Populate exports for all constructors
populateConstructorExports(module.exports, statuses.codes, module.exports.HttpError)
@@ -130,7 +131,7 @@ function createHttpErrorConstructor () {
*/
function createClientErrorConstructor (HttpError, name, code) {
var className = name.match(/Error$/) ? name : name + 'Error'
var className = toClassName(name)
function ClientError (message) {
// create the error object
@@ -172,13 +173,34 @@ function createClientErrorConstructor (HttpError, name, code) {
return ClientError
}
/**
* Create function to test is a value is a HttpError.
* @private
*/
function createIsHttpErrorFunction (HttpError) {
return function isHttpError (val) {
if (!val || typeof val !== 'object') {
return false
}
if (val instanceof HttpError) {
return true
}
return val instanceof Error &&
typeof val.expose === 'boolean' &&
typeof val.statusCode === 'number' && val.status === val.statusCode
}
}
/**
* Create a constructor for a server error.
* @private
*/
function createServerErrorConstructor (HttpError, name, code) {
var className = name.match(/Error$/) ? name : name + 'Error'
var className = toClassName(name)
function ServerError (message) {
// create the error object
@@ -264,3 +286,14 @@ function populateConstructorExports (exports, codes, HttpError) {
exports["I'mateapot"] = deprecate.function(exports.ImATeapot,
'"I\'mateapot"; use "ImATeapot" instead')
}
/**
* Get a class name from a name identifier.
* @private
*/
function toClassName (name) {
return name.substr(-5) !== 'Error'
? name + 'Error'
: name
}

View File

@@ -1,7 +1,7 @@
{
"name": "http-errors",
"description": "Create HTTP error objects",
"version": "1.7.2",
"version": "1.8.1",
"author": "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)",
"contributors": [
"Alan Plum <me@pluma.io>",
@@ -11,30 +11,30 @@
"repository": "jshttp/http-errors",
"dependencies": {
"depd": "~1.1.2",
"inherits": "2.0.3",
"setprototypeof": "1.1.1",
"inherits": "2.0.4",
"setprototypeof": "1.2.0",
"statuses": ">= 1.5.0 < 2",
"toidentifier": "1.0.0"
"toidentifier": "1.0.1"
},
"devDependencies": {
"eslint": "5.13.0",
"eslint-config-standard": "12.0.0",
"eslint-plugin-import": "2.16.0",
"eslint-plugin-markdown": "1.0.0",
"eslint-plugin-node": "7.0.1",
"eslint-plugin-promise": "4.0.1",
"eslint-plugin-standard": "4.0.0",
"istanbul": "0.4.5",
"mocha": "5.2.0"
"eslint": "7.32.0",
"eslint-config-standard": "14.1.1",
"eslint-plugin-import": "2.25.3",
"eslint-plugin-markdown": "2.2.1",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "5.1.1",
"eslint-plugin-standard": "4.1.0",
"mocha": "9.1.3",
"nyc": "15.1.0"
},
"engines": {
"node": ">= 0.6"
},
"scripts": {
"lint": "eslint --plugin markdown --ext js,md . && node ./scripts/lint-readme-list.js",
"lint": "eslint . && node ./scripts/lint-readme-list.js",
"test": "mocha --reporter spec --bail",
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot",
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"
"test-ci": "nyc --reporter=lcov --reporter=text npm test",
"test-cov": "nyc --reporter=html --reporter=text npm test"
},
"keywords": [
"http",