@daiso-tech/core
Version:
The library offers flexible, framework-agnostic solutions for modern web applications, built on adaptable components that integrate seamlessly with popular frameworks like Next Js.
19 lines • 446 B
JavaScript
/**
* @module Utilities
*/
/**
*
* @internal
*/
export function isPositiveNbr(nbr, fieldName = "Number") {
if (nbr < 1) {
throw new TypeError(`${fieldName} must be larger than 0`);
}
if (Number.isNaN(nbr)) {
throw new TypeError(`${fieldName} cannot be NaN`);
}
if (!Number.isFinite(nbr)) {
throw new TypeError(`${fieldName} cannot be infinite`);
}
}
//# sourceMappingURL=is-positive-nbr.js.map