Files
NapCatQQ/.pnpm-store/v3/files/b8/72832aea05fa9efef8958a002d969e54f0f859e0b829e4351513a00176322df82a4d8003e704b283afb123f6daf2106efc6edec50377c768a86181ed47624a
T
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

28 lines
656 B
Plaintext

import Decimal from 'decimal.js';
import { ToPrimitive } from './262';
export function ToIntlMathematicalValue(input) {
var primValue = ToPrimitive(input, 'number');
if (typeof primValue === 'bigint') {
return new Decimal(primValue);
}
// IMPL
if (primValue === undefined) {
return new Decimal(NaN);
}
if (primValue === true) {
return new Decimal(1);
}
if (primValue === false) {
return new Decimal(0);
}
if (primValue === null) {
return new Decimal(0);
}
try {
return new Decimal(primValue);
}
catch (e) {
return new Decimal(NaN);
}
}