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

Method compare

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

Source from the content-addressed store, hash-verified

107 }
108
109 compare (other) {
110 debug('SemVer.compare', this.version, this.options, other)
111 if (!(other instanceof SemVer)) {
112 if (typeof other === 'string' && other === this.version) {
113 return 0
114 }
115 other = new SemVer(other, this.options)
116 }
117
118 if (other.version === this.version) {
119 return 0
120 }
121
122 return this.compareMain(other) || this.comparePre(other)
123 }
124
125 compareMain (other) {
126 if (!(other instanceof SemVer)) {

Callers 9

compareBuildFunction · 0.95
semver.jsFile · 0.80
coerce.jsFile · 0.80
compare-loose.jsFile · 0.80
compareFunction · 0.80
diffFunction · 0.80
maxSatisfyingFunction · 0.80
minSatisfyingFunction · 0.80
bench-compare.jsFile · 0.80

Calls 2

compareMainMethod · 0.95
comparePreMethod · 0.95

Tested by

no test coverage detected