typia
Version:
Superfast runtime validators with only one line
1 lines • 618 B
Source Map (JSON)
{"version":3,"file":"_httpQueryReadBigint.mjs","names":[],"sources":["../../src/internal/_httpQueryReadBigint.ts"],"sourcesContent":["export const _httpQueryReadBigint = (\n str: string | null,\n): bigint | null | undefined =>\n !!str?.length ? (str === \"null\" ? null : (toBigint(str) as any)) : undefined;\n\nconst toBigint = (str: string): bigint | string => {\n try {\n return BigInt(str);\n } catch {\n return str;\n }\n};\n"],"mappings":";AAAA,MAAa,wBACX,QAEA,CAAC,CAAC,KAAK,SAAU,QAAQ,SAAS,OAAQ,SAAS,GAAG,IAAa,KAAA;AAErE,MAAM,YAAY,QAAiC;CACjD,IAAI;EACF,OAAO,OAAO,GAAG;CACnB,QAAQ;EACN,OAAO;CACT;AACF"}