docs:更新文档

This commit is contained in:
张益铭
2021-03-01 15:06:11 +08:00
parent 1542135ab0
commit 9064b372e8
5835 changed files with 904126 additions and 161722 deletions

60
node_modules/koa-compose/History.md generated vendored Normal file
View File

@@ -0,0 +1,60 @@
4.1.0 / 2018-05-22
==================
* improve: reduce stack trace by removing useless function call (#95)
4.0.0 / 2017-04-12
==================
* remove `any-promise` as a dependency
3.2.1 / 2016-10-26
==================
* revert add variadric support #65 - introduced an unintended breaking change
3.2.0 / 2016-10-25
==================
* fix #60 infinite loop when calling next https://github.com/koajs/compose/pull/61
* add variadric support https://github.com/koajs/compose/pull/65
3.1.0 / 2016-03-17
==================
* add linting w/ standard
* use `any-promise` so that the promise engine is configurable
3.0.0 / 2015-10-19
==================
* change middleware signature to `async (ctx, next) => await next()` for `koa@2`.
See https://github.com/koajs/compose/pull/27 for more information.
2.3.0 / 2014-05-01
==================
* remove instrumentation
2.2.0 / 2014-01-22
==================
* add `fn._name` for debugging
2.1.0 / 2013-12-22
==================
* add debugging support
* improve performance ~15%
2.0.1 / 2013-12-21
==================
* update co to v3
* use generator delegation
2.0.0 / 2013-11-07
==================
* change middleware signature expected

40
node_modules/koa-compose/Readme.md generated vendored Normal file
View File

@@ -0,0 +1,40 @@
# koa-compose
[![NPM version][npm-image]][npm-url]
[![Build status][travis-image]][travis-url]
[![Test coverage][codecov-image]][codecov-url]
[![Dependency Status][david-image]][david-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
Compose middleware.
## Installation
```js
$ npm install koa-compose
```
## API
### compose([a, b, c, ...])
Compose the given middleware and return middleware.
## License
MIT
[npm-image]: https://img.shields.io/npm/v/koa-compose.svg?style=flat-square
[npm-url]: https://npmjs.org/package/koa-compose
[travis-image]: https://img.shields.io/travis/koajs/compose/next.svg?style=flat-square
[travis-url]: https://travis-ci.org/koajs/compose
[codecov-image]: https://img.shields.io/codecov/c/github/koajs/compose/next.svg?style=flat-square
[codecov-url]: https://codecov.io/github/koajs/compose
[david-image]: http://img.shields.io/david/koajs/compose.svg?style=flat-square
[david-url]: https://david-dm.org/koajs/compose
[license-image]: http://img.shields.io/npm/l/koa-compose.svg?style=flat-square
[license-url]: LICENSE
[downloads-image]: http://img.shields.io/npm/dm/koa-compose.svg?style=flat-square
[downloads-url]: https://npmjs.org/package/koa-compose

48
node_modules/koa-compose/index.js generated vendored Normal file
View File

@@ -0,0 +1,48 @@
'use strict'
/**
* Expose compositor.
*/
module.exports = compose
/**
* Compose `middleware` returning
* a fully valid middleware comprised
* of all those which are passed.
*
* @param {Array} middleware
* @return {Function}
* @api public
*/
function compose (middleware) {
if (!Array.isArray(middleware)) throw new TypeError('Middleware stack must be an array!')
for (const fn of middleware) {
if (typeof fn !== 'function') throw new TypeError('Middleware must be composed of functions!')
}
/**
* @param {Object} context
* @return {Promise}
* @api public
*/
return function (context, next) {
// last called middleware #
let index = -1
return dispatch(0)
function dispatch (i) {
if (i <= index) return Promise.reject(new Error('next() called multiple times'))
index = i
let fn = middleware[i]
if (i === middleware.length) fn = next
if (!fn) return Promise.resolve()
try {
return Promise.resolve(fn(context, dispatch.bind(null, i + 1)));
} catch (err) {
return Promise.reject(err)
}
}
}
}

66
node_modules/koa-compose/package.json generated vendored Normal file
View File

@@ -0,0 +1,66 @@
{
"_args": [
[
"koa-compose@4.1.0",
"J:\\Github\\CURD-TS"
]
],
"_development": true,
"_from": "koa-compose@4.1.0",
"_id": "koa-compose@4.1.0",
"_inBundle": false,
"_integrity": "sha1-UHMGuTcZAdtBEhyBLpI9DWfT6Hc=",
"_location": "/koa-compose",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "koa-compose@4.1.0",
"name": "koa-compose",
"escapedName": "koa-compose",
"rawSpec": "4.1.0",
"saveSpec": null,
"fetchSpec": "4.1.0"
},
"_requiredBy": [
"/koa"
],
"_resolved": "http://192.168.250.101:4873/koa-compose/-/koa-compose-4.1.0.tgz",
"_spec": "4.1.0",
"_where": "J:\\Github\\CURD-TS",
"bugs": {
"url": "https://github.com/koajs/compose/issues"
},
"dependencies": {},
"description": "compose Koa middleware",
"devDependencies": {
"codecov": "^3.0.0",
"jest": "^21.0.0",
"matcha": "^0.7.0",
"standard": "^10.0.3"
},
"files": [
"index.js"
],
"homepage": "https://github.com/koajs/compose#readme",
"jest": {
"testEnvironment": "node"
},
"keywords": [
"koa",
"middleware",
"compose"
],
"license": "MIT",
"name": "koa-compose",
"repository": {
"type": "git",
"url": "git+https://github.com/koajs/compose.git"
},
"scripts": {
"bench": "matcha bench/bench.js",
"lint": "standard --fix .",
"test": "jest --forceExit --coverage"
},
"version": "4.1.0"
}