PATH:
usr
/
lib
/
node_modules
/
npm
/
node_modules
/
semver
/
functions
const eq = require('./eq') const neq = require('./neq') const gt = require('./gt') const gte = require('./gte') const lt = require('./lt') const lte = require('./lte') const cmp = (a, op, b, loose) => { switch (op) { case '===': if (typeof a === 'object') { a = a.version } if (typeof b === 'object') { b = b.version } return a === b case '!==': if (typeof a === 'object') { a = a.version } if (typeof b === 'object') { b = b.version } return a !== b case '': case '=': case '==': return eq(a, b, loose) case '!=': return neq(a, b, loose) case '>': return gt(a, b, loose) case '>=': return gte(a, b, loose) case '<': return lt(a, b, loose) case '<=': return lte(a, b, loose) default: throw new TypeError(`Invalid operator: ${op}`) } } module.exports = cmp
[-] valid.js
[edit]
[-] gt.js
[edit]
[-] inc.js
[edit]
[+]
..
[-] compare-loose.js
[edit]
[-] satisfies.js
[edit]
[-] minor.js
[edit]
[-] rcompare.js
[edit]
[-] eq.js
[edit]
[-] parse.js
[edit]
[-] diff.js
[edit]
[-] compare-build.js
[edit]
[-] rsort.js
[edit]
[-] major.js
[edit]
[-] gte.js
[edit]
[-] lt.js
[edit]
[-] lte.js
[edit]
[-] patch.js
[edit]
[-] compare.js
[edit]
[-] sort.js
[edit]
[-] cmp.js
[edit]
[-] clean.js
[edit]
[-] coerce.js
[edit]
[-] prerelease.js
[edit]
[-] neq.js
[edit]