diff --git a/index.js b/index.js index 084552c..385f04e 100644 --- a/index.js +++ b/index.js @@ -8,8 +8,8 @@ class TimeoutError extends Error { } module.exports = (promise, ms, fallback) => new Promise((resolve, reject) => { - if (!Number.isFinite(ms)) { - throw new TypeError('Expected `ms` to be a finite number'); + if (typeof ms !== 'number') { + throw new TypeError('Expected `ms` to be a number'); } const timer = setTimeout(() => {