How to use the subset function from semver

Find comprehensive JavaScript semver.subset code examples handpicked from public code repositorys.

67
68
69
70
71
72
73
74
75

instrumentations
  .filter(instrumentation => instrumentation.name === moduleName)
  .forEach(instrumentation => {
    instrumentation.versions
      .filter(version => !process.env.RANGE || semver.subset(version, process.env.RANGE))
      .forEach(version => {
        const min = semver.coerce(version).version
        const max = require(`../../../../versions/${moduleName}@${version}`).version()
fork icon243
star icon449
watch icon0

199
200
201
202
203
204
205
206
207
208
            )
        }
    }
} else {
    const foundRange = (pkg.dependencies || {})[requiredPackage] || (pkg.devDependencies || {})[requiredPackage]
    const satisfied = foundRange && semver.subset(foundRange, requiredRange)
    if (!peerIsOptional && !satisfied) {
        errors.push(
            `Package "${pkg.name}" depends on package "${localPackageName}", but is missing one of` +
            ` its peerDependencies "${requiredPackage}@${requiredRange}"`
fork icon80
star icon180
watch icon0

1247
1248
1249
1250
1251
1252
1253
1254
1255

let range = spec
if (
  !isRange ||
  spec === '*' ||
  subset(prefixRange, spec, { loose: true })
) {
  range = prefixRange
}
fork icon0
star icon0
watch icon1

+ 2 other calls in file