Fix value check logic for ms arg

Failing test as seen in:

https://runkit.com/neeksandhu/5a10bc3c761dce00128e5a33
This commit is contained in:
Neek Sandhu 2017-11-18 15:11:18 -08:00 committed by GitHub
parent 339b0ac5db
commit da0c0ab6f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -9,7 +9,7 @@ class TimeoutError extends Error {
}
module.exports = (promise, ms, fallback) => new Promise((resolve, reject) => {
if (typeof ms !== 'number' && ms >= 0) {
if (typeof ms !== 'number' || ms < 0) {
throw new TypeError('Expected `ms` to be a positive number');
}