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 22, 2022
1 parent 5350f36 commit 72946ad
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 @@ -4,6 +4,7 @@ import {
isValidMatchNumber,
isValidMatchStr,
} from './string-utils';
import { nativeIsNaN } from './number-utils';

/**
* Checks whether the passed arg is proper callback
Expand All @@ -27,7 +28,7 @@ export const isValidCallback = (callback) => {
*/
export const parseRawDelay = (delay) => {
const parsedDelay = Math.floor(Number(delay));
return typeof parsedDelay === 'number' ? parsedDelay : delay;
return typeof parsedDelay === 'number' && nativeIsNaN(parsedDelay) ? parsedDelay : delay;
};

/**
Expand Down

0 comments on commit 72946ad

Please sign in to comment.