MCPcopy Create free account
hub / github.com/EvoMap/evolver / _parseBootstrapSemver

Function _parseBootstrapSemver

index.js:2–11  ·  view source on GitHub ↗
(version)

Source from the content-addressed store, hash-verified

1#!/usr/bin/env node
2function _parseBootstrapSemver(version) {
3 const match = /^v?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/.exec(String(version || ''));
4 if (!match) return null;
5 return {
6 major: match[1],
7 minor: match[2],
8 patch: match[3],
9 prerelease: match[4] ? match[4].split('.') : [],
10 };
11}
12
13function _compareBootstrapNumeric(left, right) {
14 if (left.length !== right.length) return left.length - right.length;

Callers 1

_compareBootstrapSemverFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected