MCPcopy Index your code
hub / github.com/QwikDev/qwik / simplifyPath

Function simplifyPath

packages/qwik/src/server/preload-impl.ts:8–22  ·  view source on GitHub ↗
(base: string, path: string | null | undefined)

Source from the content-addressed store, hash-verified

6import { getPreloadPaths } from './preload-strategy';
7
8const simplifyPath = (base: string, path: string | null | undefined) => {
9 if (path == null) {
10 return null;
11 }
12 const segments = `${base}${path}`.split('/');
13 const simplified = [];
14 for (const segment of segments) {
15 if (segment === '..' && simplified.length > 0) {
16 simplified.pop();
17 } else {
18 simplified.push(segment);
19 }
20 }
21 return simplified.join('/');
22};
23
24export const preloaderPre = (
25 base: string,

Callers 2

preloaderPreFunction · 0.85
includePreloaderFunction · 0.85

Calls 1

joinMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…