making some good progress

This commit is contained in:
Joeri Exelmans 2025-05-11 13:22:12 +02:00
parent 5f3d697866
commit e901fc3f76
15 changed files with 546 additions and 165 deletions

21
src/util/parse.ts Normal file
View file

@ -0,0 +1,21 @@
// Helpers...
export function parseDouble(text: string): number | undefined {
if (text === '') {
return;
}
const num = Number(text);
if (Number.isNaN(num)) {
return;
}
return num;
}
export function parseInt(text: string): bigint | undefined {
if (text === '') {
return;
}
try {
return BigInt(text);
}
catch (e) { };
}