Files
svgl/api-routes/src/utils.ts
T
2024-09-27 13:29:46 +01:00

17 lines
413 B
TypeScript

import type { ThemeOptions } from '../../src/types/svg';
const fullUrl = 'https://svgl.app';
export const addFullUrl = (value: string | ThemeOptions): string | ThemeOptions => {
if (typeof value === 'string') {
return `${fullUrl}${value}`;
} else if (typeof value === 'object') {
return {
light: `${fullUrl}${value.light}`,
dark: `${fullUrl}${value.dark}`
};
}
return value;
};