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

Function getEditUrl

scripts/api-docs.ts:371–388  ·  view source on GitHub ↗
(config: BuildConfig, fileUrlPath: string | undefined)

Source from the content-addressed store, hash-verified

369}
370
371function getEditUrl(config: BuildConfig, fileUrlPath: string | undefined) {
372 if (fileUrlPath) {
373 const rootRelPath = fileUrlPath.slice(fileUrlPath.indexOf('dts-out') + 'dts-out'.length + 1);
374
375 const tsxPath = join(config.rootDir, rootRelPath).replace(`.d.ts`, `.tsx`);
376 if (existsSync(tsxPath)) {
377 const url = new URL(rootRelPath, `https://github.com/QwikDev/qwik/tree/main/`);
378 return url.href.replace(`.d.ts`, `.tsx`);
379 }
380
381 const tsPath = join(config.rootDir, rootRelPath).replace(`.d.ts`, `.ts`);
382 if (existsSync(tsPath)) {
383 const url = new URL(rootRelPath, `https://github.com/QwikDev/qwik/tree/main/`);
384 return url.href.replace(`.d.ts`, `.ts`);
385 }
386 }
387 return undefined;
388}

Callers 1

addMemberFunction · 0.85

Calls 1

joinFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…