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

Method test

classes/comparator.js:61–77  ·  view source on GitHub ↗
(version)

Source from the content-addressed store, hash-verified

59 }
60
61 test (version) {
62 debug('Comparator.test', version, this.options.loose)
63
64 if (this.semver === ANY || version === ANY) {
65 return true
66 }
67
68 if (typeof version === 'string') {
69 try {
70 version = new SemVer(version, this.options)
71 } catch (er) {
72 return false
73 }
74 }
75
76 return cmp(version, this.operator, this.semver, this.options)
77 }
78
79 intersects (comp, options) {
80 if (!(comp instanceof Comparator)) {

Callers 1

intersectsMethod · 0.45

Calls 1

cmpFunction · 0.85

Tested by

no test coverage detected