MCPcopy
hub / github.com/npm/node-semver / compareBuild

Method compareBuild

classes/semver.js:184–206  ·  view source on GitHub ↗
(other)

Source from the content-addressed store, hash-verified

182 }
183
184 compareBuild (other) {
185 if (!(other instanceof SemVer)) {
186 other = new SemVer(other, this.options)
187 }
188
189 let i = 0
190 do {
191 const a = this.build[i]
192 const b = other.build[i]
193 debug('build compare', i, a, b)
194 if (a === undefined && b === undefined) {
195 return 0
196 } else if (b === undefined) {
197 return 1
198 } else if (a === undefined) {
199 return -1
200 } else if (a === b) {
201 continue
202 } else {
203 return compareIdentifiers(a, b)
204 }
205 } while (++i)
206 }
207
208 // preminor will bump the version up to the next minor release, and immediately
209 // down to pre-release. premajor and prepatch work the same way.

Callers 3

compareBuildFunction · 0.95
semver.jsFile · 0.80
coerce.jsFile · 0.80

Calls 1

compareIdentifiersFunction · 0.85

Tested by

no test coverage detected