Skip to content

Commit

Permalink
fix parseRawDelay helper
Browse files Browse the repository at this point in the history
  • Loading branch information
stanislav-atr committed Dec 21, 2022
1 parent 369c327 commit 5350f36
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/helpers/prevent-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

/**
Expand Down

0 comments on commit 5350f36

Please sign in to comment.