8 lines
300 B
TypeScript
8 lines
300 B
TypeScript
export const resolveFileUrl = (path: string): string => {
|
|
if (path.startsWith('http://') || path.startsWith('https://') || path.startsWith('blob:') || path.startsWith('data:')) {
|
|
return path;
|
|
}
|
|
const config = useRuntimeConfig();
|
|
return `${config.public.publicUrl}${path}`;
|
|
};
|