保誠-保戶業務員媒合平台
PAMapp/node_modules/@nuxt/cli/node_modules/semver/ranges/simplify.js
@@ -5,38 +5,41 @@
const compare = require('../functions/compare.js')
module.exports = (versions, range, options) => {
  const set = []
  let min = null
  let first = null
  let prev = null
  const v = versions.sort((a, b) => compare(a, b, options))
  for (const version of v) {
    const included = satisfies(version, range, options)
    if (included) {
      prev = version
      if (!min)
        min = version
      if (!first) {
        first = version
      }
    } else {
      if (prev) {
        set.push([min, prev])
        set.push([first, prev])
      }
      prev = null
      min = null
      first = null
    }
  }
  if (min)
    set.push([min, null])
  if (first) {
    set.push([first, null])
  }
  const ranges = []
  for (const [min, max] of set) {
    if (min === max)
    if (min === max) {
      ranges.push(min)
    else if (!max && min === v[0])
    } else if (!max && min === v[0]) {
      ranges.push('*')
    else if (!max)
    } else if (!max) {
      ranges.push(`>=${min}`)
    else if (min === v[0])
    } else if (min === v[0]) {
      ranges.push(`<=${max}`)
    else
    } else {
      ranges.push(`${min} - ${max}`)
    }
  }
  const simplified = ranges.join(' || ')
  const original = typeof range.raw === 'string' ? range.raw : String(range)