mirror of
https://github.com/AIsouler/GKD_subscription.git
synced 2025-12-20 00:35:17 +08:00
8 lines
149 B
TypeScript
8 lines
149 B
TypeScript
export const tryRun = <T>(fc: () => T, fallbackFc: (e: unknown) => T) => {
|
|
try {
|
|
return fc();
|
|
} catch (e) {
|
|
return fallbackFc(e);
|
|
}
|
|
};
|