UNPKG

staticql

Version:

Type-safe query engine for static content including Markdown, YAML, JSON, and more.

46 lines (45 loc) 943 B
/** * Get parent path from path string. * * @param currentPath * @returns */ export declare function toParent(currentPath: string): string; /** * Trim end specific string * * @param * @returns */ export declare function trimSlash(path: string): string; /** * Join all path parts with "/" and remove duplicate slashes. * * @param parts * @returns */ export declare function joinPath(...parts: string[]): string; /** * Create a path for an index file (_index.jsonl) from path parts. * * @param path * @returns */ export declare function toI(...path: string[]): string; /** * Create a path for a prefixes file (_prefixes.jsonl) from path parts. * * @param path * @returns */ export declare function toP(...path: string[]): string; /** * Split the path into base directory and the last segment (tail). * * @param path * @returns */ export declare function tail(path: string): { base: string; tail: string; };