Galerie und tage
This commit is contained in:
152
node_modules/p-pipe/index.d.ts
generated
vendored
152
node_modules/p-pipe/index.d.ts
generated
vendored
@@ -1,152 +0,0 @@
|
||||
declare namespace pPipe {
|
||||
type UnaryFunction<ValueType, ReturnType> = (
|
||||
value: ValueType
|
||||
) => ReturnType | PromiseLike<ReturnType>;
|
||||
|
||||
type Pipeline<ValueType, ReturnType> = (
|
||||
value?: ValueType
|
||||
) => Promise<ReturnType>;
|
||||
}
|
||||
|
||||
/**
|
||||
Compose promise-returning & async functions into a reusable pipeline.
|
||||
|
||||
@param ...input - Iterated over sequentially when returned `function` is called.
|
||||
@returns The `input` functions are applied from left to right.
|
||||
|
||||
@example
|
||||
```
|
||||
import pPipe = require('p-pipe');
|
||||
|
||||
const addUnicorn = async string => `${string} Unicorn`;
|
||||
const addRainbow = async string => `${string} Rainbow`;
|
||||
|
||||
const pipeline = pPipe(addUnicorn, addRainbow);
|
||||
|
||||
(async () => {
|
||||
console.log(await pipeline('❤️'));
|
||||
//=> '❤️ Unicorn Rainbow'
|
||||
})();
|
||||
```
|
||||
*/
|
||||
declare function pPipe<ValueType, ReturnType>(
|
||||
f1: pPipe.UnaryFunction<ValueType, ReturnType>
|
||||
): pPipe.Pipeline<ValueType, ReturnType>;
|
||||
declare function pPipe<ValueType, ResultValue1, ReturnType>(
|
||||
f1: pPipe.UnaryFunction<ValueType, ResultValue1>,
|
||||
f2: pPipe.UnaryFunction<ResultValue1, ReturnType>
|
||||
): pPipe.Pipeline<ValueType, ReturnType>;
|
||||
declare function pPipe<ValueType, ResultValue1, ResultValue2, ReturnType>(
|
||||
f1: pPipe.UnaryFunction<ValueType, ResultValue1>,
|
||||
f2: pPipe.UnaryFunction<ResultValue1, ResultValue2>,
|
||||
f3: pPipe.UnaryFunction<ResultValue2, ReturnType>
|
||||
): pPipe.Pipeline<ValueType, ReturnType>;
|
||||
declare function pPipe<
|
||||
ValueType,
|
||||
ResultValue1,
|
||||
ResultValue2,
|
||||
ResultValue3,
|
||||
ReturnType
|
||||
>(
|
||||
f1: pPipe.UnaryFunction<ValueType, ResultValue1>,
|
||||
f2: pPipe.UnaryFunction<ResultValue1, ResultValue2>,
|
||||
f3: pPipe.UnaryFunction<ResultValue2, ResultValue3>,
|
||||
f4: pPipe.UnaryFunction<ResultValue3, ReturnType>
|
||||
): pPipe.Pipeline<ValueType, ReturnType>;
|
||||
declare function pPipe<
|
||||
ValueType,
|
||||
ResultValue1,
|
||||
ResultValue2,
|
||||
ResultValue3,
|
||||
ResultValue4,
|
||||
ReturnType
|
||||
>(
|
||||
f1: pPipe.UnaryFunction<ValueType, ResultValue1>,
|
||||
f2: pPipe.UnaryFunction<ResultValue1, ResultValue2>,
|
||||
f3: pPipe.UnaryFunction<ResultValue2, ResultValue3>,
|
||||
f4: pPipe.UnaryFunction<ResultValue3, ResultValue4>,
|
||||
f5: pPipe.UnaryFunction<ResultValue4, ReturnType>
|
||||
): pPipe.Pipeline<ValueType, ReturnType>;
|
||||
declare function pPipe<
|
||||
ValueType,
|
||||
ResultValue1,
|
||||
ResultValue2,
|
||||
ResultValue3,
|
||||
ResultValue4,
|
||||
ResultValue5,
|
||||
ReturnType
|
||||
>(
|
||||
f1: pPipe.UnaryFunction<ValueType, ResultValue1>,
|
||||
f2: pPipe.UnaryFunction<ResultValue1, ResultValue2>,
|
||||
f3: pPipe.UnaryFunction<ResultValue2, ResultValue3>,
|
||||
f4: pPipe.UnaryFunction<ResultValue3, ResultValue4>,
|
||||
f5: pPipe.UnaryFunction<ResultValue4, ResultValue5>,
|
||||
f6: pPipe.UnaryFunction<ResultValue5, ReturnType>
|
||||
): pPipe.Pipeline<ValueType, ReturnType>;
|
||||
declare function pPipe<
|
||||
ValueType,
|
||||
ResultValue1,
|
||||
ResultValue2,
|
||||
ResultValue3,
|
||||
ResultValue4,
|
||||
ResultValue5,
|
||||
ResultValue6,
|
||||
ReturnType
|
||||
>(
|
||||
f1: pPipe.UnaryFunction<ValueType, ResultValue1>,
|
||||
f2: pPipe.UnaryFunction<ResultValue1, ResultValue2>,
|
||||
f3: pPipe.UnaryFunction<ResultValue2, ResultValue3>,
|
||||
f4: pPipe.UnaryFunction<ResultValue3, ResultValue4>,
|
||||
f5: pPipe.UnaryFunction<ResultValue4, ResultValue5>,
|
||||
f6: pPipe.UnaryFunction<ResultValue5, ResultValue6>,
|
||||
f7: pPipe.UnaryFunction<ResultValue6, ReturnType>
|
||||
): pPipe.Pipeline<ValueType, ReturnType>;
|
||||
declare function pPipe<
|
||||
ValueType,
|
||||
ResultValue1,
|
||||
ResultValue2,
|
||||
ResultValue3,
|
||||
ResultValue4,
|
||||
ResultValue5,
|
||||
ResultValue6,
|
||||
ResultValue7,
|
||||
ReturnType
|
||||
>(
|
||||
f1: pPipe.UnaryFunction<ValueType, ResultValue1>,
|
||||
f2: pPipe.UnaryFunction<ResultValue1, ResultValue2>,
|
||||
f3: pPipe.UnaryFunction<ResultValue2, ResultValue3>,
|
||||
f4: pPipe.UnaryFunction<ResultValue3, ResultValue4>,
|
||||
f5: pPipe.UnaryFunction<ResultValue4, ResultValue5>,
|
||||
f6: pPipe.UnaryFunction<ResultValue5, ResultValue6>,
|
||||
f7: pPipe.UnaryFunction<ResultValue6, ResultValue7>,
|
||||
f8: pPipe.UnaryFunction<ResultValue7, ReturnType>
|
||||
): pPipe.Pipeline<ValueType, ReturnType>;
|
||||
declare function pPipe<
|
||||
ValueType,
|
||||
ResultValue1,
|
||||
ResultValue2,
|
||||
ResultValue3,
|
||||
ResultValue4,
|
||||
ResultValue5,
|
||||
ResultValue6,
|
||||
ResultValue7,
|
||||
ResultValue8,
|
||||
ReturnType
|
||||
>(
|
||||
f1: pPipe.UnaryFunction<ValueType, ResultValue1>,
|
||||
f2: pPipe.UnaryFunction<ResultValue1, ResultValue2>,
|
||||
f3: pPipe.UnaryFunction<ResultValue2, ResultValue3>,
|
||||
f4: pPipe.UnaryFunction<ResultValue3, ResultValue4>,
|
||||
f5: pPipe.UnaryFunction<ResultValue4, ResultValue5>,
|
||||
f6: pPipe.UnaryFunction<ResultValue5, ResultValue6>,
|
||||
f7: pPipe.UnaryFunction<ResultValue6, ResultValue7>,
|
||||
f8: pPipe.UnaryFunction<ResultValue7, ResultValue8>,
|
||||
f9: pPipe.UnaryFunction<ResultValue8, ReturnType>
|
||||
): pPipe.Pipeline<ValueType, ReturnType>;
|
||||
|
||||
// Fallbacks if more than 9 functions are passed as input (not type-safe).
|
||||
declare function pPipe(
|
||||
...functions: (pPipe.UnaryFunction<any, unknown>)[]
|
||||
): pPipe.Pipeline<unknown, unknown>;
|
||||
|
||||
export = pPipe;
|
||||
17
node_modules/p-pipe/index.js
generated
vendored
17
node_modules/p-pipe/index.js
generated
vendored
@@ -1,17 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = (...functions) => {
|
||||
if (functions.length === 0) {
|
||||
throw new Error('Expected at least one argument');
|
||||
}
|
||||
|
||||
return async input => {
|
||||
let currentValue = input;
|
||||
|
||||
for (const fn of functions) {
|
||||
currentValue = await fn(currentValue); // eslint-disable-line no-await-in-loop
|
||||
}
|
||||
|
||||
return currentValue;
|
||||
};
|
||||
};
|
||||
9
node_modules/p-pipe/license
generated
vendored
9
node_modules/p-pipe/license
generated
vendored
@@ -1,9 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
45
node_modules/p-pipe/package.json
generated
vendored
45
node_modules/p-pipe/package.json
generated
vendored
@@ -1,45 +0,0 @@
|
||||
{
|
||||
"name": "p-pipe",
|
||||
"version": "3.1.0",
|
||||
"description": "Compose promise-returning & async functions into a reusable pipeline",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/p-pipe",
|
||||
"funding": "https://github.com/sponsors/sindresorhus",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "https://sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"promise",
|
||||
"pipe",
|
||||
"pipeline",
|
||||
"compose",
|
||||
"composition",
|
||||
"combine",
|
||||
"flow",
|
||||
"serial",
|
||||
"functions",
|
||||
"reusable",
|
||||
"async",
|
||||
"await",
|
||||
"promises",
|
||||
"bluebird"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "^1.4.1",
|
||||
"sinon": "^7.3.1",
|
||||
"tsd": "^0.7.2",
|
||||
"xo": "^0.24.0"
|
||||
}
|
||||
}
|
||||
56
node_modules/p-pipe/readme.md
generated
vendored
56
node_modules/p-pipe/readme.md
generated
vendored
@@ -1,56 +0,0 @@
|
||||
# p-pipe [](https://travis-ci.com/sindresorhus/p-pipe)
|
||||
|
||||
> Compose promise-returning & async functions into a reusable pipeline
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install p-pipe
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const pPipe = require('p-pipe');
|
||||
|
||||
const addUnicorn = async string => `${string} Unicorn`;
|
||||
const addRainbow = async string => `${string} Rainbow`;
|
||||
|
||||
const pipeline = pPipe(addUnicorn, addRainbow);
|
||||
|
||||
(async () => {
|
||||
console.log(await pipeline('❤️'));
|
||||
//=> '❤️ Unicorn Rainbow'
|
||||
})();
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### pPipe(input…)
|
||||
|
||||
The `input` functions are applied from left to right.
|
||||
|
||||
#### input
|
||||
|
||||
Type: `Function`
|
||||
|
||||
Expected to return a `Promise` or any value.
|
||||
|
||||
## Related
|
||||
|
||||
- [p-each-series](https://github.com/sindresorhus/p-each-series) - Iterate over promises serially
|
||||
- [p-series](https://github.com/sindresorhus/p-series) - Run promise-returning & async functions in series
|
||||
- [p-waterfall](https://github.com/sindresorhus/p-waterfall) - Run promise-returning & async functions in series, each passing its result to the next
|
||||
- [More…](https://github.com/sindresorhus/promise-fun)
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-p-pipe?utm_source=npm-p-pipe&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
||||
Reference in New Issue
Block a user