schnee effeckt und fehler Korektur
This commit is contained in:
15
node_modules/p-pipe/index.js
generated
vendored
Normal file
15
node_modules/p-pipe/index.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
export default function pPipe(...functions) {
|
||||
if (functions.length === 0) {
|
||||
throw new Error('Expected at least one argument');
|
||||
}
|
||||
|
||||
return async input => {
|
||||
let currentValue = input;
|
||||
|
||||
for (const function_ of functions) {
|
||||
currentValue = await function_(currentValue); // eslint-disable-line no-await-in-loop
|
||||
}
|
||||
|
||||
return currentValue;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user