rich-domain
Version:
This package provide utils file and interfaces to assistant build a complex application with domain driving design
25 lines • 792 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.IsNaN = void 0;
/**
* @description Checks if the provided value is `NaN` (Not-a-Number). The function attempts to parse the value into a number
* and determines if the result is `NaN`.
*
* @param value The value to check. Can be a string or a number.
*
* @returns `true` if the value is `NaN`, otherwise `false`.
*
* @example
* ```typescript
* IsNaN("123"); // Returns false (valid number)
* IsNaN("abc"); // Returns true (not a number)
* IsNaN(NaN); // Returns true
* IsNaN(123); // Returns false (valid number)
* ```
*/
const IsNaN = (value) => {
return isNaN(parseFloat(String(value)));
};
exports.IsNaN = IsNaN;
exports.default = exports.IsNaN;
//# sourceMappingURL=is-nan.util.js.map