MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / normalizePathSegment

Function normalizePathSegment

packages/vite/helpers/utils.ts:103–111  ·  view source on GitHub ↗
(segment?: string | null)

Source from the content-addressed store, hash-verified

101let cachedAppPath: string | undefined;
102
103function normalizePathSegment(segment?: string | null): string | undefined {
104 if (!segment) return undefined;
105 const normalized = segment
106 .replace(/\\/g, '/')
107 .replace(/^\.\/+/, '')
108 .replace(/^\/+/, '')
109 .replace(/\/+$/, '');
110 return normalized || undefined;
111}
112
113function deriveAppPathFromPackage(): string | undefined {
114 const mainEntry = packageJson?.main;

Callers 3

deriveAppPathFromPackageFunction · 0.85
computeProjectAppPathFunction · 0.85

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected