MCPcopy
hub / github.com/stenciljs/core / normalizeFsPathQuery

Function normalizeFsPathQuery

src/utils/path.ts:165–178  ·  view source on GitHub ↗
(importPath: string)

Source from the content-addressed store, hash-verified

163export const normalizeFsPath = (p: string) => normalizePath(p.split('?')[0].replace(/\0/g, ''));
164
165export const normalizeFsPathQuery = (importPath: string) => {
166 const pathParts = importPath.split('?');
167 const filePath = normalizePath(pathParts[0]);
168 const filePathParts = filePath.split('.');
169 const ext = filePathParts.length > 1 ? filePathParts.pop()!.toLowerCase() : null;
170 const params = pathParts.length > 1 ? new URLSearchParams(pathParts[1]) : null;
171 const format = params ? params.get('format') : null;
172
173 return {
174 filePath,
175 ext,
176 format,
177 };
178};
179
180const enum CharacterCodes {
181 a = 0x61,

Callers 2

path.spec.tsFile · 0.90
transformFunction · 0.85

Calls 2

normalizePathFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected