Skip to content

Commit af02a3d

Browse files
author
Alexander Early
committed
work around compiler quirk
1 parent 3c7a711 commit af02a3d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/internal/awaitify.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// conditionally promisify a function.
22
// only return a promise if a callback is omitted
3-
export default function awaitify (asyncFn, arity = asyncFn.length) {
3+
export default function awaitify (asyncFn, arity) {
4+
if (!arity) arity = asyncFn.length;
45
if (!arity) throw new Error('arity is undefined')
56
function awaitable (...args) {
67
if (typeof args[arity - 1] === 'function') {

0 commit comments

Comments
 (0)