Last active
November 16, 2024 20:35
-
-
Save codigoconjuan/60512ccd1998cec9f40fef1e76b3aeb5 to your computer and use it in GitHub Desktop.
Revisar si la página es válida o no
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function isValidPage(value: number) { | |
if (value == null) { | |
return false; | |
} | |
if (typeof value !== 'number' && isNaN(value)) { | |
return false; | |
} | |
if (value <= 0) { | |
return false; | |
} | |
if (!Number.isInteger(value)) { | |
return false; | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment