MCPcopy Index your code
hub / github.com/npm/node-semver / compareMain

Method compareMain

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

Source from the content-addressed store, hash-verified

123 }
124
125 compareMain (other) {
126 if (!(other instanceof SemVer)) {
127 other = new SemVer(other, this.options)
128 }
129
130 if (this.major < other.major) {
131 return -1
132 }
133 if (this.major > other.major) {
134 return 1
135 }
136 if (this.minor < other.minor) {
137 return -1
138 }
139 if (this.minor > other.minor) {
140 return 1
141 }
142 if (this.patch < other.patch) {
143 return -1
144 }
145 if (this.patch > other.patch) {
146 return 1
147 }
148 return 0
149 }
150
151 comparePre (other) {
152 if (!(other instanceof SemVer)) {

Callers 3

compareMethod · 0.95
semver.jsFile · 0.80
diffFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected