@lifaon/path
Version:
Useful tool to manage paths like the URL object
9 lines (8 loc) • 417 B
TypeScript
import type { IPathSegments } from '../../../../types/segments/path-segments.type.js';
/**
* Extracts the common base from many `IPathSegments`:
* - if no common base, returns `[]`
* - if common base is _absolute_, returns `['', ...]`
* - if common base is _relative_, returns `['..' | '.', ...]`
*/
export declare function getCommonBaseOfManyPathSegments(paths: readonly IPathSegments[]): IPathSegments | null;