2022-10-10 12:50:21 +00:00
|
|
|
export function safeRun(fn: () => Promise<void>) {
|
|
|
|
fn().catch((e: any) => {
|
|
|
|
console.error("Caught error", e.message);
|
|
|
|
|
|
|
|
// throw e;
|
|
|
|
});
|
|
|
|
}
|
2023-01-01 19:28:25 +00:00
|
|
|
|
|
|
|
export function urlToPathname(url: URL) {
|
|
|
|
// For Windows, remove prefix /
|
|
|
|
return url.pathname.replace(/^\/(\w:)/, "$1");
|
2023-01-22 17:53:14 +00:00
|
|
|
}
|