Skip to content

Instantly share code, notes, and snippets.

@codigoconjuan
Last active November 16, 2024 20:35
Show Gist options
  • Save codigoconjuan/60512ccd1998cec9f40fef1e76b3aeb5 to your computer and use it in GitHub Desktop.
Save codigoconjuan/60512ccd1998cec9f40fef1e76b3aeb5 to your computer and use it in GitHub Desktop.
Revisar si la página es válida o no
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