MCPcopy Create free account
hub / github.com/dfinity/orbit / parse

Method parse

apps/wallet/src/utils/helper.utils.ts:244–261  ·  view source on GitHub ↗
(version: string)

Source from the content-addressed store, hash-verified

242 }
243
244 static parse(version: string): SemanticVersion {
245 const match = version.match(semanticVersionRegex);
246 if (!match) {
247 throw new Error(`Invalid semantic version: ${version}`);
248 }
249
250 const [, major, minor, patch, preRelease, build] = match;
251 const [preReleaseType, preReleaseNumber] = preRelease?.split('.') ?? [undefined, undefined];
252
253 return new SemanticVersion(
254 Number(major),
255 Number(minor),
256 Number(patch),
257 preReleaseType,
258 preReleaseNumber !== undefined ? Number(preReleaseNumber) : 0,
259 build,
260 );
261 }
262
263 public toString(): string {
264 const preRelease = this.preReleaseType

Callers 15

fromMethod · 0.80
objectDeserializeFunction · 0.80
parseDateFunction · 0.80
transformDataFunction · 0.80
checkCompatibilityFunction · 0.80
assertReplicaIsHealthyFunction · 0.80
getReplicaUrlFunction · 0.80
remove.tsFile · 0.80
searchRegistryFunction · 0.80
publish.tsFile · 0.80
publish.tsFile · 0.80

Calls 1

matchMethod · 0.80

Tested by

no test coverage detected