mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-12 02:13:04 +08:00
23 lines
409 B
JavaScript
23 lines
409 B
JavaScript
'use strict'
|
|
// semver's Comparator: a static getter returning a module symbol.
|
|
const ANY = Symbol('SemVer ANY')
|
|
|
|
class Comparator {
|
|
static get ANY () {
|
|
return ANY
|
|
}
|
|
|
|
static loose = false
|
|
|
|
static parse (text) {
|
|
return new Comparator(text)
|
|
}
|
|
|
|
constructor (text) {
|
|
this.semver = text === '' ? ANY : text
|
|
this.value = text === '' ? '' : `>=${text}`
|
|
}
|
|
}
|
|
|
|
module.exports = Comparator
|