From 9bdb95c9e34cef640534e5e5a1e2225a80442000 Mon Sep 17 00:00:00 2001 From: HelenHuang <LinHuang@pollex.com.tw> Date: 星期四, 09 六月 2022 15:48:15 +0800 Subject: [PATCH] TODO#139894 [ footer -最下方說明與保經代合作 ] 文案修改 --- PAMapp/node_modules/@npmcli/fs/node_modules/semver/ranges/simplify.js | 27 +++++++++++++++------------ 1 files changed, 15 insertions(+), 12 deletions(-) diff --git a/PAMapp/node_modules/@npmcli/fs/node_modules/semver/ranges/simplify.js b/PAMapp/node_modules/@npmcli/fs/node_modules/semver/ranges/simplify.js index b792f97..618d5b6 100644 --- a/PAMapp/node_modules/@npmcli/fs/node_modules/semver/ranges/simplify.js +++ b/PAMapp/node_modules/@npmcli/fs/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) -- Gitblit v1.8.0