mirror of
https://github.com/lifegpc/eh-downloader.git
synced 2026-07-08 01:31:00 +08:00
Add new config use_path_based_img_url
Fix parseBitInt
This commit is contained in:
5
utils.ts
5
utils.ts
@@ -300,7 +300,10 @@ export function toJSON(obj: unknown) {
|
||||
export function parseBigInt(str: string) {
|
||||
const t = parseInt(str);
|
||||
if (isNaN(t)) return t;
|
||||
return !Number.isSafeInteger(t) ? BigInt(str) : t;
|
||||
if (Number.isSafeInteger(t)) return t;
|
||||
const m = str.match(/^(\+|-)?\d+/);
|
||||
if (!m) return NaN;
|
||||
return BigInt(m[0]);
|
||||
}
|
||||
|
||||
export function isNumNaN(num: number | bigint) {
|
||||
|
||||
Reference in New Issue
Block a user