Skip to content

Commit

Permalink
work around compiler quirk
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Early committed Nov 3, 2023
1 parent 3c7a711 commit af02a3d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/internal/awaitify.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// conditionally promisify a function.
// only return a promise if a callback is omitted
export default function awaitify (asyncFn, arity = asyncFn.length) {
export default function awaitify (asyncFn, arity) {
if (!arity) arity = asyncFn.length;
if (!arity) throw new Error('arity is undefined')
function awaitable (...args) {
if (typeof args[arity - 1] === 'function') {
Expand Down

0 comments on commit af02a3d

Please sign in to comment.