@rzl-zone/utils-js
Version:
A modern, lightweight set of JavaScript utility functions with TypeScript support for everyday development, crafted to enhance code readability and maintainability.
33 lines (29 loc) • 936 B
JavaScript
/*!
* ====================================================
* Rzl Utils-JS.
* ----------------------------------------------------
* Version: 3.11.0.
* Author: Rizalvin Dwiky.
* Repository: https://github.com/rzl-zone/utils-js.
* ====================================================
*/
import { isBigInt } from './chunk-QNKGP5DY.js';
import { resolveErrorMessageAssertions, hasOwnProp, isNumber } from './chunk-MSUW5VHZ.js';
var assertIsBigInt = (value, options = {}) => {
if (isBigInt(value)) return;
resolveErrorMessageAssertions({
value,
options,
requiredValidType: "bigint"
});
};
var assertIsNumber = (value, options = {}) => {
const includeNaN = hasOwnProp(options, "includeNaN") ? options.includeNaN : void 0;
if (isNumber(value, { includeNaN })) return;
resolveErrorMessageAssertions({
value,
options,
requiredValidType: "number"
});
};
export { assertIsBigInt, assertIsNumber };