Files
med-notes/.pnpm-store/v10/files/41/a5f7c38c77c9bb62f6cbef4b878050b91df07feb9c057ea6e4eac703bef94882aa03efd891ccc83b949a70e21f9fcf5940cf263d96f9f5d544b1cc6a350040
2025-06-26 03:35:15 +00:00

27 lines
591 B
Plaintext

'use strict'
const SemVer = require('../classes/semver')
const Range = require('../classes/range')
const minSatisfying = (versions, range, options) => {
let min = null
let minSV = null
let rangeObj = null
try {
rangeObj = new Range(range, options)
} catch (er) {
return null
}
versions.forEach((v) => {
if (rangeObj.test(v)) {
// satisfies(v, range, options)
if (!min || minSV.compare(v) === 1) {
// compare(min, v, true)
min = v
minSV = new SemVer(min, options)
}
}
})
return min
}
module.exports = minSatisfying