From 5350f36e8a50cdd76e54b4b4c27e82900810ba7c Mon Sep 17 00:00:00 2001 From: Stanislav A Date: Wed, 21 Dec 2022 20:06:15 +0300 Subject: [PATCH] fix parseRawDelay helper --- src/helpers/prevent-utils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; }; /**