mirror of
https://github.com/truewhile/MeBox.git
synced 2026-09-29 03:26:37 +08:00
8 lines
266 B
TypeScript
8 lines
266 B
TypeScript
export function apiErrorMessage(err: unknown, fallback: string): string {
|
|
return (err as { response?: { data?: { error?: string } } })?.response?.data?.error ?? fallback
|
|
}
|
|
|
|
export function isHTTPURL(value: string): boolean {
|
|
return /^https?:\/\//i.test(value)
|
|
}
|