/** * A tiny, node-free POSIX `path` — the browser-safe substitute for `node:path` * inside the in-browser audit engine (`scan-core.ts` / `scan-files.ts` / * `test-coverage-files.ts` and the core detectors they reach). A Vite bundle of * that engine must not pull `node:path`, so these are pure string ops. * * The audit engine's file-map keys are always POSIX (`/`-separated), and the * disk-side `scanPlugin` feeds it absolute POSIX roots (`resolve(dir)` on Linux), * so a faithful port of Node's `path.posix` algorithm is byte-identical to * `node:path` for every input the engine passes — which is exactly what the * parity firewall (`scan-files.test.ts`) proves. `resolve` deliberately falls * back to `/` (never `process.cwd()`) so it stays pure and process-free; every * call site passes an absolute first segment, so the fallback is never reached. * * NOTE — the functions below are VERBATIM ports of Node's `lib/path.js` POSIX * implementations (charCode scan, `normalizeString`, `basename`, `relative`). * Their branch depth / cyclomatic complexity is inherent to that battle-tested * algorithm; rewriting it to satisfy the complexity linters would risk a subtle * behavioural divergence from `node:path` (which the disk-vs-browser parity gate * relies on), so the metric rules are disabled for this file only. */ /** POSIX `path.isAbsolute`. */ export declare function isAbsolute(path: string): boolean; /** POSIX `path.normalize`. */ export declare function normalize(path: string): string; /** POSIX `path.join`. */ export declare function join(...parts: string[]): string; /** * POSIX `path.resolve`. Right-to-left until an absolute segment is found, then * normalize. The `i === -1` fallback is `/` (not `process.cwd()`) so this stays * pure; every engine call site passes an absolute first segment. */ export declare function resolve(...parts: string[]): string; /** POSIX `path.dirname`. */ export declare function dirname(path: string): string; /** POSIX `path.basename` (with an optional `suffix` to strip, like `node:path`). */ export declare function basename(path: string, suffix?: string): string; /** POSIX `path.relative`. */ export declare function relative(from: string, to: string): string; //# sourceMappingURL=posix-path.d.ts.map