* feat(client): add function alias support * feat(client): auto config from env vars * fix(client): username in aliased url * feat: nextjs proxy handler * fix: update client tests * feat(client): built-in queue support * feat: client + nextjs e2e demo * chore: update browserslist * chore: update version info * chore: update readme badges * fix: ignore lint error on require
18 lines
361 B
TypeScript
18 lines
361 B
TypeScript
export function isUUIDv4(id: string): boolean {
|
|
return (
|
|
typeof id === 'string' &&
|
|
id.length === 36 &&
|
|
id[14] === '4' &&
|
|
['8', '9', 'a', 'b'].includes(id[19])
|
|
);
|
|
}
|
|
|
|
export function isValidUrl(url: string) {
|
|
try {
|
|
const parsedUrl = new URL(url);
|
|
return parsedUrl.hostname.endsWith('fal.ai');
|
|
} catch (_) {
|
|
return false;
|
|
}
|
|
}
|