MCPcopy Index your code
hub / github.com/stenciljs/core / pathComponents

Function pathComponents

src/utils/path.ts:147–155  ·  view source on GitHub ↗
(path: string, rootLength: number)

Source from the content-addressed store, hash-verified

145};
146
147const pathComponents = (path: string, rootLength: number) => {
148 const root = path.substring(0, rootLength);
149 const rest = path.substring(rootLength).split('/');
150 const restLen = rest.length;
151 if (restLen > 0 && !rest[restLen - 1]) {
152 rest.pop();
153 }
154 return [root, ...rest];
155};
156
157/**
158 * Same as normalizePath(), expect it'll also strip any query strings

Callers 1

normalizePathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected