MCPcopy Index your code
hub / github.com/github/docs / isValidNext

Function isValidNext

lib/enterprise-server-releases.js:26–33  ·  view source on GitHub ↗
(v1, v2)

Source from the content-addressed store, hash-verified

24isValidNext(next, nextNext)
25
26function isValidNext(v1, v2) {
27 const semverV1 = semver.coerce(v1).raw
28 const semverV2 = semver.coerce(v2).raw
29 const isValid =
30 semverV2 === semver.inc(semverV1, 'minor') || semverV2 === semver.inc(semverV1, 'major')
31 if (!isValid)
32 throw new Error(`The version "${v2}" is not one version ahead of "${v1}" as expected`)
33}
34
35// This indicates the point where we started treating redirect lookups
36// to be a *function* rather than a big *lookup object*.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected