Initialize project and ignore local references
This commit is contained in:
1 parent
a11ac3eaba
commit
2af82b6bb3
132 files changed
+29426
No files matched your search
@@ -0,0 +1,8 @@
|
||||
import type { DesktopResult } from "@shared/contracts";
|
||||
|
||||
export function unwrap<T>(result: DesktopResult<T>): T {
|
||||
if (!result.ok) {
|
||||
throw new Error(result.error.message);
|
||||
}
|
||||
return result.data;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
export function formatMoney(value: number | null | undefined) {
|
||||
if (typeof value !== "number" || Number.isNaN(value)) return "$0.00";
|
||||
return new Intl.NumberFormat("en-US", {
|
||||
style: "currency",
|
||||
currency: "USD",
|
||||
minimumFractionDigits: 2,
|
||||
}).format(value);
|
||||
}
|
||||
|
||||
export function formatTime(value: string | null | undefined) {
|
||||
if (!value) return "Not yet";
|
||||
return new Date(value).toLocaleString();
|
||||
}
|
||||
Reference in new issue
Block a user