-
-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
language: node_js | ||
node_js: | ||
- '14' | ||
- '12' | ||
- '10' | ||
- '8' | ||
- '6' |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,14 +17,19 @@ const pLimit = concurrency => { | |
} | ||
}; | ||
|
||
const run = (fn, resolve, ...args) => { | ||
const run = async (fn, resolve, ...args) => { | ||
activeCount++; | ||
|
||
// TODO: Get rid of `pTry`. It's not needed anymore. | ||
const result = pTry(fn, ...args); | ||
|
||
resolve(result); | ||
|
||
result.then(next, next); | ||
try { | ||
await result; | ||
} catch {} | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ajrsws
|
||
|
||
next(); | ||
}; | ||
|
||
const enqueue = (fn, resolve, ...args) => { | ||
|
@@ -62,4 +67,3 @@ const pLimit = concurrency => { | |
}; | ||
|
||
module.exports = pLimit; | ||
module.exports.default = pLimit; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
MIT License | ||
|
||
Copyright (c) Sindre Sorhus <[email protected]> (sindresorhus.com) | ||
Copyright (c) Sindre Sorhus <[email protected]> (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: | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,13 +8,13 @@ | |
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "[email protected]", | ||
"url": "sindresorhus.com" | ||
"url": "https://sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=6" | ||
"node": ">=10" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava && tsd-check" | ||
"test": "xo && ava && tsd" | ||
}, | ||
"files": [ | ||
"index.js", | ||
|
@@ -41,12 +41,12 @@ | |
"p-try": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "^1.2.1", | ||
"ava": "^2.4.0", | ||
"delay": "^4.1.0", | ||
"in-range": "^1.0.0", | ||
"random-int": "^1.0.0", | ||
"time-span": "^2.0.0", | ||
"tsd-check": "^0.3.0", | ||
"xo": "^0.24.0" | ||
"in-range": "^2.0.0", | ||
"random-int": "^2.0.1", | ||
"time-span": "^4.0.0", | ||
"tsd": "^0.11.0", | ||
"xo": "^0.26.0" | ||
} | ||
} |
so this is now producing a syntax error in any library using p-limit.
SyntaxError: Unexpected token {
the correct syntax should be
catch(err) {}