mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-05-27 00:55:16 -07:00
feat(macos): configuration window + curl-backed macOS updater (#71)
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
export type OptionalNumberInputParseResult =
|
||||
| {
|
||||
ok: true;
|
||||
value: number | undefined;
|
||||
}
|
||||
| {
|
||||
ok: false;
|
||||
};
|
||||
|
||||
export function parseOptionalNumberInputValue(value: string): OptionalNumberInputParseResult {
|
||||
const raw = value.trim();
|
||||
if (raw.length === 0) {
|
||||
return { ok: true, value: undefined };
|
||||
}
|
||||
const next = Number(raw);
|
||||
if (!Number.isFinite(next)) {
|
||||
return { ok: false };
|
||||
}
|
||||
return { ok: true, value: next };
|
||||
}
|
||||
Reference in New Issue
Block a user