MCPcopy Create free account
hub / github.com/nodejs/nodejs.org / extractVersionFromPath

Function extractVersionFromPath

apps/site/util/download/archive.tsx:144–150  ·  view source on GitHub ↗
(pathname: string)

Source from the content-addressed store, hash-verified

142 * It expects the version to be in the format like 'v22.0.4'.
143 */
144export const extractVersionFromPath = (pathname: string) => {
145 const segments = pathname.split('/').filter(Boolean);
146 // The version is expected to be the last segment in the path
147 const version = segments.pop()!;
148
149 return version;
150};

Callers 1

WithDownloadArchiveFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected