Skip to content

Commit

Permalink
Fix Node.js 12 compatibility
Browse files Browse the repository at this point in the history
Fixes #26
Closes #27
  • Loading branch information
sindresorhus committed Dec 8, 2022
1 parent f58f620 commit a07d684
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ export default function exitHook(onExit) {
});
}

export function asyncExitHook(onExit, options) {
export function asyncExitHook(onExit, options = {}) {
if (typeof onExit !== 'function') {
throw new TypeError('onExit must be a function');
}

if (typeof options?.minimumWait !== 'number' || options.minimumWait <= 0) {
if (!(typeof options.minimumWait === 'number' && options.minimumWait > 0)) {
throw new TypeError('minimumWait must be set to a positive numeric value');
}

Expand Down

0 comments on commit a07d684

Please sign in to comment.