p-event
Advanced tools
Comparing version 2.3.0 to 2.3.1
10
index.js
@@ -131,9 +131,5 @@ 'use strict'; | ||
const {limit} = options; | ||
if ( | ||
!( | ||
limit >= 0 && | ||
(limit === Infinity || Number.isInteger(limit)) | ||
) | ||
) { | ||
return Promise.reject(new TypeError('The `limit` option should be a non-negative integer or Infinity')); | ||
const isValidLimit = limit >= 0 && (limit === Infinity || Number.isInteger(limit)); | ||
if (!isValidLimit) { | ||
throw new TypeError('The `limit` option should be a non-negative integer or Infinity'); | ||
} | ||
@@ -140,0 +136,0 @@ |
{ | ||
"name": "p-event", | ||
"version": "2.3.0", | ||
"version": "2.3.1", | ||
"description": "Promisify an event by waiting for it to be emitted", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
15463
210