astro-loader-i18n
Version:
An Astro content loader for i18n files and folder structures.
18 lines (17 loc) • 1.07 kB
TypeScript
export declare function joinPath(...paths: Array<string | number | undefined>): string;
/**
* Resolves and joins multiple path segments into a single normalized path.
*
* This function trims leading and trailing slashes from string path segments
* and ensures the resulting path starts with a single forward slash (`/`).
* Non-string segments (e.g., numbers or `undefined`) are included as-is.
*
* @param paths - An array of path segments which can be strings, numbers, or `undefined`.
* @returns A normalized path string starting with a forward slash.
*/
export declare function resolvePath(...paths: Array<string | number | undefined>): string;
export declare const trimSlashes: (path: string) => string;
export declare const trimRelativePath: (path: string) => string;
export declare const parseLocale: (path: string, locales: string[], defaultLocale: string) => string;
export declare const createTranslationId: (path: string, locale?: string) => string;
export declare const createContentPath: (path: string, base?: string | URL, locale?: string) => string;