diff --git a/src/helpers/prevent-utils.js b/src/helpers/prevent-utils.js index 227e6b67..ee662a8d 100644 --- a/src/helpers/prevent-utils.js +++ b/src/helpers/prevent-utils.js @@ -26,7 +26,8 @@ export const isValidCallback = (callback) => { * @returns {any} number as parsed delay or any input type if `delay` is not parsable */ export const parseRawDelay = (delay) => { - return Math.floor(Number(delay)) || delay; + const parsedDelay = Math.floor(Number(delay)); + return typeof parsedDelay === 'number' ? parsedDelay : delay; }; /**