MultiLoader-Template/node_modules/es-toolkit/dist/compat/util/toSafeInteger.d.ts
3944Realms 768f38fc97 feat: 可使用的构建模板
修改了脚本,使其可以推给Maven仓库
2026-05-03 13:02:19 +08:00

21 lines
612 B
TypeScript

/**
* Converts `value` to a safe integer.
*
* A safe integer can be compared and represented correctly.
*
* @param {any} value - The value to convert.
* @returns {number} Returns the value converted to a safe integer.
*
* @example
* toSafeInteger(3.2); // => 3
* toSafeInteger(Number.MAX_VALUE); // => 9007199254740991
* toSafeInteger(Infinity); // => 9007199254740991
* toSafeInteger('3.2'); // => 3
* toSafeInteger(NaN); // => 0
* toSafeInteger(null); // => 0
* toSafeInteger(-Infinity); // => -9007199254740991
*/
declare function toSafeInteger(value: any): number;
export { toSafeInteger };