From 826417f66694da298b3e28f38f25dd7849ddce3c Mon Sep 17 00:00:00 2001 From: Zane Rockenbaugh Date: Sun, 12 Oct 2025 14:22:49 -0500 Subject: [PATCH 1/9] now includes all the base semver functions; moves some of our previous functs to 'xxxString' versions --- src/filter-valid-versions.mjs | 22 +++ src/lib/compare-helper.mjs | 16 ++ src/lib/set-default-options.mjs | 14 ++ src/max-satisfying-version-string.mjs | 23 +++ src/min-satisfying-version-string.mjs | 23 +++ src/min-version-string.mjs | 22 +++ src/min-version.mjs | 21 --- src/prerelease.mjs | 7 - src/semver-comparison-ops.mjs | 153 ++++++++++++++++++ src/semver-range-ops.mjs | 116 +++++++++++++ src/semver-version-ops.mjs | 91 +++++++++++ .../max-satisfying-version-string.test.mjs | 22 +++ .../min-satisfying-version-string.test.mjs | 23 +++ src/test/min-version-string.test.mjs | 27 ++++ src/test/min-version.test.mjs | 20 --- src/test/prerelease.test.mjs | 2 +- src/test/version-compare.test.mjs | 45 ------ src/version-compare.mjs | 57 ------- 18 files changed, 553 insertions(+), 151 deletions(-) create mode 100644 src/filter-valid-versions.mjs create mode 100644 src/lib/compare-helper.mjs create mode 100644 src/lib/set-default-options.mjs create mode 100644 src/max-satisfying-version-string.mjs create mode 100644 src/min-satisfying-version-string.mjs create mode 100644 src/min-version-string.mjs delete mode 100644 src/min-version.mjs delete mode 100644 src/prerelease.mjs create mode 100644 src/semver-comparison-ops.mjs create mode 100644 src/semver-range-ops.mjs create mode 100644 src/semver-version-ops.mjs create mode 100644 src/test/max-satisfying-version-string.test.mjs create mode 100644 src/test/min-satisfying-version-string.test.mjs create mode 100644 src/test/min-version-string.test.mjs delete mode 100644 src/test/min-version.test.mjs delete mode 100644 src/test/version-compare.test.mjs delete mode 100644 src/version-compare.mjs diff --git a/src/filter-valid-versions.mjs b/src/filter-valid-versions.mjs new file mode 100644 index 0000000..475d3e8 --- /dev/null +++ b/src/filter-valid-versions.mjs @@ -0,0 +1,22 @@ +import semver from 'semver' + +const filterValidVersions = (versions, { ignoreNonVersions }) => { + versions = versions.filter((version) => { + const valid = semver.valid(version) !== null + + if (valid === false) { + if (ignoreNonVersions === true) { + return false + } + else { + throw new Error(`'${version}' is not a valid semver.`) + } + } + + return true + }) + + return versions + } + + export { filterValidVersions } \ No newline at end of file diff --git a/src/lib/compare-helper.mjs b/src/lib/compare-helper.mjs new file mode 100644 index 0000000..dbed1bb --- /dev/null +++ b/src/lib/compare-helper.mjs @@ -0,0 +1,16 @@ +const compareHelper = (versions, semverTest) => { + let currLead + for (let i = 0; i < versions.length; i += 1) { + const testVer = versions[i] + if (currLead === undefined) { + currLead = testVer + } + else if (semverTest(currLead, testVer)) { + currLead = testVer + } + } + + return currLead + } + + export { compareHelper } \ No newline at end of file diff --git a/src/lib/set-default-options.mjs b/src/lib/set-default-options.mjs new file mode 100644 index 0000000..0ca6748 --- /dev/null +++ b/src/lib/set-default-options.mjs @@ -0,0 +1,14 @@ + + +const setDefaultOptions = (options = {}) => { + if (!('includePrerelease' in options) + && (process.env.SEMVER_PLUS_COMPAT === undefined + || process.env.SEMVER_PLUS_COMPAT.toLocaleLowerCase() === 'false' + || process.env.SEMVER_PLUS_COMPAT === '0')) { + options.includePrerelease = true + } + + return options +} + +export { setDefaultOptions } \ No newline at end of file diff --git a/src/max-satisfying-version-string.mjs b/src/max-satisfying-version-string.mjs new file mode 100644 index 0000000..568c562 --- /dev/null +++ b/src/max-satisfying-version-string.mjs @@ -0,0 +1,23 @@ +import semver from 'semver' + +import { filterValidVersions } from './filter-valid-versions' +import { compareHelper } from './lib/compare-helper' + +/** + * Like {@link maxVersion} but returns a string instead of a version object. + * @param {string[]} versions - The versions to compare. + * @param {object} options - The options to pass to the compareHelper function. + * @param {boolean} options.ignoreNonVersions - Whether to ignore non-version strings. + * @returns {string|null} - The maximum version string or null if no version strings are provided. + */ +const maxSatisfyingVersionString = (versions, { ignoreNonVersions } = {}) => { + if (!versions || versions.length === 0) { + return null + } + + versions = filterValidVersions(versions, { ignoreNonVersions }) + + return compareHelper(versions, semver.lt) +} + +export { maxSatisfyingVersionString } \ No newline at end of file diff --git a/src/min-satisfying-version-string.mjs b/src/min-satisfying-version-string.mjs new file mode 100644 index 0000000..5b89b1d --- /dev/null +++ b/src/min-satisfying-version-string.mjs @@ -0,0 +1,23 @@ +import semver from 'semver' + +import { filterValidVersions } from './filter-valid-versions' +import { compareHelper } from './lib/compare-helper' + +/** + * Like {@link minVersion} but returns a string instead of a version object. + * @param {string[]} versions - The versions to compare. + * @param {object} options - The options to pass to the compareHelper function. + * @param {boolean} options.ignoreNonVersions - Whether to ignore non-version strings. + * @returns {string|null} - The minimum version string or null if no version strings are provided. +*/ +const minSatisfyingVersionString = (versions, { ignoreNonVersions } = {}) => { +if (!versions || versions.length === 0) { + return null +} + +versions = filterValidVersions(versions, { ignoreNonVersions }) + +return compareHelper(versions, semver.gt) +} + +export { minSatisfyingVersionString } \ No newline at end of file diff --git a/src/min-version-string.mjs b/src/min-version-string.mjs new file mode 100644 index 0000000..5053de8 --- /dev/null +++ b/src/min-version-string.mjs @@ -0,0 +1,22 @@ +import { prereleaseXRangeRE } from './constants' +import { setDefaultOptions } from './lib/set-default-options' +import { minVersion, validRange } from './semver-range-ops' + +const minVersionString = (range, options) => { + options = setDefaultOptions(options) + // given range '1.0.0-alpha.x', semver treats that as a specific version and says the min version is + // '1.0.0-alpha.x' even when 'options.includePrerelease' is true; this is verified in the unit tests. + if (options.includePrerelease === true && range.match(prereleaseXRangeRE)) { + return range.slice(0, -1) + '0' + } + else { + const semverRange = validRange(range) + if (semverRange !== null) { + return minVersion(semverRange, options).version + } + } + // else + throw new Error(`Invaid range '${range}'.`) +} + +export { minVersionString } \ No newline at end of file diff --git a/src/min-version.mjs b/src/min-version.mjs deleted file mode 100644 index 801f87d..0000000 --- a/src/min-version.mjs +++ /dev/null @@ -1,21 +0,0 @@ -import semver from 'semver' - -import { prereleaseXRangeRE } from './constants' - -const minVersion = (range) => { - // this has to come first because weirds, 'semver.validRange' recognizes 1.0.0-alpha.x (but not '.*'?!), but - // 'semver.minVersion' does not return correct results - if (range.match(prereleaseXRangeRE)) { - return range.slice(0, -1) + '0' - } - else { - const semverRange = semver.validRange(range) - if (semverRange !== null) { - return semver.minVersion(semverRange).version - } - } - // else - throw new Error(`Invaid range '${range}'.`) -} - -export { minVersion } diff --git a/src/prerelease.mjs b/src/prerelease.mjs deleted file mode 100644 index 2f8c86d..0000000 --- a/src/prerelease.mjs +++ /dev/null @@ -1,7 +0,0 @@ -import semver from 'semver' - -const prerelease = (version) => { - return semver.prerelease(version) -} - -export { prerelease } diff --git a/src/semver-comparison-ops.mjs b/src/semver-comparison-ops.mjs new file mode 100644 index 0000000..a3df0f1 --- /dev/null +++ b/src/semver-comparison-ops.mjs @@ -0,0 +1,153 @@ +import semver from 'semver' + +/** + * Returns `true` if `v1` is greater than `v2`, `false` otherwise. + * @param {string} v1 - The first version to compare. + * @param {string} v2 - The second version to compare. + * @param {object} options - The options to pass to the semver.gt function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @returns {boolean} - `true` if `v1` is greater than `v2`, `false` otherwise. + */ +export const gt = semver.gt + +/** + * Returns `true` if `v1` is greater than or equal to `v2`, `false` otherwise. + * @param {string} v1 - The first version to compare. + * @param {string} v2 - The second version to compare. + * @param {object} options - The options to pass to the semver.gte function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @returns {boolean} - `true` if `v1` is greater than or equal to `v2`, `false` otherwise. + */ +export const gte = semver.gte + + +/** + * Returns `true` if `v1` is less than `v2`, `false` otherwise. + * @param {string} v1 - The first version to compare. + * @param {string} v2 - The second version to compare. + * @param {object} options - The options to pass to the semver.lt function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @returns {boolean} - `true` if `v1` is less than `v2`, `false` otherwise. + */ +export const lt = semver.lt + +/** + * Returns `true` if `v1` is less than or equal to `v2`, `false` otherwise. + * @param {string} v1 - The first version to compare. + * @param {string} v2 - The second version to compare. + * @param {object} options - The options to pass to the semver.lte function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @returns {boolean} - `true` if `v1` is less than or equal to `v2`, `false` otherwise. + */ +export const lte = semver.lte + + +/** + * Returns `true` if `v1` is equal to `v2`, `false` otherwise. + * @param {string} v1 - The first version to compare. + * @param {string} v2 - The second version to compare. + * @param {object} options - The options to pass to the semver.eq function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @returns {boolean} - `true` if `v1` is equal to `v2`, `false` otherwise. + */ +export const eq = semver.eq + +/** + * Returns `true` if `v1` is not equal to `v2`, `false` otherwise. + * @param {string} v1 - The first version to compare. + * @param {string} v2 - The second version to compare. + * @param {object} options - The options to pass to the semver.neq function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @returns {boolean} - `true` if `v1` is not equal to `v2`, `false` otherwise. + */ +export const neq = semver.neq + +/** + * Returns a number indicating whether a version is greater than, equal to, or less than another version. + * @param {string} v1 - The first version to compare. + * @param {string} comparator - The comparator to use. May be '<', '<=', '>', '>=', '=', '==', '!=', '===', or '!=='. + * An exception is thrown if an invalid comparator is provided. + * @param {string} v2 - The second version to compare. + * @param {object} options - The options to pass to the semver.cmp function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @returns {number} - A number indicating whether a version is greater than, equal to, or less than another version. + */ +export const cmp = semver.cmp + +/** + * Returns 0 if `v1 == v2`, 1 if `v1 > v2`, and -1 if `v1 < v2`. Will sort an array of versions in ascending order if + * passed to `Array.sort()`. + * @param {string} v1 - The first version to compare. + * @param {string} v2 - The second version to compare. + * @param {object} options - The options to pass to the semver.compare function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @returns {number} - 0 if `v1 == v2`, 1 if `v1 > v2`, and -1 if `v1 < v2`. + */ +export const compare = semver.compare + +/** + * Same as {@link compare} except it compares build if two versions are otherwise equal. + * @param {string} v1 - The first version to compare. + * @param {string} v2 - The second version to compare. + * @param {object} options - The options to pass to the semver.compareBuild function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @returns {number} - 0 if `v1 == v2`, 1 if `v1 > v2`, and -1 if `v1 < v2`. + */ +export const compareBuild = semver.compareBuild + +/** + * Reverse of {@link compare}. + * @param {string} v1 - The first version to compare. + * @param {string} v2 - The second version to compare. + * @param {object} options - The options to pass to the semver.rcompare function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @returns {number} - 0 if `v1 == v2`, -1 if `v1 > v2`, and 1 if `v1 < v2`. + */ +export const rcompare = semver.rcompare + +/** + * Short for {@link compare} with `options.loose = true`. + * @param {string} v1 - The first version to compare. + * @param {string} v2 - The second version to compare. + * @returns {number} - 0 if `v1 == v2`, 1 if `v1 > v2`, and -1 if `v1 < v2`. + */ +export const compareLoose = semver.compareLoose + +/** + * Returns a parsed, normalized range string or null if the range is invalid. + * @param {string} range - The range to parse. + * @param {object} options - The options to pass to the semver.validRange function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @returns {string|null} - The parsed, normalized range string or null if the range is invalid. + */ +export const validRange = semver.validRange + +/** + * Returns the difference between two versions. I.e., the most significant version component by which `v1` and `v2` + * differ. + * @param {string} v1 - The first version to compare. + * @param {string} v2 - The second version to compare. + * @param {object} options - The options to pass to the semver.diff function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @returns {string|null} - `major`, 'minor', 'patch', 'prerelease', 'premajor', 'preminor', or 'prepatch' or null if + * the `v1` and `v2` are identical (disregarding build metadata). + */ +export const diff = semver.diff + +/** + * Sorts an array of versions in ascending order using {@link compareBuild}. + * @param {string[]} versions - The versions to sort. + * @param {object} options - The options to pass to the semver.sort function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @returns {string[]} - The sorted versions. + */ +export const sort = semver.sort + +/** + * Sorts an array of versions in descending order using {@link compareBuild}. + * @param {string[]} versions - The versions to sort. + * @param {object} options - The options to pass to the semver.rsort function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @returns {string[]} - The sorted versions. + */ +export const rsort = semver.rsort diff --git a/src/semver-range-ops.mjs b/src/semver-range-ops.mjs new file mode 100644 index 0000000..918e965 --- /dev/null +++ b/src/semver-range-ops.mjs @@ -0,0 +1,116 @@ +import semver from 'semver' + +/** + * Returns a parsed, normalized range string or null if the range is invalid. + * @param {string} range - The range to parse. + * @param {object} options - The options to pass to the semver.validRange function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @returns {string|null} - The parsed, normalized range string or null if the range is invalid. + */ +export const validRange = semver.validRange + +/** + * Returns `true` if the version satisfies the range, `false` otherwise. + * @param {string} version - The version to check. + * @param {string} range - The range to check. + * @param {object} options - The options to pass to the semver.satisfies function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @returns {boolean} - `true` if the version satisfies the range, `false` otherwise. + */ +export const satisfies = semver.satisfies + +/** + * Returns the highest version in `versions` that satisfies the range, or null if no version satisfies the range. + * @param {string[]} versions - The versions to check. + * @param {string} range - The range to check. + * @param {object} options - The options to pass to the semver.maxSatisfying function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @returns {string|null} - The highest version that satisfies the range, or null if no version satisfies the range. + */ +export const maxSatisfying = semver.maxSatisfying + +/** + * Returns the lowest version in `versions` that satisfies the range, or null if no version satisfies the range. + * @param {string[]} versions - The versions to check. + * @param {string} range - The range to check. + * @param {object} options - The options to pass to the semver.minSatisfying function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @returns {string|null} - The lowest version that satisfies the range, or null if no version satisfies the range. + */ +export const minSatisfying = semver.minSatisfying + +/** + * Returns the lowest version that satisfies the range, or null if no version satisfies the range. Note, to correctly + * handle `minVersion('1.0.0-alpha.x)`, you must pass `options.includePrerelease = true`. + * @param {string} range - The range to check. + * @param {object} options - The options to pass to the semver.minVersion function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @param {boolean} options.includePrerelease - Whether to include prerelease versions. + * @returns {string|null} - The lowest version that satisfies the range, or null if no version satisfies the range. + */ +export const minVersion = semver.minVersion + +/** + * Returns `true` if `version` is greater than is greater than any version in `range`, `false` otherwise. + * @param {string} version - The version to check. + * @param {string} range - The range to check. + * @param {object} options - The options to pass to the semver.gtr function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @returns {boolean} - `true` if `version` is greater than is greater than any version in `range`, `false` otherwise. + */ +export const gtr = semver.gtr + +/** + * Returns `true` if `version` is less than is less than any version in `range`, `false` otherwise. + * @param {string} version - The version to check. + * @param {string} range - The range to check. + * @param {object} options - The options to pass to the semver.ltr function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @returns {boolean} - `true` if `version` is less than is less than any version in `range`, `false` otherwise. + */ +export const ltr = semver.ltr + +/** + * Returns `true` if `version` is outside of `range` in the indicated direction, `false` otherwise. `outside(v, r, '>)` + * is equivalent to `gtr(v, r)`. + * @param {string} version - The version to check. + * @param {string} range - The range to check. + * @param {string} direction - The direction to check. Must be '>' or '<'. + * @param {object} options - The options to pass to the semver.outside function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @returns {boolean} - `true` if `version` is outside of `range` in the indicated direction, `false` otherwise. + */ +export const outside = semver.outside + +/** + * Returns `true` if any of the comparators in the range intersect with each other. + * @param {string} range - The first version range or comparator. + * @param {object} options - The options to pass to the semver.intersects function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @returns {boolean} - `true` if any of the comparators in the range intersect with each other, `false` otherwise. + */ +export const intersects = semver.intersects + +/** + * Return a "simplified" range that matches the same items in the versions list as the range specified. Note that it + * does not guarantee that it would match the same versions in all cases, only for the set of versions provided. This + * is useful when generating ranges by joining together multiple versions with || programmatically, to provide the user + * with something a bit more ergonomic. If the provided range is shorter in string-length than the generated range, + * then that is returned. + * @param {string[]} versions - The versions to check. + * @param {string} range - The range to simplify. + * @param {object} options - The options to pass to the semver.simplifyRange function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @returns {string} - The simplified range. + */ +export const simplifyRange = semver.simplifyRange + +/** + * Returns `true` if `subRange` is a subset of `superRange`, `false` otherwise. + * @param {string} subRange - The sub-range to check. + * @param {string} superRange - The super-range to check. + * @param {object} options - The options to pass to the semver.subset function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @returns {boolean} - `true` if `subRange` is a subset of `superRange`, `false` otherwise. + */ +export const subset = semver.subset \ No newline at end of file diff --git a/src/semver-version-ops.mjs b/src/semver-version-ops.mjs new file mode 100644 index 0000000..da53339 --- /dev/null +++ b/src/semver-version-ops.mjs @@ -0,0 +1,91 @@ +import semver from 'semver' + +/** + * Returns a parsed, normalized version string or null if the version is invalid. + * @param {string} version - The version to parse. + * @param {object} options - The options to pass to the semver.valid function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @param {boolean} options.includePrerelease - Whether to include prerelease versions. + * @returns {string|null} - The parsed, normalized version string or null if the version is invalid. + */ +export const valid = semver.valid + +/** + * Returns a new version string incremented by the specified part. + * @param {string} version - The version to increment. + * @param {string} increment - The increment to use. + * @param {object} options - The options to pass to the semver.inc function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @param {boolean} options.includePrerelease - Whether to include prerelease versions. + * @param {string} identifier - Used to specify the prerelease name for prerelease increments. + * @param {false|0|1} identifierBase - When incrementing to a new prerelease name, specifies the base number or + * `false` for no number. + * @returns {string} - The new version string. + */ +export const inc = semver.inc + +/** + * Returns an array of prerelease components or `null` if the version is not a prerelease. A 'component' is just a '.' + * separated string. + * @param {string} version - The version to parse. + * @param {object} options - The options to pass to the semver.inc function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @returns {string[]|null} - The prerelease components or `null` if the version is not a prerelease. + */ +export const prerelease = semver.prerelease + +/** + * Returns the major version number. + * @param {string} version - The version to parse. + * @param {object} options - The options to pass to the semver.major function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @returns {number} - The major version number. + */ +export const major = semver.major + +/** + * Returns the minor version number. + * @param {string} version - The version to parse. + * @param {object} options - The options to pass to the semver.minor function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @returns {number} - The minor version number. + */ +export const minor = semver.minor + +/** + * Returns the patch version number. + * @param {string} version - The version to parse. + * @param {object} options - The options to pass to the semver.patch function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @returns {number} - The patch version number. + */ +export const patch = semver.patch + +/** + * Attempts to parse and normalize a string as a semver string. An aliase for {@link valid}. + */ +export const parse = semver.parse + +/** + * Aggressively attempts to coerce a string into a valid semver string. Basically, starting from the left side of the + * string, it looks for a digit and then includes anything to the right of the digit that looks like part of a semver. + * So, 'Number 1!' -> '1.0.0', 'Upgrade 1.2 to 1.3' -> '1.2.0', etc. + * @param {string} version - The version to coerce. + * @param {object} options - The options to pass to the semver.coerce function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @param {boolean} options.includePrerelease - Unless true, prerelease tags (and build metadata) are stripped. If + * @param {boolean} options.rtl - Instead of searching for a digit from the left, start searching from the right. + * true, then they are preserved. + * @returns {string|null} - The coerced version string or null if the version is invalid. + */ +export const coerce = semver.coerce + +/** + * Returns a cleaned version string removing unecessary comparators and, if `options.loose` is true, fixing space + * issues. Only works for versions, not ranges. + * @param {string} version - The version to clean. + * @param {object} options - The options to pass to the semver.clean function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @returns {string|null} - The cleaned version string or null if the version is invalid. + */ +export const clean = semver.clean \ No newline at end of file diff --git a/src/test/max-satisfying-version-string.test.mjs b/src/test/max-satisfying-version-string.test.mjs new file mode 100644 index 0000000..b208334 --- /dev/null +++ b/src/test/max-satisfying-version-string.test.mjs @@ -0,0 +1,22 @@ +import { maxSatisfyingVersionString } from '../max-satisfying-version-string' + +describe('maxSatisfyingVersionString', () => { + test.each([ + [['1.0.0-alpha.0', '1.0.0-beta.0'], '1.0.0-beta.0'], + [['1.0.0-beta.0', '1.0.0-rc.0'], '1.0.0-rc.0'], + [['1.0.0-alpha.0', '1.0.0'], '1.0.0'], + [['1.0.0-alpha.0', '1.0.0-beta.0', '1.0.0-rc.0', '1.0.0'], '1.0.0'], + [['1.0.0-alpha.2', '1.0.0-alpha.13'], '1.0.0-alpha.13'], + [['2.0.0-alpha.0', '1.0.0'], '2.0.0-alpha.0'] + ])('versions %p -> %s', (versions, expected) => expect(maxSatisfyingVersionString(versions)).toBe(expected)) + + test('[] => null', () => expect(maxSatisfyingVersionString([])).toBe(null)) + + test('mixed version types raises exception', + () => expect(() => maxSatisfyingVersionString(['1.0.0', 'not-a-valid-vesion'])).toThrow()) + + test.each([ + [['1.0.0', 'not-a-valid-vesion', 'abc'], '1.0.0'] + ])("'ignoreNonVersions' filters non-version strings from the version list", + (versions, expected) => expect(maxSatisfyingVersionString(versions, { ignoreNonVersions : true })).toBe(expected)) + }) \ No newline at end of file diff --git a/src/test/min-satisfying-version-string.test.mjs b/src/test/min-satisfying-version-string.test.mjs new file mode 100644 index 0000000..31c15f9 --- /dev/null +++ b/src/test/min-satisfying-version-string.test.mjs @@ -0,0 +1,23 @@ +/* global describe expect test */ +import { minSatisfyingVersionString } from '../min-satisfying-version-string' + +describe('minSatisfyingVersionString', () => { + test.each([ + [['1.0.0-alpha.0', '1.0.0-beta.0'], '1.0.0-alpha.0'], + [['1.0.0-beta.0', '1.0.0-rc.0'], '1.0.0-beta.0'], + [['1.0.0-alpha.0', '1.0.0'], '1.0.0-alpha.0'], + [['1.0.0-alpha.0', '1.0.0-beta.0', '1.0.0-rc.0', '1.0.0'], '1.0.0-alpha.0'], + [['2.0.0-alpha.0', '1.0.0'], '1.0.0'], + [['1.0.0-alpha.2', '1.0.0-alpha.13'], '1.0.0-alpha.2'] + ])('versions %p -> %s', (versions, expected) => expect(minSatisfyingVersionString(versions)).toBe(expected)) + + test('[] => null', () => expect(minSatisfyingVersionString([])).toBe(null)) + + test('mixed version types raises exception', + () => expect(() => minSatisfyingVersionString(['1.0.0', 'not-a-valid-vesion'])).toThrow()) + + test.each([ + [['1.0.0', 'not-a-valid-vesion', 'abc'], '1.0.0'] + ])("'ignoreNonVersions' filters non-version strings from the version list", + (versions, expected) => expect(minSatisfyingVersionString(versions, { ignoreNonVersions : true })).toBe(expected)) +}) diff --git a/src/test/min-version-string.test.mjs b/src/test/min-version-string.test.mjs new file mode 100644 index 0000000..7b10fd8 --- /dev/null +++ b/src/test/min-version-string.test.mjs @@ -0,0 +1,27 @@ +import semver from 'semver' + +import { minVersionString } from '../min-version-string' + +describe('minVersionString', () => { + test('verify semver prerelease bug', () => { + // we want to make sure we have the actual semver and not our local, which may have wrapper logic to fix this + expect(semver.minVersion('1.0.0-alpha.x').toString()).toBe('1.0.0-alpha.x') // correct + expect(semver.minVersion('1.0.0-alpha.x', { includePrerelease : true }).toString()).toBe('1.0.0-alpha.x') // incorrect +}) + + test.each([ + ['*', '0.0.0'], + ['1.*', '1.0.0'], + ['1.0.*', '1.0.0'], + ['1.0.0-alpha.*', '1.0.0-alpha.0'], + ['1.0.0-beta.*', '1.0.0-beta.0'], + ['1.0.0-rc.*', '1.0.0-rc.0'], + ['x', '0.0.0'], + ['1.x', '1.0.0'], + ['1.0.x', '1.0.0'], + ['1.0.0-alpha.x', '1.0.0-alpha.0'], + ['1.0.0-beta.x', '1.0.0-beta.0'], + ['1.0.0-rc.x', '1.0.0-rc.0'], + ['1.0.0 - 2', '1.0.0'] + ])('%s => %s', (input, expected) => expect(minVersionString(input)).toBe(expected)) +}) diff --git a/src/test/min-version.test.mjs b/src/test/min-version.test.mjs deleted file mode 100644 index e993c56..0000000 --- a/src/test/min-version.test.mjs +++ /dev/null @@ -1,20 +0,0 @@ -/* global describe expect test */ -import { minVersion } from '../min-version' - -describe('minVersion', () => { - test.each([ - ['*', '0.0.0'], - ['1.*', '1.0.0'], - ['1.0.*', '1.0.0'], - ['1.0.0-alpha.*', '1.0.0-alpha.0'], - ['1.0.0-beta.*', '1.0.0-beta.0'], - ['1.0.0-rc.*', '1.0.0-rc.0'], - ['x', '0.0.0'], - ['1.x', '1.0.0'], - ['1.0.x', '1.0.0'], - ['1.0.0-alpha.x', '1.0.0-alpha.0'], - ['1.0.0-beta.x', '1.0.0-beta.0'], - ['1.0.0-rc.x', '1.0.0-rc.0'], - ['1.0.0 - 2', '1.0.0'] - ])('%s => %s', (input, expected) => expect(minVersion(input)).toBe(expected)) -}) diff --git a/src/test/prerelease.test.mjs b/src/test/prerelease.test.mjs index c1c99cc..235f32c 100644 --- a/src/test/prerelease.test.mjs +++ b/src/test/prerelease.test.mjs @@ -1,6 +1,6 @@ /* global describe expect test */ -import { prerelease } from '../prerelease' +import { prerelease } from '../semver-version-ops' describe('prerelease', () => { test.each([ diff --git a/src/test/version-compare.test.mjs b/src/test/version-compare.test.mjs deleted file mode 100644 index d910663..0000000 --- a/src/test/version-compare.test.mjs +++ /dev/null @@ -1,45 +0,0 @@ -/* global describe expect test */ - -import { maxVersion, minVersion } from '../version-compare' - -describe('maxVersion', () => { - test.each([ - [['1.0.0-alpha.0', '1.0.0-beta.0'], '1.0.0-beta.0'], - [['1.0.0-beta.0', '1.0.0-rc.0'], '1.0.0-rc.0'], - [['1.0.0-alpha.0', '1.0.0'], '1.0.0'], - [['1.0.0-alpha.0', '1.0.0-beta.0', '1.0.0-rc.0', '1.0.0'], '1.0.0'], - [['1.0.0-alpha.2', '1.0.0-alpha.13'], '1.0.0-alpha.13'], - [['2.0.0-alpha.0', '1.0.0'], '2.0.0-alpha.0'] - ])('versions %p -> %s', (versions, expected) => expect(maxVersion({ versions })).toBe(expected)) - - test('[] => null', () => expect(maxVersion({ versions : [] })).toBe(null)) - - test('mixed version types raises exception', - () => expect(() => maxVersion({ versions : ['1.0.0', 'not-a-valid-vesion'] })).toThrow()) - - test.each([ - [['1.0.0', 'not-a-valid-vesion', 'abc'], '1.0.0'] - ])("'ignoreNonVersions' filters non-version strings from the version list", - (versions, expected) => expect(maxVersion({ ignoreNonVersions : true, versions })).toBe(expected)) -}) - -describe('minVersion', () => { - test.each([ - [['1.0.0-alpha.0', '1.0.0-beta.0'], '1.0.0-alpha.0'], - [['1.0.0-beta.0', '1.0.0-rc.0'], '1.0.0-beta.0'], - [['1.0.0-alpha.0', '1.0.0'], '1.0.0-alpha.0'], - [['1.0.0-alpha.0', '1.0.0-beta.0', '1.0.0-rc.0', '1.0.0'], '1.0.0-alpha.0'], - [['2.0.0-alpha.0', '1.0.0'], '1.0.0'], - [['1.0.0-alpha.2', '1.0.0-alpha.13'], '1.0.0-alpha.2'] - ])('versions %p -> %s', (versions, expected) => expect(minVersion({ versions })).toBe(expected)) - - test('[] => null', () => expect(minVersion({ versions : [] })).toBe(null)) - - test('mixed version types raises exception', - () => expect(() => minVersion({ versions : ['1.0.0', 'not-a-valid-vesion'] })).toThrow()) - - test.each([ - [['1.0.0', 'not-a-valid-vesion', 'abc'], '1.0.0'] - ])("'ignoreNonVersions' filters non-version strings from the version list", - (versions, expected) => expect(minVersion({ ignoreNonVersions : true, versions })).toBe(expected)) -}) diff --git a/src/version-compare.mjs b/src/version-compare.mjs deleted file mode 100644 index f60b6f8..0000000 --- a/src/version-compare.mjs +++ /dev/null @@ -1,57 +0,0 @@ -import semver from 'semver' - -const compareHelper = ({ semverTest, timeverTest, versions }) => { - let currLead - for (let i = 0; i < versions.length; i += 1) { - const testVer = versions[i] - if (currLead === undefined) { - currLead = testVer - } - else if (semverTest(currLead, testVer)) { - currLead = testVer - } - } - - return currLead -} - -const maxVersion = ({ ignoreNonVersions, versions }) => { - if (!versions || versions.length === 0) { - return null - } - - versions = filterValidVersions(versions, { ignoreNonVersions }) - - return compareHelper({ semverTest : semver.lt, timeverTest : (a, b) => a.localeCompare(b) < 0, versions }) -} - -const minVersion = ({ ignoreNonVersions, versions }) => { - if (!versions || versions.length === 0) { - return null - } - - versions = filterValidVersions(versions, { ignoreNonVersions }) - - return compareHelper({ semverTest : semver.gt, timeverTest : (a, b) => a.localeCompare(b) > 0, versions }) -} - -const filterValidVersions = (versions, { ignoreNonVersions }) => { - versions = versions.filter((version) => { - const valid = semver.valid(version) !== null - - if (valid === false) { - if (ignoreNonVersions === true) { - return false - } - else { - throw new Error(`'${version}' is not a valid semver.`) - } - } - - return true - }) - - return versions -} - -export { maxVersion, minVersion } From 80d398ad0bb02eea3ba6a68e520289ad7cd61058 Mon Sep 17 00:00:00 2001 From: Zane Rockenbaugh Date: Sun, 12 Oct 2025 14:32:12 -0500 Subject: [PATCH 2/9] test additional X-range, hyphen range, tilde range, and caret range with bugifx in our X-range RE --- src/constants.mjs | 4 ++-- src/min-version-string.mjs | 1 + src/test/min-version-string.test.mjs | 21 +++++++++++++++++---- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/constants.mjs b/src/constants.mjs index 94ff706..7b65167 100644 --- a/src/constants.mjs +++ b/src/constants.mjs @@ -1,5 +1,5 @@ export const xRangeRE = // v single tuple v doublpe tuple v triple tuple v quad/pre-release tuple // v if there's more than a single digit, it can't lead with a zero - /^(?:[x*]|[1-9]?[0-9]+\.[x*]|(?:[1-9]?[0-9]+\.){2}[x*]|(?:[1-9]?[0-9]+\.){2}[1-9]?[0-9]+-(?:alpha|beta|rc)\.[x*])$/ -export const prereleaseXRangeRE = /^(?:[1-9]?[0-9]+\.){2}[1-9]?[0-9]+-(?:alpha|beta|rc)\.[x*]$/ + /^(?:[Xx*]|[1-9]?[0-9]+\.[Xx*]|(?:[1-9]?[0-9]+\.){2}[Xx*]|(?:[1-9]?[0-9]+\.){2}[1-9]?[0-9]+-(?:alpha|beta|rc)\.[Xx*])$/ +export const prereleaseXRangeRE = /^(?:[1-9]?[0-9]+\.){2}[1-9]?[0-9]+-(?:alpha|beta|rc)\.[Xx*]$/ diff --git a/src/min-version-string.mjs b/src/min-version-string.mjs index 5053de8..c90b6d2 100644 --- a/src/min-version-string.mjs +++ b/src/min-version-string.mjs @@ -6,6 +6,7 @@ const minVersionString = (range, options) => { options = setDefaultOptions(options) // given range '1.0.0-alpha.x', semver treats that as a specific version and says the min version is // '1.0.0-alpha.x' even when 'options.includePrerelease' is true; this is verified in the unit tests. + console.log(`********\nrange: ${range}\noptions: ${JSON.stringify(options)}\n********`) // DEBUG if (options.includePrerelease === true && range.match(prereleaseXRangeRE)) { return range.slice(0, -1) + '0' } diff --git a/src/test/min-version-string.test.mjs b/src/test/min-version-string.test.mjs index 7b10fd8..441cdcc 100644 --- a/src/test/min-version-string.test.mjs +++ b/src/test/min-version-string.test.mjs @@ -10,18 +10,31 @@ describe('minVersionString', () => { }) test.each([ + // X-ranges ['*', '0.0.0'], ['1.*', '1.0.0'], ['1.0.*', '1.0.0'], - ['1.0.0-alpha.*', '1.0.0-alpha.0'], - ['1.0.0-beta.*', '1.0.0-beta.0'], - ['1.0.0-rc.*', '1.0.0-rc.0'], ['x', '0.0.0'], ['1.x', '1.0.0'], ['1.0.x', '1.0.0'], + ['X', '0.0.0'], + // prerelease X-ranges ['1.0.0-alpha.x', '1.0.0-alpha.0'], ['1.0.0-beta.x', '1.0.0-beta.0'], ['1.0.0-rc.x', '1.0.0-rc.0'], - ['1.0.0 - 2', '1.0.0'] + ['1.0.0-alpha.X', '1.0.0-alpha.0'], + ['1.0.0-alpha.*', '1.0.0-alpha.0'], + // hyphen ranges + ['1.0.0 - 2', '1.0.0'], + // tilde ranges + ['~1.2.3', '1.2.3'], + ['~1.2', '1.2.0'], + ['~1', '1.0.0'], + ['~1.2.3-alpha.2', '1.2.3-alpha.2'], + // caret ranges + ['^1.2.3', '1.2.3'], + ['^1.2', '1.2.0'], + ['^1', '1.0.0'], + ['^1.2.3-alpha.2', '1.2.3-alpha.2'], ])('%s => %s', (input, expected) => expect(minVersionString(input)).toBe(expected)) }) From 8abeb072ac0630470bacb491e90f7f12c41b531c Mon Sep 17 00:00:00 2001 From: Zane Rockenbaugh Date: Mon, 13 Oct 2025 18:49:05 -0500 Subject: [PATCH 3/9] added jsdoc generation support and documented most functions; combined our 'minVersion()' overrride logic and removed specific string returning version --- README.md | 694 ++++++++++++++ jsdoc.config.json | 17 + make/55-readme-md.mk | 15 + package-lock.json | 856 +++++++++++++++++- package.json | 7 +- src/doc/README.01.md | 1 + src/doc/README.02.md | 0 src/filter-valid-versions.mjs | 34 +- src/index.js | 3 + src/lib/compare-helper.mjs | 24 +- src/lib/set-default-options.mjs | 12 +- src/max-satisfying-version-string.mjs | 2 +- src/min-satisfying-version-string.mjs | 10 +- src/min-version-string.mjs | 38 +- src/next-version.mjs | 21 +- src/semver-comparison-ops.mjs | 39 +- src/semver-range-ops.mjs | 35 +- src/semver-version-ops.mjs | 22 +- .../max-satisfying-version-string.test.mjs | 39 +- src/test/min-version-string.test.mjs | 11 +- src/upper-bound.mjs | 1 + src/x-sort.mjs | 3 + 22 files changed, 1727 insertions(+), 157 deletions(-) create mode 100644 README.md create mode 100644 jsdoc.config.json create mode 100644 make/55-readme-md.mk create mode 100644 src/doc/README.01.md create mode 100644 src/doc/README.02.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..dd5bf4c --- /dev/null +++ b/README.md @@ -0,0 +1,694 @@ +# semver-plus +## API reference +_API generated with [dmd-readme-api](https://www.npmjs.com/package/dmd-readme-api)._ + + +- Functions: + - _Comparison operations_ + - [`cmp()`](#cmp): Returns a number indicating whether a version is greater than, equal to, or less than another version. + - [`compare()`](#compare): Returns 0 if `v1 == v2`, 1 if `v1 > v2`, and -1 if `v1 < v2`. + - [`compareBuild()`](#compareBuild): Same as [compare](#compare) except it compares build if two versions are otherwise equal. + - [`compareLoose()`](#compareLoose): Short for [compare](#compare) with `options.loose = true`. + - [`diff()`](#diff): Returns the difference between two versions. + - [`eq()`](#eq): Returns `true` if `v1` is equal to `v2`, `false` otherwise. + - [`gt()`](#gt): Returns `true` if `v1` is greater than `v2`, `false` otherwise. + - [`gte()`](#gte): Returns `true` if `v1` is greater than or equal to `v2`, `false` otherwise. + - [`lt()`](#lt): Returns `true` if `v1` is less than `v2`, `false` otherwise. + - [`lte()`](#lte): Returns `true` if `v1` is less than or equal to `v2`, `false` otherwise. + - [`neq()`](#neq): Returns `true` if `v1` is not equal to `v2`, `false` otherwise. + - [`rcompare()`](#rcompare): Reverse of [compare](#compare). + - [`rsort()`](#rsort): Sorts an array of versions in descending order using [compareBuild](#compareBuild). + - [`sort()`](#sort): Sorts an array of versions in ascending order using [compareBuild](#compareBuild). + - _Range operations_ + - [`gtr()`](#gtr): Returns `true` if `version` is greater than is greater than any version in `range`, `false` otherwise. + - [`intersects()`](#intersects): Returns `true` if any of the comparators in the range intersect with each other. + - [`ltr()`](#ltr): Returns `true` if `version` is less than is less than any version in `range`, `false` otherwise. + - [`maxSatisfying()`](#maxSatisfying): Returns the highest version in `versions` that satisfies the range, or null if no version satisfies the range. + - [`minSatisfying()`](#minSatisfying): Returns the lowest version in `versions` that satisfies the range, or null if no version satisfies the range. + - [`minVersion()`](#minVersion): Returns the lowest version that satisfies the range, or null if no version satisfies the range. + - [`outside()`](#outside): Returns `true` if `version` is outside of `range` in the indicated direction, `false` otherwise. + - [`satisfies()`](#satisfies): Returns `true` if the version satisfies the range, `false` otherwise. + - [`simplifyRange()`](#simplifyRange): Return a "simplified" range that matches the same items in the versions list as the range specified. + - [`subset()`](#subset): Returns `true` if `subRange` is a subset of `superRange`, `false` otherwise. + - [`validRange()`](#validRange): Returns a parsed, normalized range string or null if the range is invalid. + - [`maxSatisfyingVersionString()`](#maxSatisfyingVersionString): Like [maxVersion](maxVersion) but returns a string instead of a version object. + - [`minSatisfyingVersionString()`](#minSatisfyingVersionString): Like [minVersion](#minVersion) but returns a string instead of a version object. + - [`upperBound()`](#upperBound): Finds the ceiling of a range. + - [`xSort()`](#xSort): Ascend sorts a mix of semver versions and x-range specified ranges (e.g., 1.2.* or 1.2.x). + - _Version operations_ + - [`clean()`](#clean): Returns a cleaned version string removing unecessary comparators and, if `options.loose` is true, fixing space issues. + - [`coerce()`](#coerce): Aggressively attempts to coerce a string into a valid semver string. + - [`inc()`](#inc): Returns a new version string incremented by the specified part. + - [`major()`](#major): Returns the major version number. + - [`minor()`](#minor): Returns the minor version number. + - [`nextVersion()`](#nextVersion): Given a current version generates the next version string accourding to `increment`. + - [`parse()`](#parse): Attempts to parse and normalize a string as a semver string. + - [`patch()`](#patch): Returns the patch version number. + - [`prerelease()`](#prerelease): Returns an array of prerelease components or `null` if the version is not a prerelease. + - [`valid()`](#valid): Returns a parsed, normalized version string or null if the version is invalid. + + +### `cmp(v1, comparator, v2, options)` ⇒ `number` [source code](./src/semver-comparison-ops.mjs#L87) [global index](#global-function-index) + +Returns a number indicating whether a version is greater than, equal to, or less than another version. + + +| Param | Type | Description | +| --- | --- | --- | +| `v1` | `string` | The first version to compare. | +| `comparator` | `string` | The comparator to use. May be '<', '<=', '>', '>=', '=', '==', '!=', '===', or '!=='. An exception is thrown if an invalid comparator is provided. | +| `v2` | `string` | The second version to compare. | +| `options` | `object` | The options to pass to the semver.cmp function. | +| `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | + +**Returns**: `number` - - A number indicating whether a version is greater than, equal to, or less than another version. + +__Category__: [Comparison operations](#global-function-Comparison-operations-index) + + +### `compare(v1, v2, options)` ⇒ `number` [source code](./src/semver-comparison-ops.mjs#L100) [global index](#global-function-index) + +Returns 0 if `v1 == v2`, 1 if `v1 > v2`, and -1 if `v1 < v2`. Will sort an array of versions in ascending order if +passed to `Array.sort()`. + + +| Param | Type | Description | +| --- | --- | --- | +| `v1` | `string` | The first version to compare. | +| `v2` | `string` | The second version to compare. | +| `options` | `object` | The options to pass to the semver.compare function. | +| `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | + +**Returns**: `number` - - 0 if `v1 == v2`, 1 if `v1 > v2`, and -1 if `v1 < v2`. + +__Category__: [Comparison operations](#global-function-Comparison-operations-index) + + +### `compareBuild(v1, v2, options)` ⇒ `number` [source code](./src/semver-comparison-ops.mjs#L112) [global index](#global-function-index) + +Same as [compare](#compare) except it compares build if two versions are otherwise equal. + + +| Param | Type | Description | +| --- | --- | --- | +| `v1` | `string` | The first version to compare. | +| `v2` | `string` | The second version to compare. | +| `options` | `object` | The options to pass to the semver.compareBuild function. | +| `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | + +**Returns**: `number` - - 0 if `v1 == v2`, 1 if `v1 > v2`, and -1 if `v1 < v2`. + +__Category__: [Comparison operations](#global-function-Comparison-operations-index) + + +### `compareLoose(v1, v2)` ⇒ `number` [source code](./src/semver-comparison-ops.mjs#L134) [global index](#global-function-index) + +Short for [compare](#compare) with `options.loose = true`. + + +| Param | Type | Description | +| --- | --- | --- | +| `v1` | `string` | The first version to compare. | +| `v2` | `string` | The second version to compare. | + +**Returns**: `number` - - 0 if `v1 == v2`, 1 if `v1 > v2`, and -1 if `v1 < v2`. + +__Category__: [Comparison operations](#global-function-Comparison-operations-index) + + +### `diff(v1, v2, options)` ⇒ `string` \| `null` [source code](./src/semver-comparison-ops.mjs#L148) [global index](#global-function-index) + +Returns the difference between two versions. I.e., the most significant version component by which `v1` and `v2` +differ. + + +| Param | Type | Description | +| --- | --- | --- | +| `v1` | `string` | The first version to compare. | +| `v2` | `string` | The second version to compare. | +| `options` | `object` | The options to pass to the semver.diff function. | +| `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | + +**Returns**: `string` \| `null` - - `major`, 'minor', 'patch', 'prerelease', 'premajor', 'preminor', or 'prepatch' or null if +the `v1` and `v2` are identical (disregarding build metadata). + +__Category__: [Comparison operations](#global-function-Comparison-operations-index) + + +### `eq(v1, v2, options)` ⇒ `boolean` [source code](./src/semver-comparison-ops.mjs#L61) [global index](#global-function-index) + +Returns `true` if `v1` is equal to `v2`, `false` otherwise. + + +| Param | Type | Description | +| --- | --- | --- | +| `v1` | `string` | The first version to compare. | +| `v2` | `string` | The second version to compare. | +| `options` | `object` | The options to pass to the semver.eq function. | +| `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | + +**Returns**: `boolean` - - `true` if `v1` is equal to `v2`, `false` otherwise. + +__Category__: [Comparison operations](#global-function-Comparison-operations-index) + + +### `gt(v1, v2, options)` ⇒ `boolean` [source code](./src/semver-comparison-ops.mjs#L13) [global index](#global-function-index) + +Returns `true` if `v1` is greater than `v2`, `false` otherwise. + + +| Param | Type | Description | +| --- | --- | --- | +| `v1` | `string` | The first version to compare. | +| `v2` | `string` | The second version to compare. | +| `options` | `object` | The options to pass to the semver.gt function. | +| `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | + +**Returns**: `boolean` - - `true` if `v1` is greater than `v2`, `false` otherwise. + +__Category__: [Comparison operations](#global-function-Comparison-operations-index) + + +### `gte(v1, v2, options)` ⇒ `boolean` [source code](./src/semver-comparison-ops.mjs#L25) [global index](#global-function-index) + +Returns `true` if `v1` is greater than or equal to `v2`, `false` otherwise. + + +| Param | Type | Description | +| --- | --- | --- | +| `v1` | `string` | The first version to compare. | +| `v2` | `string` | The second version to compare. | +| `options` | `object` | The options to pass to the semver.gte function. | +| `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | + +**Returns**: `boolean` - - `true` if `v1` is greater than or equal to `v2`, `false` otherwise. + +__Category__: [Comparison operations](#global-function-Comparison-operations-index) + + +### `lt(v1, v2, options)` ⇒ `boolean` [source code](./src/semver-comparison-ops.mjs#L37) [global index](#global-function-index) + +Returns `true` if `v1` is less than `v2`, `false` otherwise. + + +| Param | Type | Description | +| --- | --- | --- | +| `v1` | `string` | The first version to compare. | +| `v2` | `string` | The second version to compare. | +| `options` | `object` | The options to pass to the semver.lt function. | +| `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | + +**Returns**: `boolean` - - `true` if `v1` is less than `v2`, `false` otherwise. + +__Category__: [Comparison operations](#global-function-Comparison-operations-index) + + +### `lte(v1, v2, options)` ⇒ `boolean` [source code](./src/semver-comparison-ops.mjs#L49) [global index](#global-function-index) + +Returns `true` if `v1` is less than or equal to `v2`, `false` otherwise. + + +| Param | Type | Description | +| --- | --- | --- | +| `v1` | `string` | The first version to compare. | +| `v2` | `string` | The second version to compare. | +| `options` | `object` | The options to pass to the semver.lte function. | +| `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | + +**Returns**: `boolean` - - `true` if `v1` is less than or equal to `v2`, `false` otherwise. + +__Category__: [Comparison operations](#global-function-Comparison-operations-index) + + +### `neq(v1, v2, options)` ⇒ `boolean` [source code](./src/semver-comparison-ops.mjs#L73) [global index](#global-function-index) + +Returns `true` if `v1` is not equal to `v2`, `false` otherwise. + + +| Param | Type | Description | +| --- | --- | --- | +| `v1` | `string` | The first version to compare. | +| `v2` | `string` | The second version to compare. | +| `options` | `object` | The options to pass to the semver.neq function. | +| `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | + +**Returns**: `boolean` - - `true` if `v1` is not equal to `v2`, `false` otherwise. + +__Category__: [Comparison operations](#global-function-Comparison-operations-index) + + +### `rcompare(v1, v2, options)` ⇒ `number` [source code](./src/semver-comparison-ops.mjs#L124) [global index](#global-function-index) + +Reverse of [compare](#compare). + + +| Param | Type | Description | +| --- | --- | --- | +| `v1` | `string` | The first version to compare. | +| `v2` | `string` | The second version to compare. | +| `options` | `object` | The options to pass to the semver.rcompare function. | +| `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | + +**Returns**: `number` - - 0 if `v1 == v2`, -1 if `v1 > v2`, and 1 if `v1 < v2`. + +__Category__: [Comparison operations](#global-function-Comparison-operations-index) + + +### `rsort(versions, options)` ⇒ `Array.` [source code](./src/semver-comparison-ops.mjs#L170) [global index](#global-function-index) + +Sorts an array of versions in descending order using [compareBuild](#compareBuild). + + +| Param | Type | Description | +| --- | --- | --- | +| `versions` | `Array.` | The versions to sort. | +| `options` | `object` | The options to pass to the semver.rsort function. | +| `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | + +**Returns**: `Array.` - - The sorted versions. + +__Category__: [Comparison operations](#global-function-Comparison-operations-index) + + +### `sort(versions, options)` ⇒ `Array.` [source code](./src/semver-comparison-ops.mjs#L159) [global index](#global-function-index) + +Sorts an array of versions in ascending order using [compareBuild](#compareBuild). + + +| Param | Type | Description | +| --- | --- | --- | +| `versions` | `Array.` | The versions to sort. | +| `options` | `object` | The options to pass to the semver.sort function. | +| `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | + +**Returns**: `Array.` - - The sorted versions. + +__Category__: [Comparison operations](#global-function-Comparison-operations-index) + + +### `gtr(version, range, options)` ⇒ `boolean` [source code](./src/semver-range-ops.mjs#L62) [global index](#global-function-index) + +Returns `true` if `version` is greater than is greater than any version in `range`, `false` otherwise. + + +| Param | Type | Description | +| --- | --- | --- | +| `version` | `string` | The version to check. | +| `range` | `string` | The range to check. | +| `options` | `object` | The options to pass to the semver.gtr function. | +| `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | + +**Returns**: `boolean` - - `true` if `version` is greater than is greater than any version in `range`, `false` otherwise. + +__Category__: [Range operations](#global-function-Range-operations-index) + + +### `intersects(range, options)` ⇒ `boolean` [source code](./src/semver-range-ops.mjs#L99) [global index](#global-function-index) + +Returns `true` if any of the comparators in the range intersect with each other. + + +| Param | Type | Description | +| --- | --- | --- | +| `range` | `string` | The first version range or comparator. | +| `options` | `object` | The options to pass to the semver.intersects function. | +| `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | + +**Returns**: `boolean` - - `true` if any of the comparators in the range intersect with each other, `false` otherwise. + +__Category__: [Range operations](#global-function-Range-operations-index) + + +### `ltr(version, range, options)` ⇒ `boolean` [source code](./src/semver-range-ops.mjs#L74) [global index](#global-function-index) + +Returns `true` if `version` is less than is less than any version in `range`, `false` otherwise. + + +| Param | Type | Description | +| --- | --- | --- | +| `version` | `string` | The version to check. | +| `range` | `string` | The range to check. | +| `options` | `object` | The options to pass to the semver.ltr function. | +| `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | + +**Returns**: `boolean` - - `true` if `version` is less than is less than any version in `range`, `false` otherwise. + +__Category__: [Range operations](#global-function-Range-operations-index) + + +### `maxSatisfying(versions, range, options)` ⇒ `string` \| `null` [source code](./src/semver-range-ops.mjs#L38) [global index](#global-function-index) + +Returns the highest version in `versions` that satisfies the range, or null if no version satisfies the range. + + +| Param | Type | Description | +| --- | --- | --- | +| `versions` | `Array.` | The versions to check. | +| `range` | `string` | The range to check. | +| `options` | `object` | The options to pass to the semver.maxSatisfying function. | +| `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | + +**Returns**: `string` \| `null` - - The highest version that satisfies the range, or null if no version satisfies the range. + +__Category__: [Range operations](#global-function-Range-operations-index) + + +### `minSatisfying(versions, range, options)` ⇒ `string` \| `null` [source code](./src/semver-range-ops.mjs#L50) [global index](#global-function-index) + +Returns the lowest version in `versions` that satisfies the range, or null if no version satisfies the range. + + +| Param | Type | Description | +| --- | --- | --- | +| `versions` | `Array.` | The versions to check. | +| `range` | `string` | The range to check. | +| `options` | `object` | The options to pass to the semver.minSatisfying function. | +| `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | + +**Returns**: `string` \| `null` - - The lowest version that satisfies the range, or null if no version satisfies the range. + +__Category__: [Range operations](#global-function-Range-operations-index) + + +### `minVersion(range, options)` ⇒ `string` \| `null` [source code](./src/min-version-string.mjs#L18) [global index](#global-function-index) + +Returns the lowest version that satisfies the range, or null if no version satisfies the range. This implementation +differs from the base `semver.minVersion` in that it correctly handles simple prerelease x-ranges. E.g., +'1.0.0-alpha.x' -> '1.0.0-alpha.0'. To suppress this behavior, pass `options.compat = true`. + + +| Param | Type | Description | +| --- | --- | --- | +| `range` | `string` | The range to check. | +| `options` | `object` | The options to pass to the semver.minVersion function. | +| `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | +| `options.includePrerelease` | `boolean` | Whether to include prerelease versions. | +| `options.compat` | `boolean` | If true, prerelease ranges are treated the same as in the base semver package; e.g. `minVersion('1.0.0-alpha.x', { compat: true })` -> '1.0.0-alpha.x'. | + +**Returns**: `string` \| `null` - - The lowest version that satisfies the range, or null if no version satisfies the range. + +__Category__: [Range operations](#global-function-Range-operations-index) + + +### `outside(version, range, direction, options)` ⇒ `boolean` [source code](./src/semver-range-ops.mjs#L88) [global index](#global-function-index) + +Returns `true` if `version` is outside of `range` in the indicated direction, `false` otherwise. `outside(v, r, '>)` +is equivalent to `gtr(v, r)`. + + +| Param | Type | Description | +| --- | --- | --- | +| `version` | `string` | The version to check. | +| `range` | `string` | The range to check. | +| `direction` | `string` | The direction to check. Must be '>' or '<'. | +| `options` | `object` | The options to pass to the semver.outside function. | +| `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | + +**Returns**: `boolean` - - `true` if `version` is outside of `range` in the indicated direction, `false` otherwise. + +__Category__: [Range operations](#global-function-Range-operations-index) + + +### `satisfies(version, range, options)` ⇒ `boolean` [source code](./src/semver-range-ops.mjs#L26) [global index](#global-function-index) + +Returns `true` if the version satisfies the range, `false` otherwise. + + +| Param | Type | Description | +| --- | --- | --- | +| `version` | `string` | The version to check. | +| `range` | `string` | The range to check. | +| `options` | `object` | The options to pass to the semver.satisfies function. | +| `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | + +**Returns**: `boolean` - - `true` if the version satisfies the range, `false` otherwise. + +__Category__: [Range operations](#global-function-Range-operations-index) + + +### `simplifyRange(versions, range, options)` ⇒ `string` [source code](./src/semver-range-ops.mjs#L115) [global index](#global-function-index) + +Return a "simplified" range that matches the same items in the versions list as the range specified. Note that it +does not guarantee that it would match the same versions in all cases, only for the set of versions provided. This +is useful when generating ranges by joining together multiple versions with || programmatically, to provide the user +with something a bit more ergonomic. If the provided range is shorter in string-length than the generated range, +then that is returned. + + +| Param | Type | Description | +| --- | --- | --- | +| `versions` | `Array.` | The versions to check. | +| `range` | `string` | The range to simplify. | +| `options` | `object` | The options to pass to the semver.simplifyRange function. | +| `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | + +**Returns**: `string` - - The simplified range. + +__Category__: [Range operations](#global-function-Range-operations-index) + + +### `subset(subRange, superRange, options)` ⇒ `boolean` [source code](./src/semver-range-ops.mjs#L127) [global index](#global-function-index) + +Returns `true` if `subRange` is a subset of `superRange`, `false` otherwise. + + +| Param | Type | Description | +| --- | --- | --- | +| `subRange` | `string` | The sub-range to check. | +| `superRange` | `string` | The super-range to check. | +| `options` | `object` | The options to pass to the semver.subset function. | +| `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | + +**Returns**: `boolean` - - `true` if `subRange` is a subset of `superRange`, `false` otherwise. + +__Category__: [Range operations](#global-function-Range-operations-index) + + +### `validRange(range, options)` ⇒ `string` \| `null` [source code](./src/semver-range-ops.mjs#L14) [global index](#global-function-index) + +Returns a parsed, normalized range string or null if the range is invalid. + + +| Param | Type | Description | +| --- | --- | --- | +| `range` | `string` | The range to parse. | +| `options` | `object` | The options to pass to the semver.validRange function. | +| `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | + +**Returns**: `string` \| `null` - - The parsed, normalized range string or null if the range is invalid. + +__Category__: [Range operations](#global-function-Range-operations-index) + + +### `maxSatisfyingVersionString(versions, options)` ⇒ `string` \| `null` [source code](./src/max-satisfying-version-string.mjs#L13) [global index](#global-function-index) + +Like [maxVersion](maxVersion) but returns a string instead of a version object. + + +| Param | Type | Description | +| --- | --- | --- | +| `versions` | `Array.` | The versions to compare. | +| `options` | `object` | The options to pass to the compareHelper function. | +| `options.ignoreNonVersions` | `boolean` | Whether to ignore non-version strings. | + +**Returns**: `string` \| `null` - - The maximum version string or null if no version strings are provided. + + +### `minSatisfyingVersionString(versions, options)` ⇒ `string` \| `null` [source code](./src/min-satisfying-version-string.mjs#L13) [global index](#global-function-index) + +Like [minVersion](#minVersion) but returns a string instead of a version object. + + +| Param | Type | Description | +| --- | --- | --- | +| `versions` | `Array.` | The versions to compare. | +| `options` | `object` | The options to pass to the compareHelper function. | +| `options.ignoreNonVersions` | `boolean` | Whether to ignore non-version strings. | + +**Returns**: `string` \| `null` - - The minimum version string or null if no version strings are provided. + + +### `upperBound(range)` ⇒ `string` [source code](./src/upper-bound.mjs#L10) [global index](#global-function-index) + +Finds the ceiling of a range. For '*', the ceiling is '*'. For specific versions or any range capped by a specific +version, the ceiling is that version. For any open-ended range, the ceiling is defined by a '-0' range +function where 'verision-0' least range above the given range. + + +| Param | Type | Description | +| --- | --- | --- | +| `range` | `string` | The range to find the ceiling for. | + +**Returns**: `string` - - Either '*', a specific version, or a '-0'. + + +### `xSort()` [source code](./src/x-sort.mjs#L9) [global index](#global-function-index) + +Ascend sorts a mix of semver versions and x-range specified ranges (e.g., 1.2.* or 1.2.x). The ranges are sorted according to their highest version; e.g., 1.3.34 < 1.3.*. (I believe it can accept caret ranges too, but I would need to review the spec.) + + +### `clean(version, options)` ⇒ `string` \| `null` [source code](./src/semver-version-ops.mjs#L109) [global index](#global-function-index) + +Returns a cleaned version string removing unecessary comparators and, if `options.loose` is true, fixing space +issues. Only works for versions, not ranges. + + +| Param | Type | Description | +| --- | --- | --- | +| `version` | `string` | The version to clean. | +| `options` | `object` | The options to pass to the semver.clean function. | +| `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | + +**Returns**: `string` \| `null` - - The cleaned version string or null if the version is invalid. + +__Category__: [Version operations](#global-function-Version-operations-index) + + +### `coerce(version, options)` ⇒ `string` \| `null` [source code](./src/semver-version-ops.mjs#L97) [global index](#global-function-index) + +Aggressively attempts to coerce a string into a valid semver string. Basically, starting from the left side of the +string, it looks for a digit and then includes anything to the right of the digit that looks like part of a semver. +So, 'Number 1!' -> '1.0.0', 'Upgrade 1.2 to 1.3' -> '1.2.0', etc. + + +| Param | Type | Description | +| --- | --- | --- | +| `version` | `string` | The version to coerce. | +| `options` | `object` | The options to pass to the semver.coerce function. | +| `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | +| `options.includePrerelease` | `boolean` | Unless true, prerelease tags (and build metadata) are stripped. If | +| `options.rtl` | `boolean` | Instead of searching for a digit from the left, start searching from the right. true, then they are preserved. | + +**Returns**: `string` \| `null` - - The coerced version string or null if the version is invalid. + +__Category__: [Version operations](#global-function-Version-operations-index) + + +### `inc(version, increment, options, identifier, identifierBase)` ⇒ `string` [source code](./src/semver-version-ops.mjs#L29) [global index](#global-function-index) + +Returns a new version string incremented by the specified part. + + +| Param | Type | Description | +| --- | --- | --- | +| `version` | `string` | The version to increment. | +| `increment` | `string` | The increment to use. | +| `options` | `object` | The options to pass to the semver.inc function. | +| `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | +| `options.includePrerelease` | `boolean` | Whether to include prerelease versions. | +| `identifier` | `string` | Used to specify the prerelease name for prerelease increments. | +| `identifierBase` | `false` \| `0` \| `1` | When incrementing to a new prerelease name, specifies the base number or `false` for no number. | + +**Returns**: `string` - - The new version string. + +__Category__: [Version operations](#global-function-Version-operations-index) + + +### `major(version, options)` ⇒ `number` [source code](./src/semver-version-ops.mjs#L52) [global index](#global-function-index) + +Returns the major version number. + + +| Param | Type | Description | +| --- | --- | --- | +| `version` | `string` | The version to parse. | +| `options` | `object` | The options to pass to the semver.major function. | +| `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | + +**Returns**: `number` - - The major version number. + +__Category__: [Version operations](#global-function-Version-operations-index) + + +### `minor(version, options)` ⇒ `number` [source code](./src/semver-version-ops.mjs#L63) [global index](#global-function-index) + +Returns the minor version number. + + +| Param | Type | Description | +| --- | --- | --- | +| `version` | `string` | The version to parse. | +| `options` | `object` | The options to pass to the semver.minor function. | +| `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | + +**Returns**: `number` - - The minor version number. + +__Category__: [Version operations](#global-function-Version-operations-index) + + +### `nextVersion(currVer, increment)` ⇒ `string` [source code](./src/next-version.mjs#L23) [global index](#global-function-index) + +Given a current version generates the next version string accourding to `increment`. This method is similar to +[inc](#inc) from the [base semver library](https://semver.org) with two differences. +1) It supports a specific pre-release sequence prototype -> 'alpha' -> 'beta' -> 'rc' -> released and the 'pretype' + increment will advance the prerelease ID through these stages. +2) The 'prerelease' increment can only be used to advance the prerelease version number and does not function as + 'prepatch' on a non-prerelease version. + + +| Param | Type | Description | +| --- | --- | --- | +| `currVer` | `string` | The current version to increment. | +| `increment` | `string` | The increment to use. | + +**Returns**: `string` - - The next version string. + +__Category__: [Version operations](#global-function-Version-operations-index) + + +### `parse()` [source code](./src/semver-version-ops.mjs#L81) [global index](#global-function-index) + +Attempts to parse and normalize a string as a semver string. An aliase for [valid](#valid). + +__Category__: [Version operations](#global-function-Version-operations-index) + + +### `patch(version, options)` ⇒ `number` [source code](./src/semver-version-ops.mjs#L74) [global index](#global-function-index) + +Returns the patch version number. + + +| Param | Type | Description | +| --- | --- | --- | +| `version` | `string` | The version to parse. | +| `options` | `object` | The options to pass to the semver.patch function. | +| `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | + +**Returns**: `number` - - The patch version number. + +__Category__: [Version operations](#global-function-Version-operations-index) + + +### `prerelease(version, options)` ⇒ `Array.` \| `null` [source code](./src/semver-version-ops.mjs#L41) [global index](#global-function-index) + +Returns an array of prerelease components or `null` if the version is not a prerelease. A 'component' is just a '.' +separated string. + + +| Param | Type | Description | +| --- | --- | --- | +| `version` | `string` | The version to parse. | +| `options` | `object` | The options to pass to the semver.inc function. | +| `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | + +**Returns**: `Array.` \| `null` - - The prerelease components or `null` if the version is not a prerelease. + +__Category__: [Version operations](#global-function-Version-operations-index) + + +### `valid(version, options)` ⇒ `string` \| `null` [source code](./src/semver-version-ops.mjs#L13) [global index](#global-function-index) + +Returns a parsed, normalized version string or null if the version is invalid. + + +| Param | Type | Description | +| --- | --- | --- | +| `version` | `string` | The version to parse. | +| `options` | `object` | The options to pass to the semver.valid function. | +| `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | +| `options.includePrerelease` | `boolean` | Whether to include prerelease versions. | + +**Returns**: `string` \| `null` - - The parsed, normalized version string or null if the version is invalid. + +__Category__: [Version operations](#global-function-Version-operations-index) + diff --git a/jsdoc.config.json b/jsdoc.config.json new file mode 100644 index 0000000..ade88fc --- /dev/null +++ b/jsdoc.config.json @@ -0,0 +1,17 @@ +{ + "plugins": ["dmd-readme-api"], + "recurseDepth": 10, + "source": { + "includePattern": ".+\\.(c|m)?js(doc|x)?$", + "excludePattern": "((^|\\/|\\\\)_|.+\\.test\\.(c|m)?jsx?$)" + }, + "sourceType": "module", + "tags": { + "allowUnknownTags": true, + "dictionaries": ["jsdoc","closure"] + }, + "templates": { + "cleverLinks": true, + "monospaceLinks": true + } +} \ No newline at end of file diff --git a/make/55-readme-md.mk b/make/55-readme-md.mk new file mode 100644 index 0000000..da86b5a --- /dev/null +++ b/make/55-readme-md.mk @@ -0,0 +1,15 @@ +README_MD:=README.md +README_MD_SRC:=$(shell find $(SRC)/doc -name "*.md") $(SDLC_ALL_NON_TEST_JS_FILES_SRC) +BUILD_TARGETS+=$(README_MD) + +$(README_MD): $(README_MD_SRC) + cp $(SRC)/doc/README.01.md $@ + npx jsdoc2md \ + --files 'src/**/*' \ + --plugin dmd-readme-api \ + --global-index-format grouped \ + --name-format \ + --configure jsdoc.config.json \ + --no-cache \ + >> $@ + cat $(SRC)/doc/README.02.md >> $@ \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 0043893..e2b5dd8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,12 +10,15 @@ "license": "UNLICENSED", "dependencies": { "http-errors": "^2.0.0", - "semver": "^7.3.8" + "semver": "^7.0.0" }, "devDependencies": { + "@liquid-labs/dmd": "^7.1.1", + "@liquid-labs/jsdoc-to-markdown": "^9.1.3", "@liquid-labs/sdlc-resource-babel-and-rollup": "^1.0.0-alpha.5", "@liquid-labs/sdlc-resource-eslint": "^1.0.0-alpha.2", - "@liquid-labs/sdlc-resource-jest": "^1.0.0-alpha.5" + "@liquid-labs/sdlc-resource-jest": "^1.0.0-alpha.5", + "dmd-readme-api": "^1.0.0-beta.8" }, "engines": { "node": ">=18.0.0" @@ -2844,6 +2847,78 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@jsdoc/salty": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/@jsdoc/salty/-/salty-0.2.9.tgz", + "integrity": "sha512-yYxMVH7Dqw6nO0d5NIV8OQWnitU8k6vXH8NtgqAfIa/IUqRMxRv/NUJJ08VEKbAakwxlgBl5PJdrU0dMPStsnw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "lodash": "^4.17.21" + }, + "engines": { + "node": ">=v12.0.0" + } + }, + "node_modules/@liquid-labs/dmd": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@liquid-labs/dmd/-/dmd-7.1.1.tgz", + "integrity": "sha512-J8CKJBwYtGDNwmbUENCamFw+H6OAaaYHIlBS0h2OBNSgECZXU2+hIF+STE2irJTO2nzmuc+De7es7/QcWID58w==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-back": "^6.2.2", + "cache-point": "^3.0.0", + "common-sequence": "^3.0.0", + "file-set": "^5.2.2", + "handlebars": "^4.7.8", + "marked": "^4.3.0", + "regex-repo": "^5.0.1", + "walk-back": "^5.1.1" + }, + "engines": { + "node": ">=12.17" + }, + "peerDependencies": { + "@75lb/nature": "^0.1.10" + }, + "peerDependenciesMeta": { + "@75lb/nature": { + "optional": true + } + } + }, + "node_modules/@liquid-labs/jsdoc-to-markdown": { + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/@liquid-labs/jsdoc-to-markdown/-/jsdoc-to-markdown-9.1.3.tgz", + "integrity": "sha512-NjiqezNbmDLttbUkbJyoglA/Y5ZQrs1HuVBn98UYmuQ9zosb59W71QBoVdAL3kZEy6nLbK2Y80Q1EXGdVdyJMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@liquid-labs/dmd": "^7.1.1", + "array-back": "^6.2.2", + "command-line-args": "^6.0.1", + "command-line-usage": "^7.0.3", + "config-master": "^3.1.0", + "jsdoc-api": "^9.3.5", + "jsdoc-parse": "^6.2.5", + "walk-back": "^5.1.1" + }, + "bin": { + "jsdoc2md": "bin/cli.js" + }, + "engines": { + "node": ">=12.17" + }, + "peerDependencies": { + "@75lb/nature": "^0.1.10" + }, + "peerDependenciesMeta": { + "@75lb/nature": { + "optional": true + } + } + }, "node_modules/@liquid-labs/sdlc-resource-babel-and-rollup": { "version": "1.0.0-alpha.5", "resolved": "https://registry.npmjs.org/@liquid-labs/sdlc-resource-babel-and-rollup/-/sdlc-resource-babel-and-rollup-1.0.0-alpha.5.tgz", @@ -3447,6 +3522,31 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, + "node_modules/@types/linkify-it": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-5.0.0.tgz", + "integrity": "sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/markdown-it": { + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-14.1.2.tgz", + "integrity": "sha512-promo4eFwuiW+TfGxhi+0x3czqTYJkG8qB17ZUJiVF10Xm7NLVRSLUsfRTU/6h1e24VvRnXCx+hG7li58lkzog==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/linkify-it": "^5", + "@types/mdurl": "^2" + } + }, + "node_modules/@types/mdurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-2.0.0.tgz", + "integrity": "sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/node": { "version": "20.10.0", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.0.tgz", @@ -3579,6 +3679,16 @@ "sprintf-js": "~1.0.2" } }, + "node_modules/array-back": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-6.2.2.tgz", + "integrity": "sha512-gUAZ7HPyb4SJczXAMUXMGAvI976JoK3qEx9v1FTmeYuJj0IBiaKttG1ydtGKdkfqWkIkouke7nG8ufGy77+Cvw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.17" + } + }, "node_modules/array-buffer-byte-length": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", @@ -3976,6 +4086,13 @@ "node": ">=8" } }, + "node_modules/bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "dev": true, + "license": "MIT" + }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -3987,12 +4104,13 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, + "license": "MIT", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -4067,6 +4185,27 @@ "semver": "^7.0.0" } }, + "node_modules/cache-point": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/cache-point/-/cache-point-3.0.1.tgz", + "integrity": "sha512-itTIMLEKbh6Dw5DruXbxAgcyLnh/oPGVLBfTPqBOftASxHe8bAeXy7JkO4F0LvHqht7XqP5O/09h5UcHS2w0FA==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-back": "^6.2.2" + }, + "engines": { + "node": ">=12.17" + }, + "peerDependencies": { + "@75lb/nature": "latest" + }, + "peerDependenciesMeta": { + "@75lb/nature": { + "optional": true + } + } + }, "node_modules/call-bind": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", @@ -4127,6 +4266,19 @@ } ] }, + "node_modules/catharsis": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.9.0.tgz", + "integrity": "sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A==", + "dev": true, + "license": "MIT", + "dependencies": { + "lodash": "^4.17.15" + }, + "engines": { + "node": ">= 10" + } + }, "node_modules/chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -4141,6 +4293,98 @@ "node": ">=4" } }, + "node_modules/chalk-template": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/chalk-template/-/chalk-template-0.4.0.tgz", + "integrity": "sha512-/ghrgmhfY8RaSdeo43hNXxpoHAtxdbskUHjPpfqUWGttFgycUhYPGx3YZBCnUCvOa7Doivn1IZec3DEGFoMgLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/chalk-template?sponsor=1" + } + }, + "node_modules/chalk-template/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/chalk-template/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk-template/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/chalk-template/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/chalk-template/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/chalk-template/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/char-regex": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", @@ -4244,6 +4488,46 @@ "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, + "node_modules/command-line-args": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-6.0.1.tgz", + "integrity": "sha512-Jr3eByUjqyK0qd8W0SGFW1nZwqCaNCtbXjRo2cRJC1OYxWl3MZ5t1US3jq+cO4sPavqgw4l9BMGX0CBe+trepg==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-back": "^6.2.2", + "find-replace": "^5.0.2", + "lodash.camelcase": "^4.3.0", + "typical": "^7.2.0" + }, + "engines": { + "node": ">=12.20" + }, + "peerDependencies": { + "@75lb/nature": "latest" + }, + "peerDependenciesMeta": { + "@75lb/nature": { + "optional": true + } + } + }, + "node_modules/command-line-usage": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-7.0.3.tgz", + "integrity": "sha512-PqMLy5+YGwhMh1wS04mVG44oqDsgyLRSKJBdOo1bnYhMKBW65gZF1dRp2OZRhiTjgUHljy99qkO7bsctLaw35Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-back": "^6.2.2", + "chalk-template": "^0.4.0", + "table-layout": "^4.1.0", + "typical": "^7.1.1" + }, + "engines": { + "node": ">=12.20.0" + } + }, "node_modules/commander": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", @@ -4259,6 +4543,16 @@ "integrity": "sha512-YeNK4tavZwtH7jEgK1ZINXzLKm6DZdEMfsaaieOsCAN0S8vsY7UeuO3Q7d/M018EFgE+IeUAuBOKkFccBZsUZA==", "dev": true }, + "node_modules/common-sequence": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/common-sequence/-/common-sequence-3.0.0.tgz", + "integrity": "sha512-g/CgSYk93y+a1IKm50tKl7kaT/OjjTYVQlEbUlt/49ZLV1mcKpUU7iyDiqTAeLdb4QDtQfq3ako8y8v//fzrWQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.17" + } + }, "node_modules/commondir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", @@ -4271,6 +4565,26 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, + "node_modules/config-master": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/config-master/-/config-master-3.1.0.tgz", + "integrity": "sha512-n7LBL1zBzYdTpF1mx5DNcZnZn05CWIdsdvtPL4MosvqbBUK3Rq6VWEtGUuF3Y0s9/CIhMejezqlSkP6TnCJ/9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "walk-back": "^2.0.1" + } + }, + "node_modules/config-master/node_modules/walk-back": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/walk-back/-/walk-back-2.0.1.tgz", + "integrity": "sha512-Nb6GvBR8UWX1D+Le+xUq0+Q1kFmRBIWVrfLnQAOmcpEzA9oAxwJ9gIr36t9TWYfzvWRvuMtjHiVsJYEkXWaTAQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", @@ -4395,6 +4709,16 @@ "node": ">= 8" } }, + "node_modules/current-module-paths": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/current-module-paths/-/current-module-paths-1.1.2.tgz", + "integrity": "sha512-H4s4arcLx/ugbu1XkkgSvcUZax0L6tXUqnppGniQb8l5VjUKGHoayXE5RiriiPhYDd+kjZnaok1Uig13PKtKYQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.17" + } + }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -4507,6 +4831,16 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/dmd-readme-api": { + "version": "1.0.0-beta.8", + "resolved": "https://registry.npmjs.org/dmd-readme-api/-/dmd-readme-api-1.0.0-beta.8.tgz", + "integrity": "sha512-KocOTjjhavStJ5efGIgCmrrAMm/vuVgeJXgF9r+VAlQXQ5tQligdvcJN28RYYeR9Kk0zqBBkMk4zUiBIzPJplg==", + "dev": true, + "license": "Apache 2.0", + "dependencies": { + "extract-topic": "^1.0.0-beta.6" + } + }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -4543,6 +4877,19 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -5393,12 +5740,39 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/extract-topic": { + "version": "1.0.0-beta.6", + "resolved": "https://registry.npmjs.org/extract-topic/-/extract-topic-1.0.0-beta.6.tgz", + "integrity": "sha512-ZvOzCjllNDigyhdX9s+CsChwfyOuk2TlvFmzWWNhwK131Y4dv9A9dhu3jfRln7d+Pgnm6kEL76/iM+PLtUn4ow==", + "dev": true, + "license": "UNLICENSED", + "dependencies": { + "he": "^1.2.0" + } + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, + "node_modules/fast-glob": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -5441,11 +5815,34 @@ "node": "^10.12.0 || >=12.0.0" } }, + "node_modules/file-set": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/file-set/-/file-set-5.3.0.tgz", + "integrity": "sha512-FKCxdjLX0J6zqTWdT0RXIxNF/n7MyXXnsSUp0syLEOCKdexvPZ02lNNv2a+gpK9E3hzUYF3+eFZe32ci7goNUg==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-back": "^6.2.2", + "fast-glob": "^3.3.2" + }, + "engines": { + "node": ">=12.17" + }, + "peerDependencies": { + "@75lb/nature": "latest" + }, + "peerDependenciesMeta": { + "@75lb/nature": { + "optional": true + } + } + }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, + "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -5453,6 +5850,24 @@ "node": ">=8" } }, + "node_modules/find-replace": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-5.0.2.tgz", + "integrity": "sha512-Y45BAiE3mz2QsrN2fb5QEtO4qb44NcS7en/0y9PEVsg351HsLeVclP8QPMH79Le9sH3rs5RSwJu99W0WPZO43Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@75lb/nature": "latest" + }, + "peerDependenciesMeta": { + "@75lb/nature": { + "optional": true + } + } + }, "node_modules/find-root": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", @@ -5667,7 +6082,6 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, - "optional": true, "dependencies": { "is-glob": "^4.0.1" }, @@ -5723,6 +6137,28 @@ "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", "dev": true }, + "node_modules/handlebars": { + "version": "4.7.8", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", + "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.5", + "neo-async": "^2.6.2", + "source-map": "^0.6.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" + }, + "engines": { + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" + } + }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -5804,6 +6240,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "license": "MIT", + "bin": { + "he": "bin/he" + } + }, "node_modules/html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", @@ -6093,6 +6539,7 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.12.0" } @@ -8004,6 +8451,111 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/js2xmlparser": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.2.tgz", + "integrity": "sha512-6n4D8gLlLf1n5mNLQPRfViYzu9RATblzPEtm1SthMX1Pjao0r9YI9nw7ZIfRxQMERS87mcswrg+r/OYrPRX6jA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "xmlcreate": "^2.0.4" + } + }, + "node_modules/jsdoc": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-4.0.5.tgz", + "integrity": "sha512-P4C6MWP9yIlMiK8nwoZvxN84vb6MsnXcHuy7XzVOvQoCizWX5JFCBsWIIWKXBltpoRZXddUOVQmCTOZt9yDj9g==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@babel/parser": "^7.20.15", + "@jsdoc/salty": "^0.2.1", + "@types/markdown-it": "^14.1.1", + "bluebird": "^3.7.2", + "catharsis": "^0.9.0", + "escape-string-regexp": "^2.0.0", + "js2xmlparser": "^4.0.2", + "klaw": "^3.0.0", + "markdown-it": "^14.1.0", + "markdown-it-anchor": "^8.6.7", + "marked": "^4.0.10", + "mkdirp": "^1.0.4", + "requizzle": "^0.2.3", + "strip-json-comments": "^3.1.0", + "underscore": "~1.13.2" + }, + "bin": { + "jsdoc": "jsdoc.js" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/jsdoc-api": { + "version": "9.3.5", + "resolved": "https://registry.npmjs.org/jsdoc-api/-/jsdoc-api-9.3.5.tgz", + "integrity": "sha512-TQwh1jA8xtCkIbVwm/XA3vDRAa5JjydyKx1cC413Sh3WohDFxcMdwKSvn4LOsq2xWyAmOU/VnSChTQf6EF0R8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-back": "^6.2.2", + "cache-point": "^3.0.1", + "current-module-paths": "^1.1.2", + "file-set": "^5.3.0", + "jsdoc": "^4.0.4", + "object-to-spawn-args": "^2.0.1", + "walk-back": "^5.1.1" + }, + "engines": { + "node": ">=12.17" + }, + "peerDependencies": { + "@75lb/nature": "latest" + }, + "peerDependenciesMeta": { + "@75lb/nature": { + "optional": true + } + } + }, + "node_modules/jsdoc-parse": { + "version": "6.2.5", + "resolved": "https://registry.npmjs.org/jsdoc-parse/-/jsdoc-parse-6.2.5.tgz", + "integrity": "sha512-8JaSNjPLr2IuEY4Das1KM6Z4oLHZYUnjRrr27hKSa78Cj0i5Lur3DzNnCkz+DfrKBDoljGMoWOiBVQbtUZJBPw==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-back": "^6.2.2", + "find-replace": "^5.0.1", + "sort-array": "^5.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/jsdoc/node_modules/escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/jsdoc/node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "license": "MIT", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -8046,6 +8598,16 @@ "node": ">=6" } }, + "node_modules/klaw": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz", + "integrity": "sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.1.9" + } + }, "node_modules/kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -8083,6 +8645,16 @@ "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", "dev": true }, + "node_modules/linkify-it": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", + "integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "uc.micro": "^2.0.0" + } + }, "node_modules/locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -8101,6 +8673,13 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "dev": true, + "license": "MIT" + }, "node_modules/lodash.debounce": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", @@ -8165,19 +8744,86 @@ "tmpl": "1.0.5" } }, + "node_modules/markdown-it": { + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz", + "integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1", + "entities": "^4.4.0", + "linkify-it": "^5.0.0", + "mdurl": "^2.0.0", + "punycode.js": "^2.3.1", + "uc.micro": "^2.1.0" + }, + "bin": { + "markdown-it": "bin/markdown-it.mjs" + } + }, + "node_modules/markdown-it-anchor": { + "version": "8.6.7", + "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.7.tgz", + "integrity": "sha512-FlCHFwNnutLgVTflOYHPW2pPcl2AACqVzExlkGQNsi4CJgqOHN7YTgDd4LuhgN1BFO3TS0vLAruV1Td6dwWPJA==", + "dev": true, + "license": "Unlicense", + "peerDependencies": { + "@types/markdown-it": "*", + "markdown-it": "*" + } + }, + "node_modules/markdown-it/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/marked": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", + "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==", + "dev": true, + "license": "MIT", + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/mdurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", + "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==", + "dev": true, + "license": "MIT" + }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, + "license": "MIT", "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { @@ -8262,6 +8908,13 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true, + "license": "MIT" + }, "node_modules/node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -8313,6 +8966,16 @@ "node": ">= 0.4" } }, + "node_modules/object-to-spawn-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object-to-spawn-args/-/object-to-spawn-args-2.0.1.tgz", + "integrity": "sha512-6FuKFQ39cOID+BMZ3QaphcC8Y4cw6LXBLyIgPU+OhIYwviJamPAn+4mITapnSBQrejB+NNp+FMskhD8Cq+Ys3w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/object.assign": { "version": "4.1.4", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", @@ -8634,6 +9297,16 @@ "node": ">=6" } }, + "node_modules/punycode.js": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz", + "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/pure-rand": { "version": "6.0.4", "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.4.tgz", @@ -8731,6 +9404,16 @@ "@babel/runtime": "^7.8.4" } }, + "node_modules/regex-repo": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/regex-repo/-/regex-repo-5.2.0.tgz", + "integrity": "sha512-uctdIywmzsW9Rl64m53qI+UCzaQXQ7boasV/dJgIIdP8mkiS2MOMpfpViCHMZTIFeJohN0p5nYIAzJAeI0Bt5A==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "14.x || 16.x || >=18.0.0" + } + }, "node_modules/regexp.prototype.flags": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz", @@ -8807,6 +9490,16 @@ "node": ">=0.10.0" } }, + "node_modules/requizzle": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.4.tgz", + "integrity": "sha512-JRrFk1D4OQ4SqovXOgdav+K8EAhSB/LJZqCz8tbX0KObcdeM15Ss59ozWMBWmmINMagCwmqn4ZNryUGpBsl6Jw==", + "dev": true, + "license": "MIT", + "dependencies": { + "lodash": "^4.17.21" + } + }, "node_modules/resolve": { "version": "1.22.6", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.6.tgz", @@ -9046,12 +9739,10 @@ } }, "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dependencies": { - "lru-cache": "^6.0.0" - }, + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -9059,22 +9750,6 @@ "node": ">=10" } }, - "node_modules/semver/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/semver/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, "node_modules/serialize-javascript": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", @@ -9165,6 +9840,28 @@ "integrity": "sha512-9LK+E7Hv5R9u4g4C3p+jjLstaLe11MDsL21UpYaCNmapvMkYhqCV4A/f/3gyH8QjMyh6l68q9xC85vihY9ahMQ==", "dev": true }, + "node_modules/sort-array": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/sort-array/-/sort-array-5.1.1.tgz", + "integrity": "sha512-EltS7AIsNlAFIM9cayrgKrM6XP94ATWwXP4LCL4IQbvbYhELSt2hZTrixg+AaQwnWFs/JGJgqU3rxMcNNWxGAA==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-back": "^6.2.2", + "typical": "^7.1.1" + }, + "engines": { + "node": ">=12.17" + }, + "peerDependencies": { + "@75lb/nature": "^0.1.1" + }, + "peerDependenciesMeta": { + "@75lb/nature": { + "optional": true + } + } + }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -9416,6 +10113,20 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/table-layout": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-4.1.1.tgz", + "integrity": "sha512-iK5/YhZxq5GO5z8wb0bY1317uDF3Zjpha0QFFLA8/trAoiLbQD0HUbMesEaxyzUgDxi2QlcbM8IvqOlEjgoXBA==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-back": "^6.2.2", + "wordwrapjs": "^5.1.0" + }, + "engines": { + "node": ">=12.17" + } + }, "node_modules/terser": { "version": "5.21.0", "resolved": "https://registry.npmjs.org/terser/-/terser-5.21.0.tgz", @@ -9492,6 +10203,7 @@ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, + "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, @@ -9638,6 +10350,37 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/typical": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-7.3.0.tgz", + "integrity": "sha512-ya4mg/30vm+DOWfBg4YK3j2WD6TWtRkCbasOJr40CseYENzCUby/7rIvXA99JGsQHeNxLbnXdyLLxKSv3tauFw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.17" + } + }, + "node_modules/uc.micro": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", + "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", + "dev": true, + "license": "MIT" + }, + "node_modules/uglify-js": { + "version": "3.19.3", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", + "integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==", + "dev": true, + "license": "BSD-2-Clause", + "optional": true, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/unbox-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", @@ -9653,6 +10396,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/underscore": { + "version": "1.13.7", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.7.tgz", + "integrity": "sha512-GMXzWtsc57XAtguZgaQViUOzs0KTkk8ojr3/xAxXLITqf/3EMwxC0inyETfDFjH/Krbhuep0HNbbjI9i/q3F3g==", + "dev": true, + "license": "MIT" + }, "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", @@ -9752,6 +10502,16 @@ "node": ">=10.12.0" } }, + "node_modules/walk-back": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/walk-back/-/walk-back-5.1.1.tgz", + "integrity": "sha512-e/FRLDVdZQWFrAzU6Hdvpm7D7m2ina833gIKLptQykRK49mmCYHLHq7UqjPDbxbKLZkTkW1rFqbengdE3sLfdw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.17" + } + }, "node_modules/walker": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", @@ -9811,6 +10571,23 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/wordwrapjs": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-5.1.1.tgz", + "integrity": "sha512-0yweIbkINJodk27gX9LBGMzyQdBDan3s/dEAiwBOj+Mf0PPyWL6/rikalkv8EeD0E8jm4o5RXEOrFTP3NXbhJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.17" + } + }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -9880,6 +10657,13 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/xmlcreate": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.4.tgz", + "integrity": "sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg==", + "dev": true, + "license": "Apache-2.0" + }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", diff --git a/package.json b/package.json index 80fe9ca..1f11a22 100644 --- a/package.json +++ b/package.json @@ -27,16 +27,19 @@ }, "homepage": "https://github.com/liquid-labs/semver-plus#readme", "devDependencies": { + "@liquid-labs/dmd": "^7.1.1", + "@liquid-labs/jsdoc-to-markdown": "^9.1.3", "@liquid-labs/sdlc-resource-babel-and-rollup": "^1.0.0-alpha.5", "@liquid-labs/sdlc-resource-eslint": "^1.0.0-alpha.2", - "@liquid-labs/sdlc-resource-jest": "^1.0.0-alpha.5" + "@liquid-labs/sdlc-resource-jest": "^1.0.0-alpha.5", + "dmd-readme-api": "^1.0.0-beta.8" }, "liq": { "packageType": "node|lib" }, "dependencies": { "http-errors": "^2.0.0", - "semver": "^7.3.8" + "semver": "^7.0.0" }, "_npm-check-plus": { "depcheck": { diff --git a/src/doc/README.01.md b/src/doc/README.01.md new file mode 100644 index 0000000..3ac5dff --- /dev/null +++ b/src/doc/README.01.md @@ -0,0 +1 @@ +# semver-plus diff --git a/src/doc/README.02.md b/src/doc/README.02.md new file mode 100644 index 0000000..e69de29 diff --git a/src/filter-valid-versions.mjs b/src/filter-valid-versions.mjs index 475d3e8..4c15c97 100644 --- a/src/filter-valid-versions.mjs +++ b/src/filter-valid-versions.mjs @@ -1,22 +1,22 @@ import semver from 'semver' const filterValidVersions = (versions, { ignoreNonVersions }) => { - versions = versions.filter((version) => { - const valid = semver.valid(version) !== null - - if (valid === false) { - if (ignoreNonVersions === true) { - return false - } - else { - throw new Error(`'${version}' is not a valid semver.`) - } + versions = versions.filter((version) => { + const valid = semver.valid(version) !== null + + if (valid === false) { + if (ignoreNonVersions === true) { + return false + } + else { + throw new Error(`'${version}' is not a valid semver.`) } - - return true - }) - - return versions - } + } + + return true + }) + + return versions +} - export { filterValidVersions } \ No newline at end of file +export { filterValidVersions } diff --git a/src/index.js b/src/index.js index 6468376..94c4ad9 100644 --- a/src/index.js +++ b/src/index.js @@ -3,6 +3,9 @@ export * from './filter-valid-version-or-range' export * from './min-version' export * from './next-version' export * from './prerelease' +export * from './semver-range-ops' +export * from './semver-version-ops' +export * from './semver-comparison-ops' export * from './upper-bound' export * from './valid-version-or-range' export * from './version-compare' diff --git a/src/lib/compare-helper.mjs b/src/lib/compare-helper.mjs index dbed1bb..1300fe6 100644 --- a/src/lib/compare-helper.mjs +++ b/src/lib/compare-helper.mjs @@ -1,16 +1,16 @@ const compareHelper = (versions, semverTest) => { - let currLead - for (let i = 0; i < versions.length; i += 1) { - const testVer = versions[i] - if (currLead === undefined) { - currLead = testVer - } - else if (semverTest(currLead, testVer)) { - currLead = testVer - } + let currLead + for (let i = 0; i < versions.length; i += 1) { + const testVer = versions[i] + if (currLead === undefined) { + currLead = testVer + } + else if (semverTest(currLead, testVer)) { + currLead = testVer } - - return currLead } - export { compareHelper } \ No newline at end of file + return currLead +} + +export { compareHelper } diff --git a/src/lib/set-default-options.mjs b/src/lib/set-default-options.mjs index 0ca6748..39804be 100644 --- a/src/lib/set-default-options.mjs +++ b/src/lib/set-default-options.mjs @@ -1,14 +1,12 @@ - - const setDefaultOptions = (options = {}) => { - if (!('includePrerelease' in options) + if (!('includePrerelease' in options) && (process.env.SEMVER_PLUS_COMPAT === undefined || process.env.SEMVER_PLUS_COMPAT.toLocaleLowerCase() === 'false' || process.env.SEMVER_PLUS_COMPAT === '0')) { - options.includePrerelease = true - } + options.includePrerelease = true + } - return options + return options } -export { setDefaultOptions } \ No newline at end of file +export { setDefaultOptions } diff --git a/src/max-satisfying-version-string.mjs b/src/max-satisfying-version-string.mjs index 568c562..4352bc9 100644 --- a/src/max-satisfying-version-string.mjs +++ b/src/max-satisfying-version-string.mjs @@ -20,4 +20,4 @@ const maxSatisfyingVersionString = (versions, { ignoreNonVersions } = {}) => { return compareHelper(versions, semver.lt) } -export { maxSatisfyingVersionString } \ No newline at end of file +export { maxSatisfyingVersionString } diff --git a/src/min-satisfying-version-string.mjs b/src/min-satisfying-version-string.mjs index 5b89b1d..caff207 100644 --- a/src/min-satisfying-version-string.mjs +++ b/src/min-satisfying-version-string.mjs @@ -11,13 +11,13 @@ import { compareHelper } from './lib/compare-helper' * @returns {string|null} - The minimum version string or null if no version strings are provided. */ const minSatisfyingVersionString = (versions, { ignoreNonVersions } = {}) => { -if (!versions || versions.length === 0) { + if (!versions || versions.length === 0) { return null -} + } -versions = filterValidVersions(versions, { ignoreNonVersions }) + versions = filterValidVersions(versions, { ignoreNonVersions }) -return compareHelper(versions, semver.gt) + return compareHelper(versions, semver.gt) } -export { minSatisfyingVersionString } \ No newline at end of file +export { minSatisfyingVersionString } diff --git a/src/min-version-string.mjs b/src/min-version-string.mjs index c90b6d2..769f9c8 100644 --- a/src/min-version-string.mjs +++ b/src/min-version-string.mjs @@ -1,23 +1,27 @@ +import semver from 'semver' + import { prereleaseXRangeRE } from './constants' -import { setDefaultOptions } from './lib/set-default-options' -import { minVersion, validRange } from './semver-range-ops' -const minVersionString = (range, options) => { - options = setDefaultOptions(options) - // given range '1.0.0-alpha.x', semver treats that as a specific version and says the min version is - // '1.0.0-alpha.x' even when 'options.includePrerelease' is true; this is verified in the unit tests. - console.log(`********\nrange: ${range}\noptions: ${JSON.stringify(options)}\n********`) // DEBUG - if (options.includePrerelease === true && range.match(prereleaseXRangeRE)) { +/** + * Returns the lowest version that satisfies the range, or null if no version satisfies the range. This implementation + * differs from the base `semver.minVersion` in that it correctly handles simple prerelease x-ranges. E.g., + * '1.0.0-alpha.x' -> '1.0.0-alpha.0'. To suppress this behavior, pass `options.compat = true`. + * @param {string} range - The range to check. + * @param {object} options - The options to pass to the semver.minVersion function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @param {boolean} options.includePrerelease - Whether to include prerelease versions. + * @param {boolean} options.compat - If true, prerelease ranges are treated the same as in the base semver package; + * e.g. `minVersion('1.0.0-alpha.x', { compat: true })` -> '1.0.0-alpha.x'. + * @returns {string|null} - The lowest version that satisfies the range, or null if no version satisfies the range. + * @category Range operations + */ +const minVersion = (range, options) => { + // we have to do this first, because semver does not recognize prerelease X-ranges ending with '*' (even though it + // does recognize these as valid ranges) + if (options?.compat !== true && range.match(prereleaseXRangeRE)) { return range.slice(0, -1) + '0' } - else { - const semverRange = validRange(range) - if (semverRange !== null) { - return minVersion(semverRange, options).version - } - } - // else - throw new Error(`Invaid range '${range}'.`) + return semver.minVersion(range, options) } -export { minVersionString } \ No newline at end of file +export { minVersion } diff --git a/src/next-version.mjs b/src/next-version.mjs index f4db279..d579234 100644 --- a/src/next-version.mjs +++ b/src/next-version.mjs @@ -9,17 +9,16 @@ import { } from './ext-constants' /** - * Given a current version, increment generates the next version string. This method follows the - * [semver spec](https://semver.org) except that: - * - `increment` 'prerelease' cannot be used with non-prerelease versions (results in execption) - * - supports 'pretype' and specific pre-release sequence 'alpha' -> 'beta' -> 'rc' -> released - * - * #### Parameters - * - `currVer`: the current version to increment. - * - `increment`: what to inrement; may be: 'major', 'minor', 'patch', 'premajor', 'preminor', 'prepatch', - * 'prerelease', or 'pretype'. The first seven are defined by the [semver spec](https://semver.org) and 'pretype' - * means to increment the pre-release ID from 'alpha' -> 'beta' -> 'rc' -> none. Passing in a `currVer` with any - * other prerelease ID with a 'pretype' increment will result in undefined results + * Given a current version generates the next version string accourding to `increment`. This method is similar to + * {@link inc} from the [base semver library](https://semver.org) with two differences. + * 1) It supports a specific pre-release sequence prototype -> 'alpha' -> 'beta' -> 'rc' -> released and the 'pretype' + * increment will advance the prerelease ID through these stages. + * 2) The 'prerelease' increment can only be used to advance the prerelease version number and does not function as + * 'prepatch' on a non-prerelease version. + * @param {string} currVer - The current version to increment. + * @param {string} increment - The increment to use. + * @returns {string} - The next version string. + * @category Version operations */ const nextVersion = (currVer, increment) => { if (!semver.valid(currVer)) { diff --git a/src/semver-comparison-ops.mjs b/src/semver-comparison-ops.mjs index a3df0f1..88244d4 100644 --- a/src/semver-comparison-ops.mjs +++ b/src/semver-comparison-ops.mjs @@ -7,6 +7,8 @@ import semver from 'semver' * @param {object} options - The options to pass to the semver.gt function. * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. * @returns {boolean} - `true` if `v1` is greater than `v2`, `false` otherwise. + * @category Comparison operations + * @function */ export const gt = semver.gt @@ -17,10 +19,11 @@ export const gt = semver.gt * @param {object} options - The options to pass to the semver.gte function. * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. * @returns {boolean} - `true` if `v1` is greater than or equal to `v2`, `false` otherwise. + * @category Comparison operations + * @function */ export const gte = semver.gte - /** * Returns `true` if `v1` is less than `v2`, `false` otherwise. * @param {string} v1 - The first version to compare. @@ -28,6 +31,8 @@ export const gte = semver.gte * @param {object} options - The options to pass to the semver.lt function. * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. * @returns {boolean} - `true` if `v1` is less than `v2`, `false` otherwise. + * @category Comparison operations + * @function */ export const lt = semver.lt @@ -38,10 +43,11 @@ export const lt = semver.lt * @param {object} options - The options to pass to the semver.lte function. * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. * @returns {boolean} - `true` if `v1` is less than or equal to `v2`, `false` otherwise. + * @category Comparison operations + * @function */ export const lte = semver.lte - /** * Returns `true` if `v1` is equal to `v2`, `false` otherwise. * @param {string} v1 - The first version to compare. @@ -49,6 +55,8 @@ export const lte = semver.lte * @param {object} options - The options to pass to the semver.eq function. * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. * @returns {boolean} - `true` if `v1` is equal to `v2`, `false` otherwise. + * @category Comparison operations + * @function */ export const eq = semver.eq @@ -59,6 +67,8 @@ export const eq = semver.eq * @param {object} options - The options to pass to the semver.neq function. * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. * @returns {boolean} - `true` if `v1` is not equal to `v2`, `false` otherwise. + * @category Comparison operations + * @function */ export const neq = semver.neq @@ -71,6 +81,8 @@ export const neq = semver.neq * @param {object} options - The options to pass to the semver.cmp function. * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. * @returns {number} - A number indicating whether a version is greater than, equal to, or less than another version. + * @category Comparison operations + * @function */ export const cmp = semver.cmp @@ -82,6 +94,8 @@ export const cmp = semver.cmp * @param {object} options - The options to pass to the semver.compare function. * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. * @returns {number} - 0 if `v1 == v2`, 1 if `v1 > v2`, and -1 if `v1 < v2`. + * @category Comparison operations + * @function */ export const compare = semver.compare @@ -92,6 +106,8 @@ export const compare = semver.compare * @param {object} options - The options to pass to the semver.compareBuild function. * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. * @returns {number} - 0 if `v1 == v2`, 1 if `v1 > v2`, and -1 if `v1 < v2`. + * @category Comparison operations + * @function */ export const compareBuild = semver.compareBuild @@ -102,6 +118,8 @@ export const compareBuild = semver.compareBuild * @param {object} options - The options to pass to the semver.rcompare function. * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. * @returns {number} - 0 if `v1 == v2`, -1 if `v1 > v2`, and 1 if `v1 < v2`. + * @category Comparison operations + * @function */ export const rcompare = semver.rcompare @@ -110,18 +128,11 @@ export const rcompare = semver.rcompare * @param {string} v1 - The first version to compare. * @param {string} v2 - The second version to compare. * @returns {number} - 0 if `v1 == v2`, 1 if `v1 > v2`, and -1 if `v1 < v2`. + * @category Comparison operations + * @function */ export const compareLoose = semver.compareLoose -/** - * Returns a parsed, normalized range string or null if the range is invalid. - * @param {string} range - The range to parse. - * @param {object} options - The options to pass to the semver.validRange function. - * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. - * @returns {string|null} - The parsed, normalized range string or null if the range is invalid. - */ -export const validRange = semver.validRange - /** * Returns the difference between two versions. I.e., the most significant version component by which `v1` and `v2` * differ. @@ -131,6 +142,8 @@ export const validRange = semver.validRange * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. * @returns {string|null} - `major`, 'minor', 'patch', 'prerelease', 'premajor', 'preminor', or 'prepatch' or null if * the `v1` and `v2` are identical (disregarding build metadata). + * @category Comparison operations + * @function */ export const diff = semver.diff @@ -140,6 +153,8 @@ export const diff = semver.diff * @param {object} options - The options to pass to the semver.sort function. * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. * @returns {string[]} - The sorted versions. + * @category Comparison operations + * @function */ export const sort = semver.sort @@ -149,5 +164,7 @@ export const sort = semver.sort * @param {object} options - The options to pass to the semver.rsort function. * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. * @returns {string[]} - The sorted versions. + * @category Comparison operations + * @function */ export const rsort = semver.rsort diff --git a/src/semver-range-ops.mjs b/src/semver-range-ops.mjs index 918e965..5852661 100644 --- a/src/semver-range-ops.mjs +++ b/src/semver-range-ops.mjs @@ -1,11 +1,15 @@ import semver from 'semver' +// note `minVersion` is overriden and defined in `min-version.mjs` + /** * Returns a parsed, normalized range string or null if the range is invalid. * @param {string} range - The range to parse. * @param {object} options - The options to pass to the semver.validRange function. * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. * @returns {string|null} - The parsed, normalized range string or null if the range is invalid. + * @category Range operations + * @function */ export const validRange = semver.validRange @@ -16,6 +20,8 @@ export const validRange = semver.validRange * @param {object} options - The options to pass to the semver.satisfies function. * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. * @returns {boolean} - `true` if the version satisfies the range, `false` otherwise. + * @category Range operations + * @function */ export const satisfies = semver.satisfies @@ -26,6 +32,8 @@ export const satisfies = semver.satisfies * @param {object} options - The options to pass to the semver.maxSatisfying function. * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. * @returns {string|null} - The highest version that satisfies the range, or null if no version satisfies the range. + * @category Range operations + * @function */ export const maxSatisfying = semver.maxSatisfying @@ -36,20 +44,11 @@ export const maxSatisfying = semver.maxSatisfying * @param {object} options - The options to pass to the semver.minSatisfying function. * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. * @returns {string|null} - The lowest version that satisfies the range, or null if no version satisfies the range. + * @category Range operations + * @function */ export const minSatisfying = semver.minSatisfying -/** - * Returns the lowest version that satisfies the range, or null if no version satisfies the range. Note, to correctly - * handle `minVersion('1.0.0-alpha.x)`, you must pass `options.includePrerelease = true`. - * @param {string} range - The range to check. - * @param {object} options - The options to pass to the semver.minVersion function. - * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. - * @param {boolean} options.includePrerelease - Whether to include prerelease versions. - * @returns {string|null} - The lowest version that satisfies the range, or null if no version satisfies the range. - */ -export const minVersion = semver.minVersion - /** * Returns `true` if `version` is greater than is greater than any version in `range`, `false` otherwise. * @param {string} version - The version to check. @@ -57,6 +56,8 @@ export const minVersion = semver.minVersion * @param {object} options - The options to pass to the semver.gtr function. * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. * @returns {boolean} - `true` if `version` is greater than is greater than any version in `range`, `false` otherwise. + * @category Range operations + * @function */ export const gtr = semver.gtr @@ -67,6 +68,8 @@ export const gtr = semver.gtr * @param {object} options - The options to pass to the semver.ltr function. * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. * @returns {boolean} - `true` if `version` is less than is less than any version in `range`, `false` otherwise. + * @category Range operations + * @function */ export const ltr = semver.ltr @@ -79,6 +82,8 @@ export const ltr = semver.ltr * @param {object} options - The options to pass to the semver.outside function. * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. * @returns {boolean} - `true` if `version` is outside of `range` in the indicated direction, `false` otherwise. + * @category Range operations + * @function */ export const outside = semver.outside @@ -88,6 +93,8 @@ export const outside = semver.outside * @param {object} options - The options to pass to the semver.intersects function. * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. * @returns {boolean} - `true` if any of the comparators in the range intersect with each other, `false` otherwise. + * @category Range operations + * @function */ export const intersects = semver.intersects @@ -102,6 +109,8 @@ export const intersects = semver.intersects * @param {object} options - The options to pass to the semver.simplifyRange function. * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. * @returns {string} - The simplified range. + * @category Range operations + * @function */ export const simplifyRange = semver.simplifyRange @@ -112,5 +121,7 @@ export const simplifyRange = semver.simplifyRange * @param {object} options - The options to pass to the semver.subset function. * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. * @returns {boolean} - `true` if `subRange` is a subset of `superRange`, `false` otherwise. + * @category Range operations + * @function */ -export const subset = semver.subset \ No newline at end of file +export const subset = semver.subset diff --git a/src/semver-version-ops.mjs b/src/semver-version-ops.mjs index da53339..3d862a2 100644 --- a/src/semver-version-ops.mjs +++ b/src/semver-version-ops.mjs @@ -7,6 +7,8 @@ import semver from 'semver' * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. * @param {boolean} options.includePrerelease - Whether to include prerelease versions. * @returns {string|null} - The parsed, normalized version string or null if the version is invalid. + * @category Version operations + * @function */ export const valid = semver.valid @@ -19,8 +21,10 @@ export const valid = semver.valid * @param {boolean} options.includePrerelease - Whether to include prerelease versions. * @param {string} identifier - Used to specify the prerelease name for prerelease increments. * @param {false|0|1} identifierBase - When incrementing to a new prerelease name, specifies the base number or - * `false` for no number. + * `false` for no number. * @returns {string} - The new version string. + * @category Version operations + * @function */ export const inc = semver.inc @@ -31,6 +35,8 @@ export const inc = semver.inc * @param {object} options - The options to pass to the semver.inc function. * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. * @returns {string[]|null} - The prerelease components or `null` if the version is not a prerelease. + * @category Version operations + * @function */ export const prerelease = semver.prerelease @@ -40,6 +46,8 @@ export const prerelease = semver.prerelease * @param {object} options - The options to pass to the semver.major function. * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. * @returns {number} - The major version number. + * @category Version operations + * @function */ export const major = semver.major @@ -49,6 +57,8 @@ export const major = semver.major * @param {object} options - The options to pass to the semver.minor function. * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. * @returns {number} - The minor version number. + * @category Version operations + * @function */ export const minor = semver.minor @@ -58,11 +68,15 @@ export const minor = semver.minor * @param {object} options - The options to pass to the semver.patch function. * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. * @returns {number} - The patch version number. + * @category Version operations + * @function */ export const patch = semver.patch /** * Attempts to parse and normalize a string as a semver string. An aliase for {@link valid}. + * @category Version operations + * @function */ export const parse = semver.parse @@ -77,6 +91,8 @@ export const parse = semver.parse * @param {boolean} options.rtl - Instead of searching for a digit from the left, start searching from the right. * true, then they are preserved. * @returns {string|null} - The coerced version string or null if the version is invalid. + * @category Version operations + * @function */ export const coerce = semver.coerce @@ -87,5 +103,7 @@ export const coerce = semver.coerce * @param {object} options - The options to pass to the semver.clean function. * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. * @returns {string|null} - The cleaned version string or null if the version is invalid. + * @category Version operations + * @function */ -export const clean = semver.clean \ No newline at end of file +export const clean = semver.clean diff --git a/src/test/max-satisfying-version-string.test.mjs b/src/test/max-satisfying-version-string.test.mjs index b208334..d8b6ec5 100644 --- a/src/test/max-satisfying-version-string.test.mjs +++ b/src/test/max-satisfying-version-string.test.mjs @@ -1,22 +1,23 @@ +/* global describe expect test */ import { maxSatisfyingVersionString } from '../max-satisfying-version-string' describe('maxSatisfyingVersionString', () => { - test.each([ - [['1.0.0-alpha.0', '1.0.0-beta.0'], '1.0.0-beta.0'], - [['1.0.0-beta.0', '1.0.0-rc.0'], '1.0.0-rc.0'], - [['1.0.0-alpha.0', '1.0.0'], '1.0.0'], - [['1.0.0-alpha.0', '1.0.0-beta.0', '1.0.0-rc.0', '1.0.0'], '1.0.0'], - [['1.0.0-alpha.2', '1.0.0-alpha.13'], '1.0.0-alpha.13'], - [['2.0.0-alpha.0', '1.0.0'], '2.0.0-alpha.0'] - ])('versions %p -> %s', (versions, expected) => expect(maxSatisfyingVersionString(versions)).toBe(expected)) - - test('[] => null', () => expect(maxSatisfyingVersionString([])).toBe(null)) - - test('mixed version types raises exception', - () => expect(() => maxSatisfyingVersionString(['1.0.0', 'not-a-valid-vesion'])).toThrow()) - - test.each([ - [['1.0.0', 'not-a-valid-vesion', 'abc'], '1.0.0'] - ])("'ignoreNonVersions' filters non-version strings from the version list", - (versions, expected) => expect(maxSatisfyingVersionString(versions, { ignoreNonVersions : true })).toBe(expected)) - }) \ No newline at end of file + test.each([ + [['1.0.0-alpha.0', '1.0.0-beta.0'], '1.0.0-beta.0'], + [['1.0.0-beta.0', '1.0.0-rc.0'], '1.0.0-rc.0'], + [['1.0.0-alpha.0', '1.0.0'], '1.0.0'], + [['1.0.0-alpha.0', '1.0.0-beta.0', '1.0.0-rc.0', '1.0.0'], '1.0.0'], + [['1.0.0-alpha.2', '1.0.0-alpha.13'], '1.0.0-alpha.13'], + [['2.0.0-alpha.0', '1.0.0'], '2.0.0-alpha.0'] + ])('versions %p -> %s', (versions, expected) => expect(maxSatisfyingVersionString(versions)).toBe(expected)) + + test('[] => null', () => expect(maxSatisfyingVersionString([])).toBe(null)) + + test('mixed version types raises exception', + () => expect(() => maxSatisfyingVersionString(['1.0.0', 'not-a-valid-vesion'])).toThrow()) + + test.each([ + [['1.0.0', 'not-a-valid-vesion', 'abc'], '1.0.0'] + ])("'ignoreNonVersions' filters non-version strings from the version list", + (versions, expected) => expect(maxSatisfyingVersionString(versions, { ignoreNonVersions : true })).toBe(expected)) +}) diff --git a/src/test/min-version-string.test.mjs b/src/test/min-version-string.test.mjs index 441cdcc..b234856 100644 --- a/src/test/min-version-string.test.mjs +++ b/src/test/min-version-string.test.mjs @@ -1,14 +1,15 @@ +/* global describe expect test */ import semver from 'semver' -import { minVersionString } from '../min-version-string' +import { minVersion } from '../min-version-string' describe('minVersionString', () => { test('verify semver prerelease bug', () => { // we want to make sure we have the actual semver and not our local, which may have wrapper logic to fix this expect(semver.minVersion('1.0.0-alpha.x').toString()).toBe('1.0.0-alpha.x') // correct expect(semver.minVersion('1.0.0-alpha.x', { includePrerelease : true }).toString()).toBe('1.0.0-alpha.x') // incorrect -}) - + }) + test.each([ // X-ranges ['*', '0.0.0'], @@ -35,6 +36,6 @@ describe('minVersionString', () => { ['^1.2.3', '1.2.3'], ['^1.2', '1.2.0'], ['^1', '1.0.0'], - ['^1.2.3-alpha.2', '1.2.3-alpha.2'], - ])('%s => %s', (input, expected) => expect(minVersionString(input)).toBe(expected)) + ['^1.2.3-alpha.2', '1.2.3-alpha.2'] + ])('%s => %s', (input, expected) => expect(minVersion(input)?.toString()).toBe(expected)) }) diff --git a/src/upper-bound.mjs b/src/upper-bound.mjs index 9b40d34..d7d7db9 100644 --- a/src/upper-bound.mjs +++ b/src/upper-bound.mjs @@ -6,6 +6,7 @@ import semver from 'semver' * function where 'verision-0' least range above the given range. * @param {string} range - The range to find the ceiling for. * @returns {string} - Either '*', a specific version, or a '-0'. + * @category Range operations */ const upperBound = (range, { stripOperators = false } = {}) => { const normalizedRange = semver.validRange(range) diff --git a/src/x-sort.mjs b/src/x-sort.mjs index 42a2989..8e71d8c 100644 --- a/src/x-sort.mjs +++ b/src/x-sort.mjs @@ -5,6 +5,9 @@ import { upperBound } from './upper-bound' /** * Ascend sorts a mix of semver versions and x-range specified ranges (e.g., 1.2.* or 1.2.x). The ranges are sorted according to their highest version; e.g., 1.3.34 < 1.3.*. (I believe it can accept caret ranges too, but I would need to review the spec.) + * @param {string[]} versionsAndRanges - The versions and ranges to sort. + * @returns {string[]} - The sorted versions and ranges. + * @category Comparison operations */ const xSort = (versionsAndRanges) => { // TODO: to sort any range type, develop 'minOutOfRange' and use those to sort ranges From 4905d17e73eccc7558b72ed9b7c4c901d4a7b92e Mon Sep 17 00:00:00 2001 From: Zane Rockenbaugh Date: Mon, 13 Oct 2025 18:50:22 -0500 Subject: [PATCH 4/9] renamed file to reflect actual function --- README.md | 55 +++++++++++-------- ...min-version-string.mjs => min-version.mjs} | 0 ...n-string.test.mjs => min-version.test.mjs} | 2 +- 3 files changed, 34 insertions(+), 23 deletions(-) rename src/{min-version-string.mjs => min-version.mjs} (100%) rename src/test/{min-version-string.test.mjs => min-version.test.mjs} (96%) diff --git a/README.md b/README.md index dd5bf4c..972ad1a 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ _API generated with [dmd-readme-api](https://www.npmjs.com/package/dmd-readme-ap - [`rcompare()`](#rcompare): Reverse of [compare](#compare). - [`rsort()`](#rsort): Sorts an array of versions in descending order using [compareBuild](#compareBuild). - [`sort()`](#sort): Sorts an array of versions in ascending order using [compareBuild](#compareBuild). + - [`xSort()`](#xSort): Ascend sorts a mix of semver versions and x-range specified ranges (e.g., 1.2.* or 1.2.x). - _Range operations_ - [`gtr()`](#gtr): Returns `true` if `version` is greater than is greater than any version in `range`, `false` otherwise. - [`intersects()`](#intersects): Returns `true` if any of the comparators in the range intersect with each other. @@ -30,11 +31,10 @@ _API generated with [dmd-readme-api](https://www.npmjs.com/package/dmd-readme-ap - [`satisfies()`](#satisfies): Returns `true` if the version satisfies the range, `false` otherwise. - [`simplifyRange()`](#simplifyRange): Return a "simplified" range that matches the same items in the versions list as the range specified. - [`subset()`](#subset): Returns `true` if `subRange` is a subset of `superRange`, `false` otherwise. + - [`upperBound()`](#upperBound): Finds the ceiling of a range. - [`validRange()`](#validRange): Returns a parsed, normalized range string or null if the range is invalid. - [`maxSatisfyingVersionString()`](#maxSatisfyingVersionString): Like [maxVersion](maxVersion) but returns a string instead of a version object. - [`minSatisfyingVersionString()`](#minSatisfyingVersionString): Like [minVersion](#minVersion) but returns a string instead of a version object. - - [`upperBound()`](#upperBound): Finds the ceiling of a range. - - [`xSort()`](#xSort): Ascend sorts a mix of semver versions and x-range specified ranges (e.g., 1.2.* or 1.2.x). - _Version operations_ - [`clean()`](#clean): Returns a cleaned version string removing unecessary comparators and, if `options.loose` is true, fixing space issues. - [`coerce()`](#coerce): Aggressively attempts to coerce a string into a valid semver string. @@ -285,6 +285,20 @@ Sorts an array of versions in ascending order using [compareBuild](#compareBuild __Category__: [Comparison operations](#global-function-Comparison-operations-index) + +### `xSort(versionsAndRanges)` ⇒ `Array.` [source code](./src/x-sort.mjs#L12) [global index](#global-function-index) + +Ascend sorts a mix of semver versions and x-range specified ranges (e.g., 1.2.* or 1.2.x). The ranges are sorted according to their highest version; e.g., 1.3.34 < 1.3.*. (I believe it can accept caret ranges too, but I would need to review the spec.) + + +| Param | Type | Description | +| --- | --- | --- | +| `versionsAndRanges` | `Array.` | The versions and ranges to sort. | + +**Returns**: `Array.` - - The sorted versions and ranges. + +__Category__: [Comparison operations](#global-function-Comparison-operations-index) + ### `gtr(version, range, options)` ⇒ `boolean` [source code](./src/semver-range-ops.mjs#L62) [global index](#global-function-index) @@ -370,7 +384,7 @@ Returns the lowest version in `versions` that satisfies the range, or null if no __Category__: [Range operations](#global-function-Range-operations-index) -### `minVersion(range, options)` ⇒ `string` \| `null` [source code](./src/min-version-string.mjs#L18) [global index](#global-function-index) +### `minVersion(range, options)` ⇒ `string` \| `null` [source code](./src/min-version.mjs#L18) [global index](#global-function-index) Returns the lowest version that satisfies the range, or null if no version satisfies the range. This implementation differs from the base `semver.minVersion` in that it correctly handles simple prerelease x-ranges. E.g., @@ -463,6 +477,22 @@ Returns `true` if `subRange` is a subset of `superRange`, `false` otherwise. __Category__: [Range operations](#global-function-Range-operations-index) + +### `upperBound(range)` ⇒ `string` [source code](./src/upper-bound.mjs#L11) [global index](#global-function-index) + +Finds the ceiling of a range. For '*', the ceiling is '*'. For specific versions or any range capped by a specific +version, the ceiling is that version. For any open-ended range, the ceiling is defined by a '-0' range +function where 'verision-0' least range above the given range. + + +| Param | Type | Description | +| --- | --- | --- | +| `range` | `string` | The range to find the ceiling for. | + +**Returns**: `string` - - Either '*', a specific version, or a '-0'. + +__Category__: [Range operations](#global-function-Range-operations-index) + ### `validRange(range, options)` ⇒ `string` \| `null` [source code](./src/semver-range-ops.mjs#L14) [global index](#global-function-index) @@ -507,25 +537,6 @@ Like [minVersion](#minVersion) but returns a string instead of a version object. **Returns**: `string` \| `null` - - The minimum version string or null if no version strings are provided. - -### `upperBound(range)` ⇒ `string` [source code](./src/upper-bound.mjs#L10) [global index](#global-function-index) - -Finds the ceiling of a range. For '*', the ceiling is '*'. For specific versions or any range capped by a specific -version, the ceiling is that version. For any open-ended range, the ceiling is defined by a '-0' range -function where 'verision-0' least range above the given range. - - -| Param | Type | Description | -| --- | --- | --- | -| `range` | `string` | The range to find the ceiling for. | - -**Returns**: `string` - - Either '*', a specific version, or a '-0'. - - -### `xSort()` [source code](./src/x-sort.mjs#L9) [global index](#global-function-index) - -Ascend sorts a mix of semver versions and x-range specified ranges (e.g., 1.2.* or 1.2.x). The ranges are sorted according to their highest version; e.g., 1.3.34 < 1.3.*. (I believe it can accept caret ranges too, but I would need to review the spec.) - ### `clean(version, options)` ⇒ `string` \| `null` [source code](./src/semver-version-ops.mjs#L109) [global index](#global-function-index) diff --git a/src/min-version-string.mjs b/src/min-version.mjs similarity index 100% rename from src/min-version-string.mjs rename to src/min-version.mjs diff --git a/src/test/min-version-string.test.mjs b/src/test/min-version.test.mjs similarity index 96% rename from src/test/min-version-string.test.mjs rename to src/test/min-version.test.mjs index b234856..5ba0455 100644 --- a/src/test/min-version-string.test.mjs +++ b/src/test/min-version.test.mjs @@ -1,7 +1,7 @@ /* global describe expect test */ import semver from 'semver' -import { minVersion } from '../min-version-string' +import { minVersion } from '../min-version' describe('minVersionString', () => { test('verify semver prerelease bug', () => { From 57e003faae0b69627ec00976fafa3636db7517a1 Mon Sep 17 00:00:00 2001 From: Zane Rockenbaugh Date: Sun, 19 Oct 2025 15:21:08 -0500 Subject: [PATCH 5/9] better synchronized API with core; udpated docs and tests --- src/filter-valid-version-or-range.mjs | 6 -- src/filter-valid-versions.mjs | 22 ------- src/index.js | 1 + src/max-satisfying-version-string.mjs | 23 ------- src/max-satisfying.mjs | 44 ++++++++++++++ src/min-satisfying-version-string.mjs | 23 ------- src/min-version.mjs | 15 ++--- src/semver-range-ops.mjs | 16 +---- .../filter-valid-version-or-range.test.mjs | 11 ---- .../max-satisfying-version-string.test.mjs | 23 ------- src/test/max-satisfying.test.mjs | 34 +++++++++++ .../min-satisfying-version-string.test.mjs | 23 ------- src/test/valid-version-or-range.test.mjs | 26 ++++++-- src/valid-version-or-range.mjs | 60 ++++++++++++++++--- valid-versions-and-ranges.mjs | 21 +++++++ 15 files changed, 184 insertions(+), 164 deletions(-) delete mode 100644 src/filter-valid-version-or-range.mjs delete mode 100644 src/filter-valid-versions.mjs delete mode 100644 src/max-satisfying-version-string.mjs create mode 100644 src/max-satisfying.mjs delete mode 100644 src/min-satisfying-version-string.mjs delete mode 100644 src/test/filter-valid-version-or-range.test.mjs delete mode 100644 src/test/max-satisfying-version-string.test.mjs create mode 100644 src/test/max-satisfying.test.mjs delete mode 100644 src/test/min-satisfying-version-string.test.mjs create mode 100644 valid-versions-and-ranges.mjs diff --git a/src/filter-valid-version-or-range.mjs b/src/filter-valid-version-or-range.mjs deleted file mode 100644 index 6d31fa1..0000000 --- a/src/filter-valid-version-or-range.mjs +++ /dev/null @@ -1,6 +0,0 @@ -import { validVersionOrRange } from './valid-version-or-range' - -const filterValidVersionOrRange = (input = throw new Error("'input' is required."), options) => - input.filter((i) => validVersionOrRange(i, options)) - -export { filterValidVersionOrRange } diff --git a/src/filter-valid-versions.mjs b/src/filter-valid-versions.mjs deleted file mode 100644 index 4c15c97..0000000 --- a/src/filter-valid-versions.mjs +++ /dev/null @@ -1,22 +0,0 @@ -import semver from 'semver' - -const filterValidVersions = (versions, { ignoreNonVersions }) => { - versions = versions.filter((version) => { - const valid = semver.valid(version) !== null - - if (valid === false) { - if (ignoreNonVersions === true) { - return false - } - else { - throw new Error(`'${version}' is not a valid semver.`) - } - } - - return true - }) - - return versions -} - -export { filterValidVersions } diff --git a/src/index.js b/src/index.js index 94c4ad9..a815035 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,5 @@ export * from './ext-constants' +export * from './filter-valid-versions' export * from './filter-valid-version-or-range' export * from './min-version' export * from './next-version' diff --git a/src/max-satisfying-version-string.mjs b/src/max-satisfying-version-string.mjs deleted file mode 100644 index 4352bc9..0000000 --- a/src/max-satisfying-version-string.mjs +++ /dev/null @@ -1,23 +0,0 @@ -import semver from 'semver' - -import { filterValidVersions } from './filter-valid-versions' -import { compareHelper } from './lib/compare-helper' - -/** - * Like {@link maxVersion} but returns a string instead of a version object. - * @param {string[]} versions - The versions to compare. - * @param {object} options - The options to pass to the compareHelper function. - * @param {boolean} options.ignoreNonVersions - Whether to ignore non-version strings. - * @returns {string|null} - The maximum version string or null if no version strings are provided. - */ -const maxSatisfyingVersionString = (versions, { ignoreNonVersions } = {}) => { - if (!versions || versions.length === 0) { - return null - } - - versions = filterValidVersions(versions, { ignoreNonVersions }) - - return compareHelper(versions, semver.lt) -} - -export { maxSatisfyingVersionString } diff --git a/src/max-satisfying.mjs b/src/max-satisfying.mjs new file mode 100644 index 0000000..a1ed35f --- /dev/null +++ b/src/max-satisfying.mjs @@ -0,0 +1,44 @@ +import semver from 'semver' + +import { rsort } from './semver-comparison-ops' +import { satisfies } from './semver-range-ops' +import { validVersionOrRange } from './valid-version-or-range' + +/** + * Returns the highest version in `versions` that satisfies the range, or null if no version satisfies the range. This + * implementation differs from the base `semver.maxSatisfying` in that it correctly handles the following case: + * `maxSatisfying(['1.0.0-alpha.0', '1.0.0'], '<1.0.0')` -> '1.0.0-alpha.0'. The base `semver.maxSatisfying` function + * returns `null` in this case. Note, support for this syntax is not comprehensive and more complicated expressions are + * likely to yield incorrect results. + * @param {string[]} versions - The versions to check. + * @param {string} range - The range to check. + * @param {object} options - The options to pass to the semver.maxSatisfying function. + * @param {boolean} options.compat - If true, then uses the base `semver.maxSatisfying` function. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @param {boolean} options.includePrerelease - Include prerelease versions in the result. This is effectively implied + * if the range contains prerelease components. + * @param {boolean} options.throwIfInvalid - If true, throws an exception if any version or the range is invalid. + * @returns {string|null} - The highest version that satisfies the range, or null if no version satisfies the range. + * @category Range operations + * @function + */ +// export const maxSatisfying = semver.maxSatisfying +export const maxSatisfying = (versions, range, options) => { + if (options?.throwIfInvalid === true) { + validVersionOrRange(versions, { ...options, disallowRanges : true }) + validVersionOrRange([range], { ...options, disallowVersions : true }) + } + + if (true) { // (options?.compat === true) { + return semver.maxSatisfying(versions, range, options) + } + + versions = rsort(versions, options) + + for (const version of versions) { + if (satisfies(version, range, options)) { + return version + } + } + return null +} diff --git a/src/min-satisfying-version-string.mjs b/src/min-satisfying-version-string.mjs deleted file mode 100644 index caff207..0000000 --- a/src/min-satisfying-version-string.mjs +++ /dev/null @@ -1,23 +0,0 @@ -import semver from 'semver' - -import { filterValidVersions } from './filter-valid-versions' -import { compareHelper } from './lib/compare-helper' - -/** - * Like {@link minVersion} but returns a string instead of a version object. - * @param {string[]} versions - The versions to compare. - * @param {object} options - The options to pass to the compareHelper function. - * @param {boolean} options.ignoreNonVersions - Whether to ignore non-version strings. - * @returns {string|null} - The minimum version string or null if no version strings are provided. -*/ -const minSatisfyingVersionString = (versions, { ignoreNonVersions } = {}) => { - if (!versions || versions.length === 0) { - return null - } - - versions = filterValidVersions(versions, { ignoreNonVersions }) - - return compareHelper(versions, semver.gt) -} - -export { minSatisfyingVersionString } diff --git a/src/min-version.mjs b/src/min-version.mjs index 769f9c8..fe576b4 100644 --- a/src/min-version.mjs +++ b/src/min-version.mjs @@ -5,7 +5,8 @@ import { prereleaseXRangeRE } from './constants' /** * Returns the lowest version that satisfies the range, or null if no version satisfies the range. This implementation * differs from the base `semver.minVersion` in that it correctly handles simple prerelease x-ranges. E.g., - * '1.0.0-alpha.x' -> '1.0.0-alpha.0'. To suppress this behavior, pass `options.compat = true`. + * '1.0.0-alpha.x' -> '1.0.0-alpha.0'. To suppress this behavior, pass `options.compat = true`. Note, support for this + * syntax is not comprehensive and more complicated expressions are likely to yield incorrect results. * @param {string} range - The range to check. * @param {object} options - The options to pass to the semver.minVersion function. * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. @@ -16,12 +17,12 @@ import { prereleaseXRangeRE } from './constants' * @category Range operations */ const minVersion = (range, options) => { - // we have to do this first, because semver does not recognize prerelease X-ranges ending with '*' (even though it - // does recognize these as valid ranges) - if (options?.compat !== true && range.match(prereleaseXRangeRE)) { - return range.slice(0, -1) + '0' - } - return semver.minVersion(range, options) + // we have to do this first, because semver does not recognize prerelease X-ranges ending with '*' (even though it + // does recognize these as valid ranges) + if (options?.compat !== true && range.match(prereleaseXRangeRE)) { + return range.slice(0, -1) + '0' + } + return semver.minVersion(range, options) } export { minVersion } diff --git a/src/semver-range-ops.mjs b/src/semver-range-ops.mjs index 5852661..a55a9cd 100644 --- a/src/semver-range-ops.mjs +++ b/src/semver-range-ops.mjs @@ -1,6 +1,8 @@ import semver from 'semver' -// note `minVersion` is overriden and defined in `min-version.mjs` +// note: +// - `maxSatisfying` is overriden and defined in `max-satisfying.mjs` +// - `minVersion` is overriden and defined in `min-version.mjs` /** * Returns a parsed, normalized range string or null if the range is invalid. @@ -25,18 +27,6 @@ export const validRange = semver.validRange */ export const satisfies = semver.satisfies -/** - * Returns the highest version in `versions` that satisfies the range, or null if no version satisfies the range. - * @param {string[]} versions - The versions to check. - * @param {string} range - The range to check. - * @param {object} options - The options to pass to the semver.maxSatisfying function. - * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. - * @returns {string|null} - The highest version that satisfies the range, or null if no version satisfies the range. - * @category Range operations - * @function - */ -export const maxSatisfying = semver.maxSatisfying - /** * Returns the lowest version in `versions` that satisfies the range, or null if no version satisfies the range. * @param {string[]} versions - The versions to check. diff --git a/src/test/filter-valid-version-or-range.test.mjs b/src/test/filter-valid-version-or-range.test.mjs deleted file mode 100644 index 80a5c4f..0000000 --- a/src/test/filter-valid-version-or-range.test.mjs +++ /dev/null @@ -1,11 +0,0 @@ -/* global describe expect test */ -import { filterValidVersionOrRange } from '../filter-valid-version-or-range' - -describe('filterValidVersionOrRange', () => { - test.each([ - [ - ['1.0', '1.2.3', '2.3.9-alpha.12', '1.1.1-alpha.x', 'backlog', '1.2.x', '8.*', '*', '1.2.4.*', '^1.2.3'], - ['1.2.3', '2.3.9-alpha.12', '1.1.1-alpha.x', '1.2.x', '8.*', '*'] - ] - ])('%p => %p', (input, expected) => expect(filterValidVersionOrRange(input, { onlyXRange : true })).toEqual(expected)) -}) diff --git a/src/test/max-satisfying-version-string.test.mjs b/src/test/max-satisfying-version-string.test.mjs deleted file mode 100644 index d8b6ec5..0000000 --- a/src/test/max-satisfying-version-string.test.mjs +++ /dev/null @@ -1,23 +0,0 @@ -/* global describe expect test */ -import { maxSatisfyingVersionString } from '../max-satisfying-version-string' - -describe('maxSatisfyingVersionString', () => { - test.each([ - [['1.0.0-alpha.0', '1.0.0-beta.0'], '1.0.0-beta.0'], - [['1.0.0-beta.0', '1.0.0-rc.0'], '1.0.0-rc.0'], - [['1.0.0-alpha.0', '1.0.0'], '1.0.0'], - [['1.0.0-alpha.0', '1.0.0-beta.0', '1.0.0-rc.0', '1.0.0'], '1.0.0'], - [['1.0.0-alpha.2', '1.0.0-alpha.13'], '1.0.0-alpha.13'], - [['2.0.0-alpha.0', '1.0.0'], '2.0.0-alpha.0'] - ])('versions %p -> %s', (versions, expected) => expect(maxSatisfyingVersionString(versions)).toBe(expected)) - - test('[] => null', () => expect(maxSatisfyingVersionString([])).toBe(null)) - - test('mixed version types raises exception', - () => expect(() => maxSatisfyingVersionString(['1.0.0', 'not-a-valid-vesion'])).toThrow()) - - test.each([ - [['1.0.0', 'not-a-valid-vesion', 'abc'], '1.0.0'] - ])("'ignoreNonVersions' filters non-version strings from the version list", - (versions, expected) => expect(maxSatisfyingVersionString(versions, { ignoreNonVersions : true })).toBe(expected)) -}) diff --git a/src/test/max-satisfying.test.mjs b/src/test/max-satisfying.test.mjs new file mode 100644 index 0000000..b564266 --- /dev/null +++ b/src/test/max-satisfying.test.mjs @@ -0,0 +1,34 @@ +/* global describe expect test */ +import { maxSatisfying } from '../max-satisfying' + +describe('maxSatisfying', () => { + test.each([ + [['1.0.0-alpha.0', '1.0.0-beta.0'], '<1.0.0-beta.0', undefined, '1.0.0-alpha.0'], + [['1.0.0-beta.0', '1.0.0-rc.0'], '>1.0.0-beta.0', undefined, '1.0.0-rc.0'], + [['1.0.0-alpha.0', '1.0.0'], '*', undefined, '1.0.0'], + [['1.0.0-beta.0', '1.0.0-rc.0', '1.0.0'], '<1.0.0', undefined, null], + [['1.0.0-alpha.2', '1.0.0-alpha.13'], '>1.0.0-alpha.0', undefined, '1.0.0-alpha.13'], + [['2.0.0-alpha.0', '1.0.0'], '*', undefined, '1.0.0'], + [[], '*', undefined, null], + // includePrerelease = true + [['1.0.0-alpha.0', '1.0.0-beta.0'], '<1.0.0-beta.0', { includePrerelease : true }, '1.0.0-alpha.0'], + [['1.0.0-beta.0', '1.0.0-rc.0'], '>1.0.0-beta.0', { includePrerelease : true }, '1.0.0-rc.0'], + [['1.0.0-alpha.0', '1.0.0'], '*', { includePrerelease : true }, '1.0.0'], + [['1.0.0-beta.0', '1.0.0-rc.0', '1.0.0'], '<1.0.0', { includePrerelease : true }, '1.0.0-rc.0'], + [['1.0.0-alpha.2', '1.0.0-alpha.13'], '>1.0.0-alpha.0', { includePrerelease : true }, '1.0.0-alpha.13'], + [['2.0.0-alpha.0', '1.0.0'], '*', { includePrerelease : true }, '2.0.0-alpha.0'], + [[], '*', { includePrerelease : true }, null], + // compat = true + [['1.0.0-alpha.0', '1.0.0-beta.0', '1.0.0-rc.0', '1.0.0'], '<1.0.0', { compat : true, includePrerelease : true }, '1.0.0-rc.0'] + ])('versions %p, range %s, options %v -> %s', + (versions, range, options, expected) => + expect(maxSatisfying(versions, range, options)?.toString() || null).toBe(expected)) + + test('invalid version raises exception', + () => expect(() => maxSatisfying(['1.0.0', 'not-a-valid-vesion'], '*', { throwIfInvalid : true })).toThrow()) + + /* test.each([ + [['1.0.0', 'not-a-valid-vesion', 'abc'], '1.0.0'] + ])("'ignoreNonVersions' filters non-version strings from the version list", + (versions, expected) => expect(maxSatisfying(versions, '*', { ignoreNonVersions : true })).toBe(expected)) */ +}) diff --git a/src/test/min-satisfying-version-string.test.mjs b/src/test/min-satisfying-version-string.test.mjs deleted file mode 100644 index 31c15f9..0000000 --- a/src/test/min-satisfying-version-string.test.mjs +++ /dev/null @@ -1,23 +0,0 @@ -/* global describe expect test */ -import { minSatisfyingVersionString } from '../min-satisfying-version-string' - -describe('minSatisfyingVersionString', () => { - test.each([ - [['1.0.0-alpha.0', '1.0.0-beta.0'], '1.0.0-alpha.0'], - [['1.0.0-beta.0', '1.0.0-rc.0'], '1.0.0-beta.0'], - [['1.0.0-alpha.0', '1.0.0'], '1.0.0-alpha.0'], - [['1.0.0-alpha.0', '1.0.0-beta.0', '1.0.0-rc.0', '1.0.0'], '1.0.0-alpha.0'], - [['2.0.0-alpha.0', '1.0.0'], '1.0.0'], - [['1.0.0-alpha.2', '1.0.0-alpha.13'], '1.0.0-alpha.2'] - ])('versions %p -> %s', (versions, expected) => expect(minSatisfyingVersionString(versions)).toBe(expected)) - - test('[] => null', () => expect(minSatisfyingVersionString([])).toBe(null)) - - test('mixed version types raises exception', - () => expect(() => minSatisfyingVersionString(['1.0.0', 'not-a-valid-vesion'])).toThrow()) - - test.each([ - [['1.0.0', 'not-a-valid-vesion', 'abc'], '1.0.0'] - ])("'ignoreNonVersions' filters non-version strings from the version list", - (versions, expected) => expect(minSatisfyingVersionString(versions, { ignoreNonVersions : true })).toBe(expected)) -}) diff --git a/src/test/valid-version-or-range.test.mjs b/src/test/valid-version-or-range.test.mjs index a2e254b..1fa4997 100644 --- a/src/test/valid-version-or-range.test.mjs +++ b/src/test/valid-version-or-range.test.mjs @@ -3,11 +3,25 @@ import { validVersionOrRange } from '../valid-version-or-range' describe('validVersionOrRange', () => { test.each([ - ['1.0.0', undefined, true], - ['1.0.0-alpha.0', undefined, true], - ['1.0.0-alpha.1', undefined, true], - ['1.0.0 - 2', undefined, true], - ['1.0.x', { onlyXRange : true }, true], - ['1.0.0-alpha.1', undefined, true] + ['1.0.0', undefined, '1.0.0'], + ['1.0.0-alpha.0', undefined, '1.0.0-alpha.0'], + ['1.0.0-alpha.1', undefined, '1.0.0-alpha.1'], + ['1.0.0 - 2', undefined, '>=1.0.0 <3.0.0-0'], + ['1.0.x', { onlyXRange : true }, '>=1.0.0 <1.1.0-0'], + ['not-a-valid-version', undefined, null], + [ 'not-a-valid-range', undefined, null], + // invalid versions and ranges + ['1.0.0', { disallowVersions : true }, null], + ['1.0.x', { disallowRanges : true }, null], ])('%s => %s', (input, options, expected) => expect(validVersionOrRange(input, options)).toBe(expected)) + + test.each([ + ['not-a-valid-version', { throwIfInvalid : true }], + [ 'not-a-valid-range', { throwIfInvalid : true }], + // invalid versions and ranges + ['1.0.0', { disallowVersions : true, throwIfInvalid : true }], + ['1.0.x', { disallowRanges : true, throwIfInvalid : true }], + ['1.0.0', { disallowVersions : true, disallowRanges : true }] + ])('invalid %s (%o) raises exception', (input, options) => + expect(() => validVersionOrRange(input, options)).toThrow()) }) diff --git a/src/valid-version-or-range.mjs b/src/valid-version-or-range.mjs index 44b5a8b..012b394 100644 --- a/src/valid-version-or-range.mjs +++ b/src/valid-version-or-range.mjs @@ -2,13 +2,59 @@ import semver from 'semver' import { xRangeRE } from './constants' +/** + * Validates a string to be a valid version or range. By default, an exception is raised unless `options.disallowVersions` + * is `true`, in which case it filters out invalid strings and returns a new array. + * @param {string} input - The string to validate. + * @param {object} options - The options to pass to the semver.valid function. + * @param {boolean} options.disallowRanges - Whether to disallow ranges. + * @param {boolean} options.disallowVersions - Whether to disallow versions and ranges which are valid versions. + * @param {boolean} options.includePrerelease - Whether to include prerelease versions. + * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings. + * @param {boolean} options.onlyXRange - Whether to only allow x-ranges. Note, even if this is `true`, and a valid + * x-range is presented, the returned string will still be normalized. + * @param {boolean} options.throwIfInvalid - If true, throws an exception if the string is invalid. + * @returns {string|null} - A normalized version or range string or `null` if the string is invalid (if + * `options.throwIfInvalid` is `true`, in which case an exception is thrown). + */ const validVersionOrRange = (input = throw new Error("'input' is required."), { - dissallowRanges = false, - dissallowVersions = false, - onlyXRange = false -} = {}) => - !!((dissallowVersions !== true && semver.valid(input)) - || (onlyXRange !== true && dissallowRanges !== true && semver.validRange(input)) - || (onlyXRange === true && input.match(xRangeRE))) + disallowRanges = false, + disallowVersions = false, + onlyXRange = false, + throwIfInvalid = false, + ...options +} = {}) => { + if (disallowVersions === true && disallowRanges === true) { + throw new Error("'disallowVersions' and 'disallowRanges' cannot both be true.") + } + if (disallowRanges === true && onlyXRange === true) { + throw new Error("'disallowRanges' and 'onlyXRange' cannot both be true.") + } + + let normalized = disallowRanges === true ? semver.valid(input, options) : semver.validRange(input, options) + // test for x-range specifically + if (normalized !== null && onlyXRange === true && input.match(xRangeRE) === null) { + if (throwIfInvalid === true) { + throw new Error(`'${input}' is a valid range, but an x-range is specifically expected.`) + } + normalized = null + } + // test for range exclusive of versions + if (disallowVersions === true && semver.valid(input, options) !== null) { + if (throwIfInvalid === true) { + throw new Error(`'${input}' is a valid version, and a non-version range is expected.`) + } + normalized = null + } + // throw an exception if the string is invalid and `options.throwIfInvalid` is `true` + if (normalized === null && throwIfInvalid === true) { + const msg = `'${input}' is not a valid ` + + `${disallowVersions === true ? 'range exclusive of versions' : + (disallowRanges === true ? 'version' : 'version or range')}.` + throw new Error(msg) + } + + return normalized +} export { validVersionOrRange } diff --git a/valid-versions-and-ranges.mjs b/valid-versions-and-ranges.mjs new file mode 100644 index 0000000..22ba86e --- /dev/null +++ b/valid-versions-and-ranges.mjs @@ -0,0 +1,21 @@ +import { validVersionOrRange } from './valid-version-or-range' + +/** + * Validates or filters a list of strings allowing only versions and ranges. By default, an exception is raised + * unless `options.ignoreNonVersions` is `true`, in which case it filters out invalid strings. + * @param {string[]} input - The list of versions and ranges to filter. + * @param {object} options - The options to pass to the validVersionOrRange function. + * @param {boolean} options.ignoreNonVersions - Whether to ignore non-version strings. + * @returns {string[]} - The filtered list of versions and ranges. + */ +const validateVersionsAndRanges = ( + input = throw new Error("'input' is required."), + { ignoreNonVersions, ...options } = {} +) => versions.filter((input) => + validVersionOrRange(version) !== null + ? true + : (ignoreNonVersions === true + ? false + : throw new Error(`'${version}' is not a valid semver.`))) + +export { validateVersionsAndRanges } From abf8dcd30189d8392473cb78f8721ed2154a2214 Mon Sep 17 00:00:00 2001 From: Zane Rockenbaugh Date: Sun, 19 Oct 2025 15:24:19 -0500 Subject: [PATCH 6/9] removed tmp save file and lint fixes --- src/max-satisfying.mjs | 2 +- src/test/valid-version-or-range.test.mjs | 6 +++--- src/valid-version-or-range.mjs | 5 +++-- valid-versions-and-ranges.mjs | 21 --------------------- 4 files changed, 7 insertions(+), 27 deletions(-) delete mode 100644 valid-versions-and-ranges.mjs diff --git a/src/max-satisfying.mjs b/src/max-satisfying.mjs index a1ed35f..f1aa27a 100644 --- a/src/max-satisfying.mjs +++ b/src/max-satisfying.mjs @@ -29,7 +29,7 @@ export const maxSatisfying = (versions, range, options) => { validVersionOrRange([range], { ...options, disallowVersions : true }) } - if (true) { // (options?.compat === true) { + if (options?.compat === true) { return semver.maxSatisfying(versions, range, options) } diff --git a/src/test/valid-version-or-range.test.mjs b/src/test/valid-version-or-range.test.mjs index 1fa4997..7c31537 100644 --- a/src/test/valid-version-or-range.test.mjs +++ b/src/test/valid-version-or-range.test.mjs @@ -9,15 +9,15 @@ describe('validVersionOrRange', () => { ['1.0.0 - 2', undefined, '>=1.0.0 <3.0.0-0'], ['1.0.x', { onlyXRange : true }, '>=1.0.0 <1.1.0-0'], ['not-a-valid-version', undefined, null], - [ 'not-a-valid-range', undefined, null], + ['not-a-valid-range', undefined, null], // invalid versions and ranges ['1.0.0', { disallowVersions : true }, null], - ['1.0.x', { disallowRanges : true }, null], + ['1.0.x', { disallowRanges : true }, null] ])('%s => %s', (input, options, expected) => expect(validVersionOrRange(input, options)).toBe(expected)) test.each([ ['not-a-valid-version', { throwIfInvalid : true }], - [ 'not-a-valid-range', { throwIfInvalid : true }], + ['not-a-valid-range', { throwIfInvalid : true }], // invalid versions and ranges ['1.0.0', { disallowVersions : true, throwIfInvalid : true }], ['1.0.x', { disallowRanges : true, throwIfInvalid : true }], diff --git a/src/valid-version-or-range.mjs b/src/valid-version-or-range.mjs index 012b394..563cbae 100644 --- a/src/valid-version-or-range.mjs +++ b/src/valid-version-or-range.mjs @@ -49,8 +49,9 @@ const validVersionOrRange = (input = throw new Error("'input' is required."), { // throw an exception if the string is invalid and `options.throwIfInvalid` is `true` if (normalized === null && throwIfInvalid === true) { const msg = `'${input}' is not a valid ` - + `${disallowVersions === true ? 'range exclusive of versions' : - (disallowRanges === true ? 'version' : 'version or range')}.` + + `${disallowVersions === true + ? 'range exclusive of versions' + : (disallowRanges === true ? 'version' : 'version or range')}.` throw new Error(msg) } diff --git a/valid-versions-and-ranges.mjs b/valid-versions-and-ranges.mjs deleted file mode 100644 index 22ba86e..0000000 --- a/valid-versions-and-ranges.mjs +++ /dev/null @@ -1,21 +0,0 @@ -import { validVersionOrRange } from './valid-version-or-range' - -/** - * Validates or filters a list of strings allowing only versions and ranges. By default, an exception is raised - * unless `options.ignoreNonVersions` is `true`, in which case it filters out invalid strings. - * @param {string[]} input - The list of versions and ranges to filter. - * @param {object} options - The options to pass to the validVersionOrRange function. - * @param {boolean} options.ignoreNonVersions - Whether to ignore non-version strings. - * @returns {string[]} - The filtered list of versions and ranges. - */ -const validateVersionsAndRanges = ( - input = throw new Error("'input' is required."), - { ignoreNonVersions, ...options } = {} -) => versions.filter((input) => - validVersionOrRange(version) !== null - ? true - : (ignoreNonVersions === true - ? false - : throw new Error(`'${version}' is not a valid semver.`))) - -export { validateVersionsAndRanges } From 82169d0c77780d6bd449bcfb19143c8d722fc1ef Mon Sep 17 00:00:00 2001 From: Zane Rockenbaugh Date: Sun, 19 Oct 2025 15:38:48 -0500 Subject: [PATCH 7/9] setup proper 'doc' target and ensure 'README.md' is built before a release --- Makefile | 3 +- README.md | 72 ++++++++++++++++++++-------------------- make/95-final-targets.mk | 21 ++++++------ package.json | 3 +- src/index.js | 8 ++--- 5 files changed, 53 insertions(+), 54 deletions(-) diff --git a/Makefile b/Makefile index a5ab378..97c6bed 100644 --- a/Makefile +++ b/Makefile @@ -7,8 +7,7 @@ SHELL:=bash default: all - -PHONY_TARGETS:=all default +PHONY_TARGETS:=default BUILD_TARGETS:= diff --git a/README.md b/README.md index 972ad1a..0ae0e7b 100644 --- a/README.md +++ b/README.md @@ -33,8 +33,7 @@ _API generated with [dmd-readme-api](https://www.npmjs.com/package/dmd-readme-ap - [`subset()`](#subset): Returns `true` if `subRange` is a subset of `superRange`, `false` otherwise. - [`upperBound()`](#upperBound): Finds the ceiling of a range. - [`validRange()`](#validRange): Returns a parsed, normalized range string or null if the range is invalid. - - [`maxSatisfyingVersionString()`](#maxSatisfyingVersionString): Like [maxVersion](maxVersion) but returns a string instead of a version object. - - [`minSatisfyingVersionString()`](#minSatisfyingVersionString): Like [minVersion](#minVersion) but returns a string instead of a version object. + - [`validVersionOrRange()`](#validVersionOrRange): Validates a string to be a valid version or range. - _Version operations_ - [`clean()`](#clean): Returns a cleaned version string removing unecessary comparators and, if `options.loose` is true, fixing space issues. - [`coerce()`](#coerce): Aggressively attempts to coerce a string into a valid semver string. @@ -300,7 +299,7 @@ Ascend sorts a mix of semver versions and x-range specified ranges (e.g., 1.2.* __Category__: [Comparison operations](#global-function-Comparison-operations-index) -### `gtr(version, range, options)` ⇒ `boolean` [source code](./src/semver-range-ops.mjs#L62) [global index](#global-function-index) +### `gtr(version, range, options)` ⇒ `boolean` [source code](./src/semver-range-ops.mjs#L52) [global index](#global-function-index) Returns `true` if `version` is greater than is greater than any version in `range`, `false` otherwise. @@ -317,7 +316,7 @@ Returns `true` if `version` is greater than is greater than any version in `rang __Category__: [Range operations](#global-function-Range-operations-index) -### `intersects(range, options)` ⇒ `boolean` [source code](./src/semver-range-ops.mjs#L99) [global index](#global-function-index) +### `intersects(range, options)` ⇒ `boolean` [source code](./src/semver-range-ops.mjs#L89) [global index](#global-function-index) Returns `true` if any of the comparators in the range intersect with each other. @@ -333,7 +332,7 @@ Returns `true` if any of the comparators in the range intersect with each other. __Category__: [Range operations](#global-function-Range-operations-index) -### `ltr(version, range, options)` ⇒ `boolean` [source code](./src/semver-range-ops.mjs#L74) [global index](#global-function-index) +### `ltr(version, range, options)` ⇒ `boolean` [source code](./src/semver-range-ops.mjs#L64) [global index](#global-function-index) Returns `true` if `version` is less than is less than any version in `range`, `false` otherwise. @@ -350,9 +349,13 @@ Returns `true` if `version` is less than is less than any version in `range`, `f __Category__: [Range operations](#global-function-Range-operations-index) -### `maxSatisfying(versions, range, options)` ⇒ `string` \| `null` [source code](./src/semver-range-ops.mjs#L38) [global index](#global-function-index) +### `maxSatisfying(versions, range, options)` ⇒ `string` \| `null` [source code](./src/max-satisfying.mjs#L26) [global index](#global-function-index) -Returns the highest version in `versions` that satisfies the range, or null if no version satisfies the range. +Returns the highest version in `versions` that satisfies the range, or null if no version satisfies the range. This +implementation differs from the base `semver.maxSatisfying` in that it correctly handles the following case: +`maxSatisfying(['1.0.0-alpha.0', '1.0.0'], '<1.0.0')` -> '1.0.0-alpha.0'. The base `semver.maxSatisfying` function +returns `null` in this case. Note, support for this syntax is not comprehensive and more complicated expressions are +likely to yield incorrect results. | Param | Type | Description | @@ -360,14 +363,17 @@ Returns the highest version in `versions` that satisfies the range, or null if n | `versions` | `Array.` | The versions to check. | | `range` | `string` | The range to check. | | `options` | `object` | The options to pass to the semver.maxSatisfying function. | +| `options.compat` | `boolean` | If true, then uses the base `semver.maxSatisfying` function. | | `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | +| `options.includePrerelease` | `boolean` | Include prerelease versions in the result. This is effectively implied if the range contains prerelease components. | +| `options.throwIfInvalid` | `boolean` | If true, throws an exception if any version or the range is invalid. | **Returns**: `string` \| `null` - - The highest version that satisfies the range, or null if no version satisfies the range. __Category__: [Range operations](#global-function-Range-operations-index) -### `minSatisfying(versions, range, options)` ⇒ `string` \| `null` [source code](./src/semver-range-ops.mjs#L50) [global index](#global-function-index) +### `minSatisfying(versions, range, options)` ⇒ `string` \| `null` [source code](./src/semver-range-ops.mjs#L40) [global index](#global-function-index) Returns the lowest version in `versions` that satisfies the range, or null if no version satisfies the range. @@ -384,11 +390,12 @@ Returns the lowest version in `versions` that satisfies the range, or null if no __Category__: [Range operations](#global-function-Range-operations-index) -### `minVersion(range, options)` ⇒ `string` \| `null` [source code](./src/min-version.mjs#L18) [global index](#global-function-index) +### `minVersion(range, options)` ⇒ `string` \| `null` [source code](./src/min-version.mjs#L19) [global index](#global-function-index) Returns the lowest version that satisfies the range, or null if no version satisfies the range. This implementation differs from the base `semver.minVersion` in that it correctly handles simple prerelease x-ranges. E.g., -'1.0.0-alpha.x' -> '1.0.0-alpha.0'. To suppress this behavior, pass `options.compat = true`. +'1.0.0-alpha.x' -> '1.0.0-alpha.0'. To suppress this behavior, pass `options.compat = true`. Note, support for this +syntax is not comprehensive and more complicated expressions are likely to yield incorrect results. | Param | Type | Description | @@ -404,7 +411,7 @@ differs from the base `semver.minVersion` in that it correctly handles simple pr __Category__: [Range operations](#global-function-Range-operations-index) -### `outside(version, range, direction, options)` ⇒ `boolean` [source code](./src/semver-range-ops.mjs#L88) [global index](#global-function-index) +### `outside(version, range, direction, options)` ⇒ `boolean` [source code](./src/semver-range-ops.mjs#L78) [global index](#global-function-index) Returns `true` if `version` is outside of `range` in the indicated direction, `false` otherwise. `outside(v, r, '>)` is equivalent to `gtr(v, r)`. @@ -423,7 +430,7 @@ is equivalent to `gtr(v, r)`. __Category__: [Range operations](#global-function-Range-operations-index) -### `satisfies(version, range, options)` ⇒ `boolean` [source code](./src/semver-range-ops.mjs#L26) [global index](#global-function-index) +### `satisfies(version, range, options)` ⇒ `boolean` [source code](./src/semver-range-ops.mjs#L28) [global index](#global-function-index) Returns `true` if the version satisfies the range, `false` otherwise. @@ -440,7 +447,7 @@ Returns `true` if the version satisfies the range, `false` otherwise. __Category__: [Range operations](#global-function-Range-operations-index) -### `simplifyRange(versions, range, options)` ⇒ `string` [source code](./src/semver-range-ops.mjs#L115) [global index](#global-function-index) +### `simplifyRange(versions, range, options)` ⇒ `string` [source code](./src/semver-range-ops.mjs#L105) [global index](#global-function-index) Return a "simplified" range that matches the same items in the versions list as the range specified. Note that it does not guarantee that it would match the same versions in all cases, only for the set of versions provided. This @@ -461,7 +468,7 @@ then that is returned. __Category__: [Range operations](#global-function-Range-operations-index) -### `subset(subRange, superRange, options)` ⇒ `boolean` [source code](./src/semver-range-ops.mjs#L127) [global index](#global-function-index) +### `subset(subRange, superRange, options)` ⇒ `boolean` [source code](./src/semver-range-ops.mjs#L117) [global index](#global-function-index) Returns `true` if `subRange` is a subset of `superRange`, `false` otherwise. @@ -494,7 +501,7 @@ function where 'verision-0' least range above the given range. __Category__: [Range operations](#global-function-Range-operations-index) -### `validRange(range, options)` ⇒ `string` \| `null` [source code](./src/semver-range-ops.mjs#L14) [global index](#global-function-index) +### `validRange(range, options)` ⇒ `string` \| `null` [source code](./src/semver-range-ops.mjs#L16) [global index](#global-function-index) Returns a parsed, normalized range string or null if the range is invalid. @@ -509,33 +516,26 @@ Returns a parsed, normalized range string or null if the range is invalid. __Category__: [Range operations](#global-function-Range-operations-index) - -### `maxSatisfyingVersionString(versions, options)` ⇒ `string` \| `null` [source code](./src/max-satisfying-version-string.mjs#L13) [global index](#global-function-index) + +### `validVersionOrRange(input, options)` ⇒ `string` \| `null` [source code](./src/valid-version-or-range.mjs#L20) [global index](#global-function-index) -Like [maxVersion](maxVersion) but returns a string instead of a version object. +Validates a string to be a valid version or range. By default, an exception is raised unless `options.disallowVersions` +is `true`, in which case it filters out invalid strings and returns a new array. | Param | Type | Description | | --- | --- | --- | -| `versions` | `Array.` | The versions to compare. | -| `options` | `object` | The options to pass to the compareHelper function. | -| `options.ignoreNonVersions` | `boolean` | Whether to ignore non-version strings. | - -**Returns**: `string` \| `null` - - The maximum version string or null if no version strings are provided. - - -### `minSatisfyingVersionString(versions, options)` ⇒ `string` \| `null` [source code](./src/min-satisfying-version-string.mjs#L13) [global index](#global-function-index) - -Like [minVersion](#minVersion) but returns a string instead of a version object. - - -| Param | Type | Description | -| --- | --- | --- | -| `versions` | `Array.` | The versions to compare. | -| `options` | `object` | The options to pass to the compareHelper function. | -| `options.ignoreNonVersions` | `boolean` | Whether to ignore non-version strings. | +| `input` | `string` | The string to validate. | +| `options` | `object` | The options to pass to the semver.valid function. | +| `options.disallowRanges` | `boolean` | Whether to disallow ranges. | +| `options.disallowVersions` | `boolean` | Whether to disallow versions and ranges which are valid versions. | +| `options.includePrerelease` | `boolean` | Whether to include prerelease versions. | +| `options.loose` | `boolean` | Allow non-conforming, but recognizable semver strings. | +| `options.onlyXRange` | `boolean` | Whether to only allow x-ranges. Note, even if this is `true`, and a valid x-range is presented, the returned string will still be normalized. | +| `options.throwIfInvalid` | `boolean` | If true, throws an exception if the string is invalid. | -**Returns**: `string` \| `null` - - The minimum version string or null if no version strings are provided. +**Returns**: `string` \| `null` - - A normalized version or range string or `null` if the string is invalid (if +`options.throwIfInvalid` is `true`, in which case an exception is thrown). ### `clean(version, options)` ⇒ `string` \| `null` [source code](./src/semver-version-ops.mjs#L109) [global index](#global-function-index) diff --git a/make/95-final-targets.mk b/make/95-final-targets.mk index 66ccb79..eb14f4f 100644 --- a/make/95-final-targets.mk +++ b/make/95-final-targets.mk @@ -2,26 +2,27 @@ # to https://npmjs.com/package/@liquid-labs/sdlc-projects-workflow-node-build for # further details +.DEFAULT_GOAL:=all + .PRECIOUS: $(PRECIOUS_TARGETS) build: $(BUILD_TARGETS) +.PHONY+= build -PHONY_TARGETS+=build +all: build doc +.PHONY+= all -all: build +doc: $(DOC_TARGETS) +.PHONY+= doc lint: $(LINT_TARGETS) - lint-fix: $(LINT_FIX_TARGETS) - -PHONY_TARGETS+=lint lint-fix +.PHONY+=lint lint-fix test: $(TEST_TARGETS) - -PHONY_TARGETS+= test +.PHONY+= test qa: test lint +.PHONY+=qa -PHONY_TARGETS+=qa - -.PHONY: $(PHONY_TARGETS) +.PHONY: $(.PHONY) diff --git a/package.json b/package.json index 1f11a22..bd99db6 100644 --- a/package.json +++ b/package.json @@ -5,10 +5,11 @@ "main": "dist/semver-plus.js", "scripts": { "build": "make build", + "doc": "make doc", "lint": "make lint", "lint:fix": "make lint-fix", "test": "make test", - "preversion": "npm run qa", + "preversion": "npm run qa && npm run doc", "prepack": "npm run build", "qa": "make qa" }, diff --git a/src/index.js b/src/index.js index a815035..913a643 100644 --- a/src/index.js +++ b/src/index.js @@ -1,13 +1,11 @@ export * from './ext-constants' -export * from './filter-valid-versions' -export * from './filter-valid-version-or-range' +export * from './min-version' +export * from './max-satisfying' export * from './min-version' export * from './next-version' -export * from './prerelease' +export * from './semver-comparison-ops' export * from './semver-range-ops' export * from './semver-version-ops' -export * from './semver-comparison-ops' export * from './upper-bound' export * from './valid-version-or-range' -export * from './version-compare' export * from './x-sort' From c0048281a7f0c99d0b7be0ba3dd168f77213b9cd Mon Sep 17 00:00:00 2001 From: Zane Rockenbaugh Date: Sun, 19 Oct 2025 15:40:15 -0500 Subject: [PATCH 8/9] Save QA files. --- qa/coverage/base.css | 224 +++++++ qa/coverage/block-navigation.js | 87 +++ qa/coverage/clover.xml | 266 ++++++++ qa/coverage/coverage-final.json | 14 + qa/coverage/favicon.png | Bin 0 -> 445 bytes qa/coverage/index.html | 131 ++++ qa/coverage/prettify.css | 1 + qa/coverage/prettify.js | 2 + qa/coverage/sort-arrow-sprite.png | Bin 0 -> 138 bytes qa/coverage/sorter.js | 196 ++++++ qa/coverage/src/constants.mjs.html | 100 +++ qa/coverage/src/ext-constants.mjs.html | 154 +++++ qa/coverage/src/index.html | 266 ++++++++ qa/coverage/src/lib/compare-helper.mjs.html | 133 ++++ qa/coverage/src/lib/index.html | 131 ++++ .../src/lib/set-default-options.mjs.html | 121 ++++ qa/coverage/src/max-satisfying.mjs.html | 217 +++++++ qa/coverage/src/min-version.mjs.html | 169 +++++ qa/coverage/src/next-version.mjs.html | 403 ++++++++++++ .../src/semver-comparison-ops.mjs.html | 595 ++++++++++++++++++ qa/coverage/src/semver-range-ops.mjs.html | 436 +++++++++++++ qa/coverage/src/semver-version-ops.mjs.html | 412 ++++++++++++ qa/coverage/src/upper-bound.mjs.html | 154 +++++ .../src/valid-version-or-range.mjs.html | 268 ++++++++ qa/coverage/src/x-sort.mjs.html | 418 ++++++++++++ qa/lint.txt | 1 + qa/unit-test.txt | 34 + 27 files changed, 4933 insertions(+) create mode 100644 qa/coverage/base.css create mode 100644 qa/coverage/block-navigation.js create mode 100644 qa/coverage/clover.xml create mode 100644 qa/coverage/coverage-final.json create mode 100644 qa/coverage/favicon.png create mode 100644 qa/coverage/index.html create mode 100644 qa/coverage/prettify.css create mode 100644 qa/coverage/prettify.js create mode 100644 qa/coverage/sort-arrow-sprite.png create mode 100644 qa/coverage/sorter.js create mode 100644 qa/coverage/src/constants.mjs.html create mode 100644 qa/coverage/src/ext-constants.mjs.html create mode 100644 qa/coverage/src/index.html create mode 100644 qa/coverage/src/lib/compare-helper.mjs.html create mode 100644 qa/coverage/src/lib/index.html create mode 100644 qa/coverage/src/lib/set-default-options.mjs.html create mode 100644 qa/coverage/src/max-satisfying.mjs.html create mode 100644 qa/coverage/src/min-version.mjs.html create mode 100644 qa/coverage/src/next-version.mjs.html create mode 100644 qa/coverage/src/semver-comparison-ops.mjs.html create mode 100644 qa/coverage/src/semver-range-ops.mjs.html create mode 100644 qa/coverage/src/semver-version-ops.mjs.html create mode 100644 qa/coverage/src/upper-bound.mjs.html create mode 100644 qa/coverage/src/valid-version-or-range.mjs.html create mode 100644 qa/coverage/src/x-sort.mjs.html create mode 100644 qa/lint.txt create mode 100644 qa/unit-test.txt diff --git a/qa/coverage/base.css b/qa/coverage/base.css new file mode 100644 index 0000000..f418035 --- /dev/null +++ b/qa/coverage/base.css @@ -0,0 +1,224 @@ +body, html { + margin:0; padding: 0; + height: 100%; +} +body { + font-family: Helvetica Neue, Helvetica, Arial; + font-size: 14px; + color:#333; +} +.small { font-size: 12px; } +*, *:after, *:before { + -webkit-box-sizing:border-box; + -moz-box-sizing:border-box; + box-sizing:border-box; + } +h1 { font-size: 20px; margin: 0;} +h2 { font-size: 14px; } +pre { + font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; + margin: 0; + padding: 0; + -moz-tab-size: 2; + -o-tab-size: 2; + tab-size: 2; +} +a { color:#0074D9; text-decoration:none; } +a:hover { text-decoration:underline; } +.strong { font-weight: bold; } +.space-top1 { padding: 10px 0 0 0; } +.pad2y { padding: 20px 0; } +.pad1y { padding: 10px 0; } +.pad2x { padding: 0 20px; } +.pad2 { padding: 20px; } +.pad1 { padding: 10px; } +.space-left2 { padding-left:55px; } +.space-right2 { padding-right:20px; } +.center { text-align:center; } +.clearfix { display:block; } +.clearfix:after { + content:''; + display:block; + height:0; + clear:both; + visibility:hidden; + } +.fl { float: left; } +@media only screen and (max-width:640px) { + .col3 { width:100%; max-width:100%; } + .hide-mobile { display:none!important; } +} + +.quiet { + color: #7f7f7f; + color: rgba(0,0,0,0.5); +} +.quiet a { opacity: 0.7; } + +.fraction { + font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; + font-size: 10px; + color: #555; + background: #E8E8E8; + padding: 4px 5px; + border-radius: 3px; + vertical-align: middle; +} + +div.path a:link, div.path a:visited { color: #333; } +table.coverage { + border-collapse: collapse; + margin: 10px 0 0 0; + padding: 0; +} + +table.coverage td { + margin: 0; + padding: 0; + vertical-align: top; +} +table.coverage td.line-count { + text-align: right; + padding: 0 5px 0 20px; +} +table.coverage td.line-coverage { + text-align: right; + padding-right: 10px; + min-width:20px; +} + +table.coverage td span.cline-any { + display: inline-block; + padding: 0 5px; + width: 100%; +} +.missing-if-branch { + display: inline-block; + margin-right: 5px; + border-radius: 3px; + position: relative; + padding: 0 4px; + background: #333; + color: yellow; +} + +.skip-if-branch { + display: none; + margin-right: 10px; + position: relative; + padding: 0 4px; + background: #ccc; + color: white; +} +.missing-if-branch .typ, .skip-if-branch .typ { + color: inherit !important; +} +.coverage-summary { + border-collapse: collapse; + width: 100%; +} +.coverage-summary tr { border-bottom: 1px solid #bbb; } +.keyline-all { border: 1px solid #ddd; } +.coverage-summary td, .coverage-summary th { padding: 10px; } +.coverage-summary tbody { border: 1px solid #bbb; } +.coverage-summary td { border-right: 1px solid #bbb; } +.coverage-summary td:last-child { border-right: none; } +.coverage-summary th { + text-align: left; + font-weight: normal; + white-space: nowrap; +} +.coverage-summary th.file { border-right: none !important; } +.coverage-summary th.pct { } +.coverage-summary th.pic, +.coverage-summary th.abs, +.coverage-summary td.pct, +.coverage-summary td.abs { text-align: right; } +.coverage-summary td.file { white-space: nowrap; } +.coverage-summary td.pic { min-width: 120px !important; } +.coverage-summary tfoot td { } + +.coverage-summary .sorter { + height: 10px; + width: 7px; + display: inline-block; + margin-left: 0.5em; + background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; +} +.coverage-summary .sorted .sorter { + background-position: 0 -20px; +} +.coverage-summary .sorted-desc .sorter { + background-position: 0 -10px; +} +.status-line { height: 10px; } +/* yellow */ +.cbranch-no { background: yellow !important; color: #111; } +/* dark red */ +.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } +.low .chart { border:1px solid #C21F39 } +.highlighted, +.highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{ + background: #C21F39 !important; +} +/* medium red */ +.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } +/* light red */ +.low, .cline-no { background:#FCE1E5 } +/* light green */ +.high, .cline-yes { background:rgb(230,245,208) } +/* medium green */ +.cstat-yes { background:rgb(161,215,106) } +/* dark green */ +.status-line.high, .high .cover-fill { background:rgb(77,146,33) } +.high .chart { border:1px solid rgb(77,146,33) } +/* dark yellow (gold) */ +.status-line.medium, .medium .cover-fill { background: #f9cd0b; } +.medium .chart { border:1px solid #f9cd0b; } +/* light yellow */ +.medium { background: #fff4c2; } + +.cstat-skip { background: #ddd; color: #111; } +.fstat-skip { background: #ddd; color: #111 !important; } +.cbranch-skip { background: #ddd !important; color: #111; } + +span.cline-neutral { background: #eaeaea; } + +.coverage-summary td.empty { + opacity: .5; + padding-top: 4px; + padding-bottom: 4px; + line-height: 1; + color: #888; +} + +.cover-fill, .cover-empty { + display:inline-block; + height: 12px; +} +.chart { + line-height: 0; +} +.cover-empty { + background: white; +} +.cover-full { + border-right: none !important; +} +pre.prettyprint { + border: none !important; + padding: 0 !important; + margin: 0 !important; +} +.com { color: #999 !important; } +.ignore-none { color: #999; font-weight: normal; } + +.wrapper { + min-height: 100%; + height: auto !important; + height: 100%; + margin: 0 auto -48px; +} +.footer, .push { + height: 48px; +} diff --git a/qa/coverage/block-navigation.js b/qa/coverage/block-navigation.js new file mode 100644 index 0000000..cc12130 --- /dev/null +++ b/qa/coverage/block-navigation.js @@ -0,0 +1,87 @@ +/* eslint-disable */ +var jumpToCode = (function init() { + // Classes of code we would like to highlight in the file view + var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no']; + + // Elements to highlight in the file listing view + var fileListingElements = ['td.pct.low']; + + // We don't want to select elements that are direct descendants of another match + var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > ` + + // Selecter that finds elements on the page to which we can jump + var selector = + fileListingElements.join(', ') + + ', ' + + notSelector + + missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b` + + // The NodeList of matching elements + var missingCoverageElements = document.querySelectorAll(selector); + + var currentIndex; + + function toggleClass(index) { + missingCoverageElements + .item(currentIndex) + .classList.remove('highlighted'); + missingCoverageElements.item(index).classList.add('highlighted'); + } + + function makeCurrent(index) { + toggleClass(index); + currentIndex = index; + missingCoverageElements.item(index).scrollIntoView({ + behavior: 'smooth', + block: 'center', + inline: 'center' + }); + } + + function goToPrevious() { + var nextIndex = 0; + if (typeof currentIndex !== 'number' || currentIndex === 0) { + nextIndex = missingCoverageElements.length - 1; + } else if (missingCoverageElements.length > 1) { + nextIndex = currentIndex - 1; + } + + makeCurrent(nextIndex); + } + + function goToNext() { + var nextIndex = 0; + + if ( + typeof currentIndex === 'number' && + currentIndex < missingCoverageElements.length - 1 + ) { + nextIndex = currentIndex + 1; + } + + makeCurrent(nextIndex); + } + + return function jump(event) { + if ( + document.getElementById('fileSearch') === document.activeElement && + document.activeElement != null + ) { + // if we're currently focused on the search input, we don't want to navigate + return; + } + + switch (event.which) { + case 78: // n + case 74: // j + goToNext(); + break; + case 66: // b + case 75: // k + case 80: // p + goToPrevious(); + break; + } + }; +})(); +window.addEventListener('keydown', jumpToCode); diff --git a/qa/coverage/clover.xml b/qa/coverage/clover.xml new file mode 100644 index 0000000..34898ce --- /dev/null +++ b/qa/coverage/clover.xml @@ -0,0 +1,266 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/qa/coverage/coverage-final.json b/qa/coverage/coverage-final.json new file mode 100644 index 0000000..c8fbe44 --- /dev/null +++ b/qa/coverage/coverage-final.json @@ -0,0 +1,14 @@ +{"/Users/zane/playground/liquid-labs/semver-plus/src/constants.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/constants.mjs","statementMap":{"0":{"start":{"line":1,"column":21},"end":{"line":4,"column":121}},"1":{"start":{"line":5,"column":31},"end":{"line":5,"column":96}}},"fnMap":{},"branchMap":{},"s":{"0":4,"1":4},"f":{},"b":{}} +,"/Users/zane/playground/liquid-labs/semver-plus/src/ext-constants.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/ext-constants.mjs","statementMap":{"0":{"start":{"line":1,"column":32},"end":{"line":13,"column":null}},"1":{"start":{"line":16,"column":43},"end":{"line":16,"column":102}},"2":{"start":{"line":17,"column":38},"end":{"line":17,"column":64}},"3":{"start":{"line":18,"column":35},"end":{"line":18,"column":76}},"4":{"start":{"line":20,"column":0},"end":{"line":20,"column":null}},"5":{"start":{"line":21,"column":0},"end":{"line":21,"column":null}},"6":{"start":{"line":22,"column":0},"end":{"line":22,"column":null}},"7":{"start":{"line":23,"column":0},"end":{"line":23,"column":null}}},"fnMap":{},"branchMap":{},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1},"f":{},"b":{}} +,"/Users/zane/playground/liquid-labs/semver-plus/src/max-satisfying.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/max-satisfying.mjs","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":null}},"2":{"start":{"line":4,"column":0},"end":{"line":4,"column":null}},"3":{"start":{"line":5,"column":0},"end":{"line":5,"column":null}},"4":{"start":{"line":26,"column":29},"end":{"line":44,"column":1}},"5":{"start":{"line":27,"column":2},"end":{"line":30,"column":null}},"6":{"start":{"line":28,"column":4},"end":{"line":28,"column":null}},"7":{"start":{"line":29,"column":4},"end":{"line":29,"column":null}},"8":{"start":{"line":32,"column":2},"end":{"line":34,"column":null}},"9":{"start":{"line":33,"column":4},"end":{"line":33,"column":null}},"10":{"start":{"line":36,"column":2},"end":{"line":36,"column":null}},"11":{"start":{"line":38,"column":2},"end":{"line":42,"column":null}},"12":{"start":{"line":39,"column":4},"end":{"line":41,"column":null}},"13":{"start":{"line":40,"column":6},"end":{"line":40,"column":null}},"14":{"start":{"line":43,"column":2},"end":{"line":43,"column":null}},"15":{"start":{"line":44,"column":1},"end":{"line":44,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":26,"column":29},"end":{"line":26,"column":30}},"loc":{"start":{"line":26,"column":59},"end":{"line":44,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":27,"column":2},"end":{"line":30,"column":null}},"type":"if","locations":[{"start":{"line":27,"column":2},"end":{"line":30,"column":null}}]},"1":{"loc":{"start":{"line":27,"column":6},"end":{"line":27,"column":29}},"type":"cond-expr","locations":[{"start":{"line":27,"column":13},"end":{"line":27,"column":15}},{"start":{"line":27,"column":6},"end":{"line":27,"column":29}}]},"2":{"loc":{"start":{"line":27,"column":6},"end":{"line":27,"column":15}},"type":"binary-expr","locations":[{"start":{"line":27,"column":6},"end":{"line":27,"column":15}},{"start":{"line":27,"column":6},"end":{"line":27,"column":15}}]},"3":{"loc":{"start":{"line":32,"column":2},"end":{"line":34,"column":null}},"type":"if","locations":[{"start":{"line":32,"column":2},"end":{"line":34,"column":null}}]},"4":{"loc":{"start":{"line":32,"column":6},"end":{"line":32,"column":21}},"type":"cond-expr","locations":[{"start":{"line":32,"column":13},"end":{"line":32,"column":15}},{"start":{"line":32,"column":6},"end":{"line":32,"column":21}}]},"5":{"loc":{"start":{"line":32,"column":6},"end":{"line":32,"column":15}},"type":"binary-expr","locations":[{"start":{"line":32,"column":6},"end":{"line":32,"column":15}},{"start":{"line":32,"column":6},"end":{"line":32,"column":15}}]},"6":{"loc":{"start":{"line":39,"column":4},"end":{"line":41,"column":null}},"type":"if","locations":[{"start":{"line":39,"column":4},"end":{"line":41,"column":null}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":16,"6":1,"7":0,"8":15,"9":1,"10":14,"11":14,"12":18,"13":11,"14":3,"15":1},"f":{"0":16},"b":{"0":[1],"1":[7,9],"2":[16,16],"3":[1],"4":[7,8],"5":[15,15],"6":[11]}} +,"/Users/zane/playground/liquid-labs/semver-plus/src/min-version.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/min-version.mjs","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":null}},"2":{"start":{"line":19,"column":19},"end":{"line":26,"column":1}},"3":{"start":{"line":22,"column":2},"end":{"line":24,"column":null}},"4":{"start":{"line":23,"column":4},"end":{"line":23,"column":null}},"5":{"start":{"line":25,"column":2},"end":{"line":25,"column":null}},"6":{"start":{"line":26,"column":1},"end":{"line":26,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":19,"column":19},"end":{"line":19,"column":20}},"loc":{"start":{"line":19,"column":39},"end":{"line":26,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":22,"column":2},"end":{"line":24,"column":null}},"type":"if","locations":[{"start":{"line":22,"column":2},"end":{"line":24,"column":null}}]},"1":{"loc":{"start":{"line":22,"column":6},"end":{"line":22,"column":65}},"type":"binary-expr","locations":[{"start":{"line":22,"column":6},"end":{"line":22,"column":30}},{"start":{"line":22,"column":34},"end":{"line":22,"column":65}}]},"2":{"loc":{"start":{"line":22,"column":6},"end":{"line":22,"column":21}},"type":"cond-expr","locations":[{"start":{"line":22,"column":13},"end":{"line":22,"column":15}},{"start":{"line":22,"column":6},"end":{"line":22,"column":21}}]},"3":{"loc":{"start":{"line":22,"column":6},"end":{"line":22,"column":15}},"type":"binary-expr","locations":[{"start":{"line":22,"column":6},"end":{"line":22,"column":15}},{"start":{"line":22,"column":6},"end":{"line":22,"column":15}}]}},"s":{"0":1,"1":1,"2":1,"3":21,"4":5,"5":16,"6":1},"f":{"0":21},"b":{"0":[5],"1":[21,21],"2":[21,0],"3":[21,21]}} +,"/Users/zane/playground/liquid-labs/semver-plus/src/next-version.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/next-version.mjs","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":null}},"2":{"start":{"line":4,"column":0},"end":{"line":4,"column":null}},"3":{"start":{"line":23,"column":20},"end":{"line":104,"column":1}},"4":{"start":{"line":24,"column":2},"end":{"line":27,"column":null}},"5":{"start":{"line":25,"column":17},"end":{"line":25,"column":108}},"6":{"start":{"line":26,"column":4},"end":{"line":26,"column":null}},"7":{"start":{"line":29,"column":2},"end":{"line":31,"column":null}},"8":{"start":{"line":30,"column":4},"end":{"line":30,"column":null}},"9":{"start":{"line":32,"column":30},"end":{"line":32,"column":53}},"10":{"start":{"line":33,"column":30},"end":{"line":33,"column":117}},"11":{"start":{"line":35,"column":2},"end":{"line":35,"column":null}},"12":{"start":{"line":40,"column":35},"end":{"line":40,"column":61}},"13":{"start":{"line":41,"column":25},"end":{"line":41,"column":102}},"14":{"start":{"line":44,"column":29},"end":{"line":44,"column":126}},"15":{"start":{"line":45,"column":33},"end":{"line":47,"column":72}},"16":{"start":{"line":48,"column":35},"end":{"line":48,"column":93}},"17":{"start":{"line":51,"column":2},"end":{"line":53,"column":null}},"18":{"start":{"line":52,"column":4},"end":{"line":52,"column":null}},"19":{"start":{"line":54,"column":2},"end":{"line":69,"column":null}},"20":{"start":{"line":55,"column":4},"end":{"line":55,"column":null}},"21":{"start":{"line":57,"column":7},"end":{"line":69,"column":null}},"22":{"start":{"line":58,"column":22},"end":{"line":58,"column":79}},"23":{"start":{"line":59,"column":27},"end":{"line":59,"column":71}},"24":{"start":{"line":60,"column":4},"end":{"line":62,"column":null}},"25":{"start":{"line":61,"column":6},"end":{"line":61,"column":null}},"26":{"start":{"line":64,"column":7},"end":{"line":69,"column":null}},"27":{"start":{"line":65,"column":4},"end":{"line":65,"column":null}},"28":{"start":{"line":67,"column":7},"end":{"line":69,"column":null}},"29":{"start":{"line":68,"column":4},"end":{"line":68,"column":null}},"30":{"start":{"line":72,"column":2},"end":{"line":94,"column":null}},"31":{"start":{"line":73,"column":4},"end":{"line":77,"column":null}},"32":{"start":{"line":73,"column":44},"end":{"line":73,"column":null}},"33":{"start":{"line":74,"column":9},"end":{"line":77,"column":null}},"34":{"start":{"line":74,"column":48},"end":{"line":74,"column":null}},"35":{"start":{"line":75,"column":9},"end":{"line":77,"column":null}},"36":{"start":{"line":76,"column":6},"end":{"line":76,"column":null}},"37":{"start":{"line":79,"column":4},"end":{"line":79,"column":19}},"38":{"start":{"line":81,"column":7},"end":{"line":94,"column":null}},"39":{"start":{"line":82,"column":4},"end":{"line":87,"column":null}},"40":{"start":{"line":83,"column":6},"end":{"line":83,"column":null}},"41":{"start":{"line":86,"column":6},"end":{"line":86,"column":null}},"42":{"start":{"line":89,"column":4},"end":{"line":89,"column":null}},"43":{"start":{"line":91,"column":7},"end":{"line":94,"column":null}},"44":{"start":{"line":93,"column":4},"end":{"line":93,"column":null}},"45":{"start":{"line":96,"column":2},"end":{"line":96,"column":null}},"46":{"start":{"line":104,"column":1},"end":{"line":104,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":23,"column":20},"end":{"line":23,"column":21}},"loc":{"start":{"line":23,"column":44},"end":{"line":104,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":24,"column":2},"end":{"line":27,"column":null}},"type":"if","locations":[{"start":{"line":24,"column":2},"end":{"line":27,"column":null}}]},"1":{"loc":{"start":{"line":25,"column":50},"end":{"line":25,"column":107}},"type":"cond-expr","locations":[{"start":{"line":25,"column":79},"end":{"line":25,"column":101}},{"start":{"line":25,"column":104},"end":{"line":25,"column":107}}]},"2":{"loc":{"start":{"line":29,"column":2},"end":{"line":31,"column":null}},"type":"if","locations":[{"start":{"line":29,"column":2},"end":{"line":31,"column":null}}]},"3":{"loc":{"start":{"line":29,"column":6},"end":{"line":29,"column":73}},"type":"binary-expr","locations":[{"start":{"line":29,"column":6},"end":{"line":29,"column":29}},{"start":{"line":29,"column":33},"end":{"line":29,"column":73}}]},"4":{"loc":{"start":{"line":35,"column":14},"end":{"line":35,"column":73}},"type":"binary-expr","locations":[{"start":{"line":35,"column":14},"end":{"line":35,"column":23}},{"start":{"line":35,"column":28},"end":{"line":35,"column":72}}]},"5":{"loc":{"start":{"line":35,"column":28},"end":{"line":35,"column":72}},"type":"cond-expr","locations":[{"start":{"line":35,"column":50},"end":{"line":35,"column":57}},{"start":{"line":35,"column":60},"end":{"line":35,"column":72}}]},"6":{"loc":{"start":{"line":41,"column":25},"end":{"line":41,"column":102}},"type":"cond-expr","locations":[{"start":{"line":41,"column":61},"end":{"line":41,"column":65}},{"start":{"line":41,"column":68},"end":{"line":41,"column":102}}]},"7":{"loc":{"start":{"line":44,"column":29},"end":{"line":44,"column":126}},"type":"cond-expr","locations":[{"start":{"line":44,"column":55},"end":{"line":44,"column":59}},{"start":{"line":44,"column":62},"end":{"line":44,"column":126}}]},"8":{"loc":{"start":{"line":45,"column":33},"end":{"line":47,"column":72}},"type":"cond-expr","locations":[{"start":{"line":46,"column":6},"end":{"line":46,"column":10}},{"start":{"line":47,"column":7},"end":{"line":47,"column":72}}]},"9":{"loc":{"start":{"line":47,"column":7},"end":{"line":47,"column":72}},"type":"cond-expr","locations":[{"start":{"line":47,"column":45},"end":{"line":47,"column":47}},{"start":{"line":47,"column":50},"end":{"line":47,"column":72}}]},"10":{"loc":{"start":{"line":51,"column":2},"end":{"line":53,"column":null}},"type":"if","locations":[{"start":{"line":51,"column":2},"end":{"line":53,"column":null}}]},"11":{"loc":{"start":{"line":51,"column":6},"end":{"line":51,"column":92}},"type":"binary-expr","locations":[{"start":{"line":51,"column":6},"end":{"line":51,"column":29}},{"start":{"line":51,"column":33},"end":{"line":51,"column":92}}]},"12":{"loc":{"start":{"line":54,"column":2},"end":{"line":69,"column":null}},"type":"if","locations":[{"start":{"line":54,"column":2},"end":{"line":69,"column":null}},{"start":{"line":57,"column":7},"end":{"line":69,"column":null}}]},"13":{"loc":{"start":{"line":54,"column":6},"end":{"line":54,"column":67}},"type":"binary-expr","locations":[{"start":{"line":54,"column":6},"end":{"line":54,"column":32}},{"start":{"line":54,"column":36},"end":{"line":54,"column":67}}]},"14":{"loc":{"start":{"line":57,"column":7},"end":{"line":69,"column":null}},"type":"if","locations":[{"start":{"line":57,"column":7},"end":{"line":69,"column":null}},{"start":{"line":64,"column":7},"end":{"line":69,"column":null}}]},"15":{"loc":{"start":{"line":57,"column":11},"end":{"line":57,"column":93}},"type":"binary-expr","locations":[{"start":{"line":57,"column":11},"end":{"line":57,"column":44}},{"start":{"line":57,"column":48},"end":{"line":57,"column":93}}]},"16":{"loc":{"start":{"line":60,"column":4},"end":{"line":62,"column":null}},"type":"if","locations":[{"start":{"line":60,"column":4},"end":{"line":62,"column":null}}]},"17":{"loc":{"start":{"line":64,"column":7},"end":{"line":69,"column":null}},"type":"if","locations":[{"start":{"line":64,"column":7},"end":{"line":69,"column":null}},{"start":{"line":67,"column":7},"end":{"line":69,"column":null}}]},"18":{"loc":{"start":{"line":64,"column":11},"end":{"line":64,"column":84}},"type":"binary-expr","locations":[{"start":{"line":64,"column":11},"end":{"line":64,"column":30}},{"start":{"line":64,"column":34},"end":{"line":64,"column":84}}]},"19":{"loc":{"start":{"line":67,"column":7},"end":{"line":69,"column":null}},"type":"if","locations":[{"start":{"line":67,"column":7},"end":{"line":69,"column":null}}]},"20":{"loc":{"start":{"line":67,"column":11},"end":{"line":67,"column":86}},"type":"binary-expr","locations":[{"start":{"line":67,"column":11},"end":{"line":67,"column":31}},{"start":{"line":67,"column":35},"end":{"line":67,"column":86}}]},"21":{"loc":{"start":{"line":72,"column":2},"end":{"line":94,"column":null}},"type":"if","locations":[{"start":{"line":72,"column":2},"end":{"line":94,"column":null}},{"start":{"line":81,"column":7},"end":{"line":94,"column":null}}]},"22":{"loc":{"start":{"line":73,"column":4},"end":{"line":77,"column":null}},"type":"if","locations":[{"start":{"line":73,"column":4},"end":{"line":77,"column":null}},{"start":{"line":74,"column":9},"end":{"line":77,"column":null}}]},"23":{"loc":{"start":{"line":74,"column":9},"end":{"line":77,"column":null}},"type":"if","locations":[{"start":{"line":74,"column":9},"end":{"line":77,"column":null}},{"start":{"line":75,"column":9},"end":{"line":77,"column":null}}]},"24":{"loc":{"start":{"line":75,"column":9},"end":{"line":77,"column":null}},"type":"if","locations":[{"start":{"line":75,"column":9},"end":{"line":77,"column":null}}]},"25":{"loc":{"start":{"line":81,"column":7},"end":{"line":94,"column":null}},"type":"if","locations":[{"start":{"line":81,"column":7},"end":{"line":94,"column":null}},{"start":{"line":91,"column":7},"end":{"line":94,"column":null}}]},"26":{"loc":{"start":{"line":82,"column":4},"end":{"line":87,"column":null}},"type":"if","locations":[{"start":{"line":82,"column":4},"end":{"line":87,"column":null}},{"start":{"line":85,"column":9},"end":{"line":87,"column":null}}]},"27":{"loc":{"start":{"line":91,"column":7},"end":{"line":94,"column":null}},"type":"if","locations":[{"start":{"line":91,"column":7},"end":{"line":94,"column":null}}]},"28":{"loc":{"start":{"line":91,"column":11},"end":{"line":91,"column":68}},"type":"binary-expr","locations":[{"start":{"line":91,"column":11},"end":{"line":91,"column":37}},{"start":{"line":91,"column":41},"end":{"line":91,"column":68}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":47,"5":4,"6":4,"7":43,"8":1,"9":42,"10":42,"11":42,"12":42,"13":42,"14":42,"15":42,"16":42,"17":42,"18":1,"19":41,"20":2,"21":39,"22":8,"23":8,"24":8,"25":5,"26":31,"27":3,"28":28,"29":6,"30":25,"31":4,"32":1,"33":3,"34":1,"35":2,"36":2,"37":4,"38":21,"39":6,"40":3,"41":3,"42":6,"43":15,"44":3,"45":12,"46":1},"f":{"0":47},"b":{"0":[4],"1":[4,0],"2":[1],"3":[43,37],"4":[42,6],"5":[1,5],"6":[11,31],"7":[11,31],"8":[12,30],"9":[1,29],"10":[1],"11":[42,5],"12":[2,39],"13":[41,10],"14":[8,31],"15":[39,27],"16":[5],"17":[3,28],"18":[31,10],"19":[6],"20":[28,21],"21":[4,21],"22":[1,3],"23":[1,2],"24":[2],"25":[6,15],"26":[3,3],"27":[3],"28":[15,7]}} +,"/Users/zane/playground/liquid-labs/semver-plus/src/semver-comparison-ops.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/semver-comparison-ops.mjs","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":13,"column":15},"end":{"line":13,"column":27}},"2":{"start":{"line":25,"column":16},"end":{"line":25,"column":29}},"3":{"start":{"line":37,"column":15},"end":{"line":37,"column":27}},"4":{"start":{"line":49,"column":16},"end":{"line":49,"column":29}},"5":{"start":{"line":61,"column":15},"end":{"line":61,"column":27}},"6":{"start":{"line":73,"column":16},"end":{"line":73,"column":29}},"7":{"start":{"line":87,"column":16},"end":{"line":87,"column":29}},"8":{"start":{"line":100,"column":20},"end":{"line":100,"column":37}},"9":{"start":{"line":112,"column":25},"end":{"line":112,"column":47}},"10":{"start":{"line":124,"column":21},"end":{"line":124,"column":39}},"11":{"start":{"line":134,"column":25},"end":{"line":134,"column":47}},"12":{"start":{"line":148,"column":17},"end":{"line":148,"column":31}},"13":{"start":{"line":159,"column":17},"end":{"line":159,"column":31}},"14":{"start":{"line":170,"column":18},"end":{"line":170,"column":33}}},"fnMap":{},"branchMap":{},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1},"f":{},"b":{}} +,"/Users/zane/playground/liquid-labs/semver-plus/src/semver-range-ops.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/semver-range-ops.mjs","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":16,"column":23},"end":{"line":16,"column":43}},"2":{"start":{"line":28,"column":22},"end":{"line":28,"column":41}},"3":{"start":{"line":40,"column":26},"end":{"line":40,"column":49}},"4":{"start":{"line":52,"column":16},"end":{"line":52,"column":29}},"5":{"start":{"line":64,"column":16},"end":{"line":64,"column":29}},"6":{"start":{"line":78,"column":20},"end":{"line":78,"column":37}},"7":{"start":{"line":89,"column":23},"end":{"line":89,"column":43}},"8":{"start":{"line":105,"column":26},"end":{"line":105,"column":49}},"9":{"start":{"line":117,"column":19},"end":{"line":117,"column":35}}},"fnMap":{},"branchMap":{},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1},"f":{},"b":{}} +,"/Users/zane/playground/liquid-labs/semver-plus/src/semver-version-ops.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/semver-version-ops.mjs","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":13,"column":18},"end":{"line":13,"column":33}},"2":{"start":{"line":29,"column":16},"end":{"line":29,"column":29}},"3":{"start":{"line":41,"column":23},"end":{"line":41,"column":43}},"4":{"start":{"line":52,"column":18},"end":{"line":52,"column":33}},"5":{"start":{"line":63,"column":18},"end":{"line":63,"column":33}},"6":{"start":{"line":74,"column":18},"end":{"line":74,"column":33}},"7":{"start":{"line":81,"column":18},"end":{"line":81,"column":33}},"8":{"start":{"line":97,"column":19},"end":{"line":97,"column":35}},"9":{"start":{"line":109,"column":18},"end":{"line":109,"column":33}}},"fnMap":{},"branchMap":{},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1},"f":{},"b":{}} +,"/Users/zane/playground/liquid-labs/semver-plus/src/upper-bound.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/upper-bound.mjs","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":11,"column":19},"end":{"line":21,"column":1}},"2":{"start":{"line":12,"column":26},"end":{"line":12,"column":50}},"3":{"start":{"line":13,"column":2},"end":{"line":15,"column":null}},"4":{"start":{"line":14,"column":4},"end":{"line":14,"column":null}},"5":{"start":{"line":17,"column":17},"end":{"line":17,"column":43}},"6":{"start":{"line":18,"column":21},"end":{"line":18,"column":46}},"7":{"start":{"line":20,"column":2},"end":{"line":20,"column":null}},"8":{"start":{"line":21,"column":1},"end":{"line":21,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":11,"column":19},"end":{"line":11,"column":20}},"loc":{"start":{"line":11,"column":63},"end":{"line":21,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":11,"column":27},"end":{"line":11,"column":58}},"type":"default-arg","locations":[{"start":{"line":11,"column":56},"end":{"line":11,"column":58}}]},"1":{"loc":{"start":{"line":11,"column":29},"end":{"line":11,"column":52}},"type":"default-arg","locations":[{"start":{"line":11,"column":46},"end":{"line":11,"column":52}}]},"2":{"loc":{"start":{"line":13,"column":2},"end":{"line":15,"column":null}},"type":"if","locations":[{"start":{"line":13,"column":2},"end":{"line":15,"column":null}}]},"3":{"loc":{"start":{"line":20,"column":9},"end":{"line":20,"column":100}},"type":"cond-expr","locations":[{"start":{"line":20,"column":35},"end":{"line":20,"column":68}},{"start":{"line":20,"column":71},"end":{"line":20,"column":100}}]}},"s":{"0":2,"1":2,"2":47,"3":47,"4":0,"5":47,"6":47,"7":47,"8":2},"f":{"0":47},"b":{"0":[7],"1":[7],"2":[0],"3":[40,7]}} +,"/Users/zane/playground/liquid-labs/semver-plus/src/valid-version-or-range.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/valid-version-or-range.mjs","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":null}},"2":{"start":{"line":20,"column":28},"end":{"line":59,"column":1}},"3":{"start":{"line":20,"column":34},"end":{"line":20,"column":43}},"4":{"start":{"line":27,"column":2},"end":{"line":29,"column":null}},"5":{"start":{"line":28,"column":4},"end":{"line":28,"column":null}},"6":{"start":{"line":30,"column":2},"end":{"line":32,"column":null}},"7":{"start":{"line":31,"column":4},"end":{"line":31,"column":null}},"8":{"start":{"line":34,"column":19},"end":{"line":34,"column":109}},"9":{"start":{"line":36,"column":2},"end":{"line":41,"column":null}},"10":{"start":{"line":37,"column":4},"end":{"line":39,"column":null}},"11":{"start":{"line":38,"column":6},"end":{"line":38,"column":null}},"12":{"start":{"line":40,"column":4},"end":{"line":40,"column":null}},"13":{"start":{"line":43,"column":2},"end":{"line":48,"column":null}},"14":{"start":{"line":44,"column":4},"end":{"line":46,"column":null}},"15":{"start":{"line":45,"column":6},"end":{"line":45,"column":null}},"16":{"start":{"line":47,"column":4},"end":{"line":47,"column":null}},"17":{"start":{"line":50,"column":2},"end":{"line":56,"column":null}},"18":{"start":{"line":51,"column":17},"end":{"line":54,"column":71}},"19":{"start":{"line":55,"column":4},"end":{"line":55,"column":null}},"20":{"start":{"line":58,"column":2},"end":{"line":58,"column":null}},"21":{"start":{"line":59,"column":1},"end":{"line":59,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":20,"column":28},"end":{"line":20,"column":29}},"loc":{"start":{"line":26,"column":11},"end":{"line":59,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":20,"column":34},"end":{"line":20,"column":43}},"loc":{"start":{"line":20,"column":34},"end":{"line":20,"column":43}}}},"branchMap":{"0":{"loc":{"start":{"line":20,"column":29},"end":{"line":20,"column":78}},"type":"default-arg","locations":[{"start":{"line":20,"column":34},"end":{"line":20,"column":78}}]},"1":{"loc":{"start":{"line":20,"column":78},"end":{"line":26,"column":6}},"type":"default-arg","locations":[{"start":{"line":26,"column":4},"end":{"line":26,"column":6}}]},"2":{"loc":{"start":{"line":21,"column":2},"end":{"line":21,"column":24}},"type":"default-arg","locations":[{"start":{"line":21,"column":19},"end":{"line":21,"column":24}}]},"3":{"loc":{"start":{"line":22,"column":2},"end":{"line":22,"column":26}},"type":"default-arg","locations":[{"start":{"line":22,"column":21},"end":{"line":22,"column":26}}]},"4":{"loc":{"start":{"line":23,"column":2},"end":{"line":23,"column":20}},"type":"default-arg","locations":[{"start":{"line":23,"column":15},"end":{"line":23,"column":20}}]},"5":{"loc":{"start":{"line":24,"column":2},"end":{"line":24,"column":24}},"type":"default-arg","locations":[{"start":{"line":24,"column":19},"end":{"line":24,"column":24}}]},"6":{"loc":{"start":{"line":27,"column":2},"end":{"line":29,"column":null}},"type":"if","locations":[{"start":{"line":27,"column":2},"end":{"line":29,"column":null}}]},"7":{"loc":{"start":{"line":27,"column":6},"end":{"line":27,"column":58}},"type":"binary-expr","locations":[{"start":{"line":27,"column":6},"end":{"line":27,"column":31}},{"start":{"line":27,"column":35},"end":{"line":27,"column":58}}]},"8":{"loc":{"start":{"line":30,"column":2},"end":{"line":32,"column":null}},"type":"if","locations":[{"start":{"line":30,"column":2},"end":{"line":32,"column":null}}]},"9":{"loc":{"start":{"line":30,"column":6},"end":{"line":30,"column":52}},"type":"binary-expr","locations":[{"start":{"line":30,"column":6},"end":{"line":30,"column":29}},{"start":{"line":30,"column":33},"end":{"line":30,"column":52}}]},"10":{"loc":{"start":{"line":34,"column":19},"end":{"line":34,"column":109}},"type":"cond-expr","locations":[{"start":{"line":34,"column":45},"end":{"line":34,"column":73}},{"start":{"line":34,"column":76},"end":{"line":34,"column":109}}]},"11":{"loc":{"start":{"line":36,"column":2},"end":{"line":41,"column":null}},"type":"if","locations":[{"start":{"line":36,"column":2},"end":{"line":41,"column":null}}]},"12":{"loc":{"start":{"line":36,"column":6},"end":{"line":36,"column":82}},"type":"binary-expr","locations":[{"start":{"line":36,"column":6},"end":{"line":36,"column":25}},{"start":{"line":36,"column":29},"end":{"line":36,"column":48}},{"start":{"line":36,"column":52},"end":{"line":36,"column":82}}]},"13":{"loc":{"start":{"line":37,"column":4},"end":{"line":39,"column":null}},"type":"if","locations":[{"start":{"line":37,"column":4},"end":{"line":39,"column":null}}]},"14":{"loc":{"start":{"line":43,"column":2},"end":{"line":48,"column":null}},"type":"if","locations":[{"start":{"line":43,"column":2},"end":{"line":48,"column":null}}]},"15":{"loc":{"start":{"line":43,"column":6},"end":{"line":43,"column":72}},"type":"binary-expr","locations":[{"start":{"line":43,"column":6},"end":{"line":43,"column":31}},{"start":{"line":43,"column":35},"end":{"line":43,"column":72}}]},"16":{"loc":{"start":{"line":44,"column":4},"end":{"line":46,"column":null}},"type":"if","locations":[{"start":{"line":44,"column":4},"end":{"line":46,"column":null}}]},"17":{"loc":{"start":{"line":50,"column":2},"end":{"line":56,"column":null}},"type":"if","locations":[{"start":{"line":50,"column":2},"end":{"line":56,"column":null}}]},"18":{"loc":{"start":{"line":50,"column":6},"end":{"line":50,"column":52}},"type":"binary-expr","locations":[{"start":{"line":50,"column":6},"end":{"line":50,"column":25}},{"start":{"line":50,"column":29},"end":{"line":50,"column":52}}]},"19":{"loc":{"start":{"line":52,"column":11},"end":{"line":54,"column":69}},"type":"cond-expr","locations":[{"start":{"line":53,"column":10},"end":{"line":53,"column":39}},{"start":{"line":54,"column":11},"end":{"line":54,"column":69}}]},"20":{"loc":{"start":{"line":54,"column":11},"end":{"line":54,"column":69}},"type":"cond-expr","locations":[{"start":{"line":54,"column":37},"end":{"line":54,"column":46}},{"start":{"line":54,"column":49},"end":{"line":54,"column":69}}]}},"s":{"0":2,"1":2,"2":2,"3":0,"4":15,"5":1,"6":14,"7":0,"8":14,"9":14,"10":0,"11":0,"12":0,"13":14,"14":2,"15":1,"16":1,"17":13,"18":4,"19":4,"20":9,"21":2},"f":{"0":15,"1":0},"b":{"0":[0],"1":[6],"2":[11],"3":[12],"4":[14],"5":[10],"6":[1],"7":[15,3],"8":[0],"9":[14,3],"10":[3,11],"11":[0],"12":[14,7,1],"13":[0],"14":[2],"15":[14,2],"16":[1],"17":[4],"18":[13,8],"19":[0,4],"20":[2,2]}} +,"/Users/zane/playground/liquid-labs/semver-plus/src/x-sort.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/x-sort.mjs","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":null}},"2":{"start":{"line":4,"column":0},"end":{"line":4,"column":null}},"3":{"start":{"line":12,"column":15},"end":{"line":109,"column":1}},"4":{"start":{"line":14,"column":19},"end":{"line":14,"column":21}},"5":{"start":{"line":15,"column":17},"end":{"line":15,"column":19}},"6":{"start":{"line":18,"column":2},"end":{"line":18,"column":null}},"7":{"start":{"line":18,"column":60},"end":{"line":18,"column":78}},"8":{"start":{"line":20,"column":2},"end":{"line":39,"column":null}},"9":{"start":{"line":21,"column":4},"end":{"line":38,"column":null}},"10":{"start":{"line":22,"column":6},"end":{"line":22,"column":null}},"11":{"start":{"line":25,"column":22},"end":{"line":25,"column":50}},"12":{"start":{"line":26,"column":6},"end":{"line":37,"column":null}},"13":{"start":{"line":27,"column":8},"end":{"line":27,"column":null}},"14":{"start":{"line":30,"column":22},"end":{"line":30,"column":55}},"15":{"start":{"line":31,"column":8},"end":{"line":36,"column":null}},"16":{"start":{"line":32,"column":10},"end":{"line":32,"column":null}},"17":{"start":{"line":35,"column":10},"end":{"line":35,"column":null}},"18":{"start":{"line":41,"column":25},"end":{"line":41,"column":54}},"19":{"start":{"line":43,"column":23},"end":{"line":65,"column":4}},"20":{"start":{"line":44,"column":23},"end":{"line":44,"column":63}},"21":{"start":{"line":45,"column":23},"end":{"line":45,"column":63}},"22":{"start":{"line":47,"column":4},"end":{"line":64,"column":null}},"23":{"start":{"line":48,"column":6},"end":{"line":48,"column":null}},"24":{"start":{"line":50,"column":9},"end":{"line":64,"column":null}},"25":{"start":{"line":51,"column":6},"end":{"line":51,"column":null}},"26":{"start":{"line":53,"column":9},"end":{"line":64,"column":null}},"27":{"start":{"line":54,"column":6},"end":{"line":54,"column":null}},"28":{"start":{"line":56,"column":9},"end":{"line":64,"column":null}},"29":{"start":{"line":57,"column":6},"end":{"line":57,"column":null}},"30":{"start":{"line":59,"column":9},"end":{"line":64,"column":null}},"31":{"start":{"line":60,"column":6},"end":{"line":60,"column":null}},"32":{"start":{"line":63,"column":6},"end":{"line":63,"column":null}},"33":{"start":{"line":67,"column":2},"end":{"line":72,"column":null}},"34":{"start":{"line":68,"column":4},"end":{"line":68,"column":null}},"35":{"start":{"line":70,"column":7},"end":{"line":72,"column":null}},"36":{"start":{"line":71,"column":4},"end":{"line":71,"column":null}},"37":{"start":{"line":74,"column":20},"end":{"line":74,"column":33}},"38":{"start":{"line":76,"column":25},"end":{"line":76,"column":30}},"39":{"start":{"line":77,"column":2},"end":{"line":106,"column":null}},"40":{"start":{"line":78,"column":4},"end":{"line":81,"column":null}},"41":{"start":{"line":79,"column":6},"end":{"line":79,"column":null}},"42":{"start":{"line":80,"column":6},"end":{"line":80,"column":null}},"43":{"start":{"line":83,"column":24},"end":{"line":83,"column":67}},"44":{"start":{"line":84,"column":4},"end":{"line":105,"column":null}},"45":{"start":{"line":85,"column":33},"end":{"line":85,"column":63}},"46":{"start":{"line":89,"column":32},"end":{"line":89,"column":111}},"47":{"start":{"line":89,"column":92},"end":{"line":89,"column":110}},"48":{"start":{"line":90,"column":6},"end":{"line":96,"column":null}},"49":{"start":{"line":91,"column":8},"end":{"line":91,"column":null}},"50":{"start":{"line":92,"column":8},"end":{"line":92,"column":null}},"51":{"start":{"line":95,"column":8},"end":{"line":95,"column":null}},"52":{"start":{"line":98,"column":9},"end":{"line":105,"column":null}},"53":{"start":{"line":99,"column":33},"end":{"line":99,"column":69}},"54":{"start":{"line":100,"column":6},"end":{"line":100,"column":null}},"55":{"start":{"line":102,"column":9},"end":{"line":105,"column":null}},"56":{"start":{"line":103,"column":6},"end":{"line":103,"column":null}},"57":{"start":{"line":104,"column":6},"end":{"line":104,"column":null}},"58":{"start":{"line":108,"column":2},"end":{"line":108,"column":null}},"59":{"start":{"line":109,"column":1},"end":{"line":109,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":12,"column":15},"end":{"line":12,"column":32}},"loc":{"start":{"line":12,"column":37},"end":{"line":109,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":18,"column":47},"end":{"line":18,"column":48}},"loc":{"start":{"line":18,"column":60},"end":{"line":18,"column":78}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":43,"column":35},"end":{"line":43,"column":36}},"loc":{"start":{"line":43,"column":45},"end":{"line":65,"column":3}}},"3":{"name":"(anonymous_3)","decl":{"start":{"line":89,"column":83},"end":{"line":89,"column":87}},"loc":{"start":{"line":89,"column":92},"end":{"line":89,"column":110}}}},"branchMap":{"0":{"loc":{"start":{"line":21,"column":4},"end":{"line":38,"column":null}},"type":"if","locations":[{"start":{"line":21,"column":4},"end":{"line":38,"column":null}},{"start":{"line":24,"column":9},"end":{"line":38,"column":null}}]},"1":{"loc":{"start":{"line":26,"column":6},"end":{"line":37,"column":null}},"type":"if","locations":[{"start":{"line":26,"column":6},"end":{"line":37,"column":null}},{"start":{"line":29,"column":11},"end":{"line":37,"column":null}}]},"2":{"loc":{"start":{"line":31,"column":8},"end":{"line":36,"column":null}},"type":"if","locations":[{"start":{"line":31,"column":8},"end":{"line":36,"column":null}},{"start":{"line":34,"column":13},"end":{"line":36,"column":null}}]},"3":{"loc":{"start":{"line":47,"column":4},"end":{"line":64,"column":null}},"type":"if","locations":[{"start":{"line":47,"column":4},"end":{"line":64,"column":null}},{"start":{"line":50,"column":9},"end":{"line":64,"column":null}}]},"4":{"loc":{"start":{"line":50,"column":9},"end":{"line":64,"column":null}},"type":"if","locations":[{"start":{"line":50,"column":9},"end":{"line":64,"column":null}},{"start":{"line":53,"column":9},"end":{"line":64,"column":null}}]},"5":{"loc":{"start":{"line":53,"column":9},"end":{"line":64,"column":null}},"type":"if","locations":[{"start":{"line":53,"column":9},"end":{"line":64,"column":null}},{"start":{"line":56,"column":9},"end":{"line":64,"column":null}}]},"6":{"loc":{"start":{"line":53,"column":13},"end":{"line":53,"column":55}},"type":"binary-expr","locations":[{"start":{"line":53,"column":13},"end":{"line":53,"column":32}},{"start":{"line":53,"column":36},"end":{"line":53,"column":55}}]},"7":{"loc":{"start":{"line":56,"column":9},"end":{"line":64,"column":null}},"type":"if","locations":[{"start":{"line":56,"column":9},"end":{"line":64,"column":null}},{"start":{"line":59,"column":9},"end":{"line":64,"column":null}}]},"8":{"loc":{"start":{"line":59,"column":9},"end":{"line":64,"column":null}},"type":"if","locations":[{"start":{"line":59,"column":9},"end":{"line":64,"column":null}},{"start":{"line":62,"column":9},"end":{"line":64,"column":null}}]},"9":{"loc":{"start":{"line":67,"column":2},"end":{"line":72,"column":null}},"type":"if","locations":[{"start":{"line":67,"column":2},"end":{"line":72,"column":null}},{"start":{"line":70,"column":7},"end":{"line":72,"column":null}}]},"10":{"loc":{"start":{"line":70,"column":7},"end":{"line":72,"column":null}},"type":"if","locations":[{"start":{"line":70,"column":7},"end":{"line":72,"column":null}}]},"11":{"loc":{"start":{"line":78,"column":4},"end":{"line":81,"column":null}},"type":"if","locations":[{"start":{"line":78,"column":4},"end":{"line":81,"column":null}}]},"12":{"loc":{"start":{"line":84,"column":4},"end":{"line":105,"column":null}},"type":"if","locations":[{"start":{"line":84,"column":4},"end":{"line":105,"column":null}},{"start":{"line":98,"column":9},"end":{"line":105,"column":null}}]},"13":{"loc":{"start":{"line":90,"column":6},"end":{"line":96,"column":null}},"type":"if","locations":[{"start":{"line":90,"column":6},"end":{"line":96,"column":null}},{"start":{"line":94,"column":11},"end":{"line":96,"column":null}}]},"14":{"loc":{"start":{"line":98,"column":9},"end":{"line":105,"column":null}},"type":"if","locations":[{"start":{"line":98,"column":9},"end":{"line":105,"column":null}},{"start":{"line":102,"column":9},"end":{"line":105,"column":null}}]},"15":{"loc":{"start":{"line":102,"column":9},"end":{"line":105,"column":null}},"type":"if","locations":[{"start":{"line":102,"column":9},"end":{"line":105,"column":null}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":16,"5":16,"6":16,"7":47,"8":16,"9":47,"10":26,"11":21,"12":21,"13":21,"14":0,"15":0,"16":0,"17":0,"18":16,"19":16,"20":20,"21":20,"22":20,"23":0,"24":20,"25":7,"26":13,"27":0,"28":13,"29":0,"30":13,"31":0,"32":13,"33":16,"34":3,"35":13,"36":4,"37":9,"38":9,"39":9,"40":19,"41":9,"42":9,"43":10,"44":10,"45":8,"46":8,"47":1,"48":8,"49":7,"50":7,"51":1,"52":2,"53":1,"54":1,"55":1,"56":1,"57":1,"58":9,"59":1},"f":{"0":16,"1":47,"2":20,"3":1},"b":{"0":[26,21],"1":[21,0],"2":[0,0],"3":[0,20],"4":[7,13],"5":[0,13],"6":[13,0],"7":[0,13],"8":[0,13],"9":[3,13],"10":[4],"11":[9],"12":[8,2],"13":[7,1],"14":[1,1],"15":[1]}} +,"/Users/zane/playground/liquid-labs/semver-plus/src/lib/compare-helper.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/lib/compare-helper.mjs","statementMap":{"0":{"start":{"line":1,"column":22},"end":{"line":14,"column":1}},"1":{"start":{"line":3,"column":2},"end":{"line":11,"column":null}},"2":{"start":{"line":3,"column":15},"end":{"line":3,"column":16}},"3":{"start":{"line":4,"column":20},"end":{"line":4,"column":31}},"4":{"start":{"line":5,"column":4},"end":{"line":10,"column":null}},"5":{"start":{"line":6,"column":6},"end":{"line":6,"column":null}},"6":{"start":{"line":8,"column":9},"end":{"line":10,"column":null}},"7":{"start":{"line":9,"column":6},"end":{"line":9,"column":null}},"8":{"start":{"line":13,"column":2},"end":{"line":13,"column":null}},"9":{"start":{"line":14,"column":1},"end":{"line":14,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":1,"column":22},"end":{"line":1,"column":23}},"loc":{"start":{"line":1,"column":48},"end":{"line":14,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":5,"column":4},"end":{"line":10,"column":null}},"type":"if","locations":[{"start":{"line":5,"column":4},"end":{"line":10,"column":null}},{"start":{"line":8,"column":9},"end":{"line":10,"column":null}}]},"1":{"loc":{"start":{"line":8,"column":9},"end":{"line":10,"column":null}},"type":"if","locations":[{"start":{"line":8,"column":9},"end":{"line":10,"column":null}}]}},"s":{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0},"f":{"0":0},"b":{"0":[0,0],"1":[0]}} +,"/Users/zane/playground/liquid-labs/semver-plus/src/lib/set-default-options.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/lib/set-default-options.mjs","statementMap":{"0":{"start":{"line":1,"column":26},"end":{"line":10,"column":1}},"1":{"start":{"line":2,"column":2},"end":{"line":7,"column":null}},"2":{"start":{"line":6,"column":4},"end":{"line":6,"column":null}},"3":{"start":{"line":9,"column":2},"end":{"line":9,"column":null}},"4":{"start":{"line":10,"column":1},"end":{"line":10,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":1,"column":26},"end":{"line":1,"column":27}},"loc":{"start":{"line":1,"column":44},"end":{"line":10,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":39}},"type":"default-arg","locations":[{"start":{"line":1,"column":37},"end":{"line":1,"column":39}}]},"1":{"loc":{"start":{"line":2,"column":2},"end":{"line":7,"column":null}},"type":"if","locations":[{"start":{"line":2,"column":2},"end":{"line":7,"column":null}}]},"2":{"loc":{"start":{"line":2,"column":6},"end":{"line":5,"column":54}},"type":"binary-expr","locations":[{"start":{"line":2,"column":6},"end":{"line":2,"column":39}},{"start":{"line":3,"column":12},"end":{"line":3,"column":56}},{"start":{"line":4,"column":15},"end":{"line":4,"column":77}},{"start":{"line":5,"column":15},"end":{"line":5,"column":53}}]}},"s":{"0":0,"1":0,"2":0,"3":0,"4":0},"f":{"0":0},"b":{"0":[0],"1":[0],"2":[0,0,0,0]}} +} diff --git a/qa/coverage/favicon.png b/qa/coverage/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..c1525b811a167671e9de1fa78aab9f5c0b61cef7 GIT binary patch literal 445 zcmV;u0Yd(XP))rP{nL}Ln%S7`m{0DjX9TLF* zFCb$4Oi7vyLOydb!7n&^ItCzb-%BoB`=x@N2jll2Nj`kauio%aw_@fe&*}LqlFT43 z8doAAe))z_%=P%v^@JHp3Hjhj^6*Kr_h|g_Gr?ZAa&y>wxHE99Gk>A)2MplWz2xdG zy8VD2J|Uf#EAw*bo5O*PO_}X2Tob{%bUoO2G~T`@%S6qPyc}VkhV}UifBuRk>%5v( z)x7B{I~z*k<7dv#5tC+m{km(D087J4O%+<<;K|qwefb6@GSX45wCK}Sn*> + + + + Code coverage report for All files + + + + + + + + + +
+
+

All files

+
+ +
+ 86.42% + Statements + 191/221 +
+ + +
+ 82.39% + Branches + 117/142 +
+ + +
+ 75% + Functions + 9/12 +
+ + +
+ 86.97% + Lines + 187/215 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
src +
+
92.71%191/20687.96%117/13390%9/1093.03%187/201
src/lib +
+
0%0/150%0/90%0/20%0/14
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/qa/coverage/prettify.css b/qa/coverage/prettify.css new file mode 100644 index 0000000..b317a7c --- /dev/null +++ b/qa/coverage/prettify.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/qa/coverage/prettify.js b/qa/coverage/prettify.js new file mode 100644 index 0000000..b322523 --- /dev/null +++ b/qa/coverage/prettify.js @@ -0,0 +1,2 @@ +/* eslint-disable */ +window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/qa/coverage/sort-arrow-sprite.png b/qa/coverage/sort-arrow-sprite.png new file mode 100644 index 0000000000000000000000000000000000000000..6ed68316eb3f65dec9063332d2f69bf3093bbfab GIT binary patch literal 138 zcmeAS@N?(olHy`uVBq!ia0vp^>_9Bd!3HEZxJ@+%Qh}Z>jv*C{$p!i!8j}?a+@3A= zIAGwzjijN=FBi!|L1t?LM;Q;gkwn>2cAy-KV{dn nf0J1DIvEHQu*n~6U}x}qyky7vi4|9XhBJ7&`njxgN@xNA8m%nc literal 0 HcmV?d00001 diff --git a/qa/coverage/sorter.js b/qa/coverage/sorter.js new file mode 100644 index 0000000..2bb296a --- /dev/null +++ b/qa/coverage/sorter.js @@ -0,0 +1,196 @@ +/* eslint-disable */ +var addSorting = (function() { + 'use strict'; + var cols, + currentSort = { + index: 0, + desc: false + }; + + // returns the summary table element + function getTable() { + return document.querySelector('.coverage-summary'); + } + // returns the thead element of the summary table + function getTableHeader() { + return getTable().querySelector('thead tr'); + } + // returns the tbody element of the summary table + function getTableBody() { + return getTable().querySelector('tbody'); + } + // returns the th element for nth column + function getNthColumn(n) { + return getTableHeader().querySelectorAll('th')[n]; + } + + function onFilterInput() { + const searchValue = document.getElementById('fileSearch').value; + const rows = document.getElementsByTagName('tbody')[0].children; + for (let i = 0; i < rows.length; i++) { + const row = rows[i]; + if ( + row.textContent + .toLowerCase() + .includes(searchValue.toLowerCase()) + ) { + row.style.display = ''; + } else { + row.style.display = 'none'; + } + } + } + + // loads the search box + function addSearchBox() { + var template = document.getElementById('filterTemplate'); + var templateClone = template.content.cloneNode(true); + templateClone.getElementById('fileSearch').oninput = onFilterInput; + template.parentElement.appendChild(templateClone); + } + + // loads all columns + function loadColumns() { + var colNodes = getTableHeader().querySelectorAll('th'), + colNode, + cols = [], + col, + i; + + for (i = 0; i < colNodes.length; i += 1) { + colNode = colNodes[i]; + col = { + key: colNode.getAttribute('data-col'), + sortable: !colNode.getAttribute('data-nosort'), + type: colNode.getAttribute('data-type') || 'string' + }; + cols.push(col); + if (col.sortable) { + col.defaultDescSort = col.type === 'number'; + colNode.innerHTML = + colNode.innerHTML + ''; + } + } + return cols; + } + // attaches a data attribute to every tr element with an object + // of data values keyed by column name + function loadRowData(tableRow) { + var tableCols = tableRow.querySelectorAll('td'), + colNode, + col, + data = {}, + i, + val; + for (i = 0; i < tableCols.length; i += 1) { + colNode = tableCols[i]; + col = cols[i]; + val = colNode.getAttribute('data-value'); + if (col.type === 'number') { + val = Number(val); + } + data[col.key] = val; + } + return data; + } + // loads all row data + function loadData() { + var rows = getTableBody().querySelectorAll('tr'), + i; + + for (i = 0; i < rows.length; i += 1) { + rows[i].data = loadRowData(rows[i]); + } + } + // sorts the table using the data for the ith column + function sortByIndex(index, desc) { + var key = cols[index].key, + sorter = function(a, b) { + a = a.data[key]; + b = b.data[key]; + return a < b ? -1 : a > b ? 1 : 0; + }, + finalSorter = sorter, + tableBody = document.querySelector('.coverage-summary tbody'), + rowNodes = tableBody.querySelectorAll('tr'), + rows = [], + i; + + if (desc) { + finalSorter = function(a, b) { + return -1 * sorter(a, b); + }; + } + + for (i = 0; i < rowNodes.length; i += 1) { + rows.push(rowNodes[i]); + tableBody.removeChild(rowNodes[i]); + } + + rows.sort(finalSorter); + + for (i = 0; i < rows.length; i += 1) { + tableBody.appendChild(rows[i]); + } + } + // removes sort indicators for current column being sorted + function removeSortIndicators() { + var col = getNthColumn(currentSort.index), + cls = col.className; + + cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); + col.className = cls; + } + // adds sort indicators for current column being sorted + function addSortIndicators() { + getNthColumn(currentSort.index).className += currentSort.desc + ? ' sorted-desc' + : ' sorted'; + } + // adds event listeners for all sorter widgets + function enableUI() { + var i, + el, + ithSorter = function ithSorter(i) { + var col = cols[i]; + + return function() { + var desc = col.defaultDescSort; + + if (currentSort.index === i) { + desc = !currentSort.desc; + } + sortByIndex(i, desc); + removeSortIndicators(); + currentSort.index = i; + currentSort.desc = desc; + addSortIndicators(); + }; + }; + for (i = 0; i < cols.length; i += 1) { + if (cols[i].sortable) { + // add the click event handler on the th so users + // dont have to click on those tiny arrows + el = getNthColumn(i).querySelector('.sorter').parentElement; + if (el.addEventListener) { + el.addEventListener('click', ithSorter(i)); + } else { + el.attachEvent('onclick', ithSorter(i)); + } + } + } + } + // adds sorting functionality to the UI + return function() { + if (!getTable()) { + return; + } + cols = loadColumns(); + loadData(); + addSearchBox(); + addSortIndicators(); + enableUI(); + }; +})(); + +window.addEventListener('load', addSorting); diff --git a/qa/coverage/src/constants.mjs.html b/qa/coverage/src/constants.mjs.html new file mode 100644 index 0000000..3edf2ee --- /dev/null +++ b/qa/coverage/src/constants.mjs.html @@ -0,0 +1,100 @@ + + + + + + Code coverage report for src/constants.mjs + + + + + + + + + +
+
+

All files / src constants.mjs

+
+ +
+ 100% + Statements + 2/2 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 0/0 +
+ + +
+ 100% + Lines + 2/2 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +64x +  +  +  +4x + 
export const xRangeRE =
+  //  v single tuple  v doublpe tuple             v triple tuple            v quad/pre-release tuple
+  //          v if there's more than a single digit, it can't lead with a zero
+  /^(?:[Xx*]|[1-9]?[0-9]+\.[Xx*]|(?:[1-9]?[0-9]+\.){2}[Xx*]|(?:[1-9]?[0-9]+\.){2}[1-9]?[0-9]+-(?:alpha|beta|rc)\.[Xx*])$/
+export const prereleaseXRangeRE = /^(?:[1-9]?[0-9]+\.){2}[1-9]?[0-9]+-(?:alpha|beta|rc)\.[Xx*]$/
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/qa/coverage/src/ext-constants.mjs.html b/qa/coverage/src/ext-constants.mjs.html new file mode 100644 index 0000000..b510b73 --- /dev/null +++ b/qa/coverage/src/ext-constants.mjs.html @@ -0,0 +1,154 @@ + + + + + + Code coverage report for src/ext-constants.mjs + + + + + + + + + +
+
+

All files / src ext-constants.mjs

+
+ +
+ 100% + Statements + 8/8 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 0/0 +
+ + +
+ 100% + Lines + 8/8 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +241x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +1x +1x +  +1x +1x +1x +1x + 
export const STANDARD_INCREMENTS = [
+  'major',
+  'minor',
+  'patch',
+  'premajor',
+  'preminor',
+  'prepatch',
+  'prerelease',
+  'pretype',
+  'alpha',
+  'beta',
+  'rc',
+  'gold'
+]
+ 
+export const STANDARD_PRERELEASE_INCREMENTS = ['prerelease', 'pretype', 'alpha', 'beta', 'rc', 'gold']
+export const STANDARD_PRERELEASE_NAMES = ['alpha', 'beta', 'rc']
+export const STANDARD_RELEASE_NAMES = [...STANDARD_PRERELEASE_NAMES, 'gold']
+ 
+Object.freeze(STANDARD_PRERELEASE_INCREMENTS)
+Object.freeze(STANDARD_PRERELEASE_NAMES)
+Object.freeze(STANDARD_RELEASE_NAMES)
+Object.freeze(STANDARD_INCREMENTS)
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/qa/coverage/src/index.html b/qa/coverage/src/index.html new file mode 100644 index 0000000..2a46264 --- /dev/null +++ b/qa/coverage/src/index.html @@ -0,0 +1,266 @@ + + + + + + Code coverage report for src + + + + + + + + + +
+
+

All files src

+
+ +
+ 92.71% + Statements + 191/206 +
+ + +
+ 87.96% + Branches + 117/133 +
+ + +
+ 90% + Functions + 9/10 +
+ + +
+ 93.03% + Lines + 187/201 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
constants.mjs +
+
100%2/2100%0/0100%0/0100%2/2
ext-constants.mjs +
+
100%8/8100%0/0100%0/0100%8/8
max-satisfying.mjs +
+
93.75%15/16100%11/11100%1/193.75%15/16
min-version.mjs +
+
100%7/785.71%6/7100%1/1100%7/7
next-version.mjs +
+
100%47/4798.03%50/51100%1/1100%45/45
semver-comparison-ops.mjs +
+
100%15/15100%0/0100%0/0100%15/15
semver-range-ops.mjs +
+
100%10/10100%0/0100%0/0100%10/10
semver-version-ops.mjs +
+
100%10/10100%0/0100%0/0100%10/10
upper-bound.mjs +
+
88.88%8/980%4/5100%1/188.88%8/9
valid-version-or-range.mjs +
+
77.27%17/2283.33%25/3050%1/280.95%17/21
x-sort.mjs +
+
86.66%52/6072.41%21/29100%4/486.2%50/58
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/qa/coverage/src/lib/compare-helper.mjs.html b/qa/coverage/src/lib/compare-helper.mjs.html new file mode 100644 index 0000000..5b95606 --- /dev/null +++ b/qa/coverage/src/lib/compare-helper.mjs.html @@ -0,0 +1,133 @@ + + + + + + Code coverage report for src/lib/compare-helper.mjs + + + + + + + + + +
+
+

All files / src/lib compare-helper.mjs

+
+ +
+ 0% + Statements + 0/10 +
+ + +
+ 0% + Branches + 0/3 +
+ + +
+ 0% + Functions + 0/1 +
+ + +
+ 0% + Lines + 0/9 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
const compareHelper = (versions, semverTest) => {
+  let currLead
+  for (let i = 0; i < versions.length; i += 1) {
+    const testVer = versions[i]
+    if (currLead === undefined) {
+      currLead = testVer
+    }
+    else Iif (semverTest(currLead, testVer)) {
+      currLead = testVer
+    }
+  }
+ 
+  return currLead
+}
+ 
+export { compareHelper }
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/qa/coverage/src/lib/index.html b/qa/coverage/src/lib/index.html new file mode 100644 index 0000000..9e83eb1 --- /dev/null +++ b/qa/coverage/src/lib/index.html @@ -0,0 +1,131 @@ + + + + + + Code coverage report for src/lib + + + + + + + + + +
+
+

All files src/lib

+
+ +
+ 0% + Statements + 0/15 +
+ + +
+ 0% + Branches + 0/9 +
+ + +
+ 0% + Functions + 0/2 +
+ + +
+ 0% + Lines + 0/14 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
compare-helper.mjs +
+
0%0/100%0/30%0/10%0/9
set-default-options.mjs +
+
0%0/50%0/60%0/10%0/5
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/qa/coverage/src/lib/set-default-options.mjs.html b/qa/coverage/src/lib/set-default-options.mjs.html new file mode 100644 index 0000000..cc62778 --- /dev/null +++ b/qa/coverage/src/lib/set-default-options.mjs.html @@ -0,0 +1,121 @@ + + + + + + Code coverage report for src/lib/set-default-options.mjs + + + + + + + + + +
+
+

All files / src/lib set-default-options.mjs

+
+ +
+ 0% + Statements + 0/5 +
+ + +
+ 0% + Branches + 0/6 +
+ + +
+ 0% + Functions + 0/1 +
+ + +
+ 0% + Lines + 0/5 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13  +  +  +  +  +  +  +  +  +  +  +  + 
const setDefaultOptions = (options = {}) => {
+  Iif (!('includePrerelease' in options)
+        && (process.env.SEMVER_PLUS_COMPAT === undefined
+            || process.env.SEMVER_PLUS_COMPAT.toLocaleLowerCase() === 'false'
+            || process.env.SEMVER_PLUS_COMPAT === '0')) {
+    options.includePrerelease = true
+  }
+ 
+  return options
+}
+ 
+export { setDefaultOptions }
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/qa/coverage/src/max-satisfying.mjs.html b/qa/coverage/src/max-satisfying.mjs.html new file mode 100644 index 0000000..7e05f7e --- /dev/null +++ b/qa/coverage/src/max-satisfying.mjs.html @@ -0,0 +1,217 @@ + + + + + + Code coverage report for src/max-satisfying.mjs + + + + + + + + + +
+
+

All files / src max-satisfying.mjs

+
+ +
+ 93.75% + Statements + 15/16 +
+ + +
+ 100% + Branches + 11/11 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 93.75% + Lines + 15/16 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +451x +  +1x +1x +1x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +16x +1x +  +  +  +15x +1x +  +  +14x +  +14x +18x +11x +  +  +3x +1x + 
import semver from 'semver'
+ 
+import { rsort } from './semver-comparison-ops'
+import { satisfies } from './semver-range-ops'
+import { validVersionOrRange } from './valid-version-or-range'
+ 
+/**
+ * Returns the highest version in `versions` that satisfies the range, or null if no version satisfies the range. This
+ * implementation differs from the base `semver.maxSatisfying` in that it correctly handles the following case:
+ * `maxSatisfying(['1.0.0-alpha.0', '1.0.0'], '<1.0.0')` -> '1.0.0-alpha.0'. The base `semver.maxSatisfying` function
+ * returns `null` in this case. Note, support for this syntax is not comprehensive and more complicated expressions are
+ * likely to yield incorrect results.
+ * @param {string[]} versions - The versions to check.
+ * @param {string} range - The range to check.
+ * @param {object} options - The options to pass to the semver.maxSatisfying function.
+ * @param {boolean} options.compat - If true, then uses the base `semver.maxSatisfying` function.
+ * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
+ * @param {boolean} options.includePrerelease - Include prerelease versions in the result. This is effectively implied
+ * if the range contains prerelease components.
+ * @param {boolean} options.throwIfInvalid - If true, throws an exception if any version or the range is invalid.
+ * @returns {string|null} - The highest version that satisfies the range, or null if no version satisfies the range.
+ * @category Range operations
+ * @function
+ */
+// export const maxSatisfying = semver.maxSatisfying
+export const maxSatisfying = (versions, range, options) => {
+  if (options?.throwIfInvalid === true) {
+    validVersionOrRange(versions, { ...options, disallowRanges : true })
+    validVersionOrRange([range], { ...options, disallowVersions : true })
+  }
+ 
+  if (options?.compat === true) {
+    return semver.maxSatisfying(versions, range, options)
+  }
+ 
+  versions = rsort(versions, options)
+ 
+  for (const version of versions) {
+    if (satisfies(version, range, options)) {
+      return version
+    }
+  }
+  return null
+}
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/qa/coverage/src/min-version.mjs.html b/qa/coverage/src/min-version.mjs.html new file mode 100644 index 0000000..4a7124c --- /dev/null +++ b/qa/coverage/src/min-version.mjs.html @@ -0,0 +1,169 @@ + + + + + + Code coverage report for src/min-version.mjs + + + + + + + + + +
+
+

All files / src min-version.mjs

+
+ +
+ 100% + Statements + 7/7 +
+ + +
+ 85.71% + Branches + 6/7 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 100% + Lines + 7/7 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +291x +  +1x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +21x +5x +  +16x +1x +  +  + 
import semver from 'semver'
+ 
+import { prereleaseXRangeRE } from './constants'
+ 
+/**
+ * Returns the lowest version that satisfies the range, or null if no version satisfies the range. This implementation
+ * differs from the base `semver.minVersion` in that it correctly handles simple prerelease x-ranges. E.g.,
+ * '1.0.0-alpha.x' -> '1.0.0-alpha.0'. To suppress this behavior, pass `options.compat = true`. Note, support for this
+ * syntax is not comprehensive and more complicated expressions are likely to yield incorrect results.
+ * @param {string} range - The range to check.
+ * @param {object} options - The options to pass to the semver.minVersion function.
+ * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
+ * @param {boolean} options.includePrerelease - Whether to include prerelease versions.
+ * @param {boolean} options.compat - If true, prerelease ranges are treated the same as in the base semver package;
+ * e.g. `minVersion('1.0.0-alpha.x', { compat: true })` -> '1.0.0-alpha.x'.
+ * @returns {string|null} - The lowest version that satisfies the range, or null if no version satisfies the range.
+ * @category Range operations
+ */
+const minVersion = (range, options) => {
+  // we have to do this first, because semver does not recognize prerelease X-ranges ending with '*' (even though it
+  // does recognize these as valid ranges)
+  if (options?.compat !== true && range.match(prereleaseXRangeRE)) {
+    return range.slice(0, -1) + '0'
+  }
+  return semver.minVersion(range, options)
+}
+ 
+export { minVersion }
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/qa/coverage/src/next-version.mjs.html b/qa/coverage/src/next-version.mjs.html new file mode 100644 index 0000000..ec9efe9 --- /dev/null +++ b/qa/coverage/src/next-version.mjs.html @@ -0,0 +1,403 @@ + + + + + + Code coverage report for src/next-version.mjs + + + + + + + + + +
+
+

All files / src next-version.mjs

+
+ +
+ 100% + Statements + 47/47 +
+ + +
+ 98.03% + Branches + 50/51 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 100% + Lines + 45/45 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +1071x +1x +  +1x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +47x +4x +4x +  +  +43x +1x +  +42x +42x +  +42x +  +  +  +  +42x +42x +  +  +42x +42x +  +  +42x +  +  +42x +1x +  +41x +2x +  +39x +8x +8x +8x +5x +  +  +31x +3x +  +28x +6x +  +  +  +25x +4x +3x +2x +2x +  +  +4x +  +21x +6x +3x +  +  +3x +  +  +6x +  +15x +  +3x +  +  +12x +  +  +  +  +  +  +  +1x +  +  + 
import createError from 'http-errors'
+import semver from 'semver'
+ 
+import {
+  STANDARD_INCREMENTS,
+  STANDARD_PRERELEASE_INCREMENTS,
+  STANDARD_PRERELEASE_NAMES,
+  STANDARD_RELEASE_NAMES
+} from './ext-constants'
+ 
+/**
+ * Given a current version generates the next version string accourding to `increment`. This method is similar to
+ * {@link inc} from the [base semver library](https://semver.org) with two differences.
+ * 1) It supports a specific pre-release sequence prototype -> 'alpha' -> 'beta' -> 'rc' -> released and the 'pretype'
+ *    increment will advance the prerelease ID through these stages.
+ * 2) The 'prerelease' increment can only be used to advance the prerelease version number and does not function as
+ *    'prepatch' on a non-prerelease version.
+ * @param {string} currVer - The current version to increment.
+ * @param {string} increment - The increment to use.
+ * @returns {string} - The next version string.
+ * @category Version operations
+ */
+const nextVersion = (currVer, increment) => {
+  if (!semver.valid(currVer)) {
+    const msg = `Invalid version '${currVer}'` + (semver.validRange(currVer) ? '; range not allowed.' : '.')
+    throw createError.BadRequest(msg)
+  }
+ 
+  if (increment !== undefined && !STANDARD_INCREMENTS.includes(increment)) {
+    throw createError.BadRequest(`Invalid increment '${increment}' specified.`)
+  }
+  const semverTupleREString = '(?:[0-9]|[1-9][0-9]+)'
+  const isProductionVersion = !!currVer.match(new RegExp(`^(?:${semverTupleREString}\\.){2}${semverTupleREString}$`))
+  // what are we incrementing? default is patch for production and prerelease for pre-release projects
+  increment = increment || (isProductionVersion ? 'patch' : 'prerelease')
+ 
+  let nextVer
+  // determine concrete value for increment
+  // `semver.prerelease(currVer)` extracts an array of components; we just want a string
+  const currPrereleaseComponents = semver.prerelease(currVer)
+  const currPrerelease = currPrereleaseComponents === null ? null : currPrereleaseComponents.join('.')
+  // const stdPrereleaseMatch = currVer.match(/^[\d.Z]+-(?!\d\.\d+$)([0-9A-Za-z-]+)\.\d+)$/)
+  // const
+  const stdPrereleaseMatch = currPrerelease === null ? null : currPrerelease.match(/^(?!\d+\.\d+$)(?:([0-9A-Za-z-]+)\.)?\d+$/)
+  const standardPrereleaseName = stdPrereleaseMatch === null
+    ? null
+    : (stdPrereleaseMatch[1] === undefined ? '' : stdPrereleaseMatch[1])
+  const isStandardCurrPrerelease = STANDARD_PRERELEASE_NAMES.includes(standardPrereleaseName)
+ 
+  // now verify the combination of inputs
+  if (increment === 'pretype' && !STANDARD_PRERELEASE_NAMES.includes(standardPrereleaseName)) {
+    throw createError.BadRequest(`Cannot increment type of unknown prerelease type '${currPrerelease}'. Can only increment '${STANDARD_PRERELEASE_NAMES.join(', -> ')}'.`)
+  }
+  if (increment === 'prerelease' && standardPrereleaseName === null) {
+    throw createError.BadRequest(`Cannot increment non-standard prerelease version '${currPrerelease}'. Use '<tag>.<number>' where tag is alphanumeric+dashes (but not all digits).`)
+  }
+  else if (isStandardCurrPrerelease === true && STANDARD_PRERELEASE_NAMES.includes(increment)) { // implies `standardPrereleaseName !== undefined`
+    const currIndex = STANDARD_PRERELEASE_NAMES.indexOf(standardPrereleaseName)
+    const incrementIndex = STANDARD_PRERELEASE_NAMES.indexOf(increment)
+    if (incrementIndex <= currIndex) {
+      throw createError.BadRequest(`Cannot move prerelease name from '${standardPrereleaseName}' to '${increment}'. Prerelease types must move forward.`)
+    }
+  }
+  else if (isProductionVersion && STANDARD_PRERELEASE_INCREMENTS.includes(increment)) {
+    throw createError.BadRequest(`Cannot use increment '${increment}' with production versions. Use 'premajor', 'preminor', or 'prepatch'.`)
+  }
+  else if (!isProductionVersion && !STANDARD_PRERELEASE_INCREMENTS.includes(increment)) {
+    throw createError.BadRequest(`Cannot use increment '${increment}' with pre-release versions. Use '${STANDARD_PRERELEASE_INCREMENTS.join(', ')}'.`)
+  }
+ 
+  // alpha -> beta -> rc; valid states verified above
+  if (increment === 'pretype') {
+    if (standardPrereleaseName === 'alpha') nextVer = currVer.replace(/([0-1.Z-]+)alpha(\.\d+)?/, '$1beta.0')
+    else if (standardPrereleaseName === 'beta') nextVer = currVer.replace(/([0-1.Z-]+)beta(\.\d+)?/, '$1rc.0')
+    else if (standardPrereleaseName === 'rc') {
+      nextVer = currVer.replace(/([0-9.Z]+)-rc(?:\.\d+)?/, '$1')
+    }
+ 
+    return nextVer // we're done
+  }
+  else if (STANDARD_RELEASE_NAMES.includes(increment)) {
+    if (increment === 'gold') {
+      nextVer = currVer.replace(/^([\d.]+)-(?:alpha|beta|rc)(?:\.\d+)?/, '$1')
+    }
+    else {
+      nextVer = currVer.replace(/^([\d.]+)-(?:alpha|beta|rc)(?:\.\d+)?/, `$1-${increment}.0`)
+    }
+ 
+    return nextVer
+  }
+  else if (increment !== 'prerelease' && increment.startsWith('pre')) {
+    // then it's 'premajor', 'preminor', 'prepatch'
+    return semver.inc(currVer, increment, 'alpha')
+  }
+  // else, it's a standard semver increment
+  return semver.inc(currVer, increment)
+  /*
+  // if we're going 'pre', but currVer is a pre-style, then we need to specify the first stage in the pre, aka, alpha
+  nextVer = increment.startsWith('pre') && currVer.match(/^[\d.Z-]+$/)
+    ? semver.inc(currVer, increment, 'alpha')
+    : semver.inc(currVer, increment)
+ 
+  return nextVer */
+}
+ 
+export { nextVersion }
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/qa/coverage/src/semver-comparison-ops.mjs.html b/qa/coverage/src/semver-comparison-ops.mjs.html new file mode 100644 index 0000000..129782c --- /dev/null +++ b/qa/coverage/src/semver-comparison-ops.mjs.html @@ -0,0 +1,595 @@ + + + + + + Code coverage report for src/semver-comparison-ops.mjs + + + + + + + + + +
+
+

All files / src semver-comparison-ops.mjs

+
+ +
+ 100% + Statements + 15/15 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 0/0 +
+ + +
+ 100% + Lines + 15/15 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +1711x +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +1x + 
import semver from 'semver'
+ 
+/**
+ * Returns `true` if `v1` is greater than `v2`, `false` otherwise.
+ * @param {string} v1 - The first version to compare.
+ * @param {string} v2 - The second version to compare.
+ * @param {object} options - The options to pass to the semver.gt function.
+ * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
+ * @returns {boolean} - `true` if `v1` is greater than `v2`, `false` otherwise.
+ * @category Comparison operations
+ * @function
+ */
+export const gt = semver.gt
+ 
+/**
+ * Returns `true` if `v1` is greater than or equal to `v2`, `false` otherwise.
+ * @param {string} v1 - The first version to compare.
+ * @param {string} v2 - The second version to compare.
+ * @param {object} options - The options to pass to the semver.gte function.
+ * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
+ * @returns {boolean} - `true` if `v1` is greater than or equal to `v2`, `false` otherwise.
+ * @category Comparison operations
+ * @function
+ */
+export const gte = semver.gte
+ 
+/**
+ * Returns `true` if `v1` is less than `v2`, `false` otherwise.
+ * @param {string} v1 - The first version to compare.
+ * @param {string} v2 - The second version to compare.
+ * @param {object} options - The options to pass to the semver.lt function.
+ * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
+ * @returns {boolean} - `true` if `v1` is less than `v2`, `false` otherwise.
+ * @category Comparison operations
+ * @function
+ */
+export const lt = semver.lt
+ 
+/**
+ * Returns `true` if `v1` is less than or equal to `v2`, `false` otherwise.
+ * @param {string} v1 - The first version to compare.
+ * @param {string} v2 - The second version to compare.
+ * @param {object} options - The options to pass to the semver.lte function.
+ * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
+ * @returns {boolean} - `true` if `v1` is less than or equal to `v2`, `false` otherwise.
+ * @category Comparison operations
+ * @function
+ */
+export const lte = semver.lte
+ 
+/**
+ * Returns `true` if `v1` is equal to `v2`, `false` otherwise.
+ * @param {string} v1 - The first version to compare.
+ * @param {string} v2 - The second version to compare.
+ * @param {object} options - The options to pass to the semver.eq function.
+ * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
+ * @returns {boolean} - `true` if `v1` is equal to `v2`, `false` otherwise.
+ * @category Comparison operations
+ * @function
+ */
+export const eq = semver.eq
+ 
+/**
+ * Returns `true` if `v1` is not equal to `v2`, `false` otherwise.
+ * @param {string} v1 - The first version to compare.
+ * @param {string} v2 - The second version to compare.
+ * @param {object} options - The options to pass to the semver.neq function.
+ * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
+ * @returns {boolean} - `true` if `v1` is not equal to `v2`, `false` otherwise.
+ * @category Comparison operations
+ * @function
+ */
+export const neq = semver.neq
+ 
+/**
+ * Returns a number indicating whether a version is greater than, equal to, or less than another version.
+ * @param {string} v1 - The first version to compare.
+ * @param {string} comparator - The comparator to use. May be '<', '<=', '>', '>=', '=', '==', '!=', '===', or '!=='.
+ * An exception is thrown if an invalid comparator is provided.
+ * @param {string} v2 - The second version to compare.
+ * @param {object} options - The options to pass to the semver.cmp function.
+ * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
+ * @returns {number} - A number indicating whether a version is greater than, equal to, or less than another version.
+ * @category Comparison operations
+ * @function
+ */
+export const cmp = semver.cmp
+ 
+/**
+ * Returns 0 if `v1 == v2`, 1 if `v1 > v2`, and -1 if `v1 < v2`. Will sort an array of versions in ascending order if
+ * passed to `Array.sort()`.
+ * @param {string} v1 - The first version to compare.
+ * @param {string} v2 - The second version to compare.
+ * @param {object} options - The options to pass to the semver.compare function.
+ * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
+ * @returns {number} - 0 if `v1 == v2`, 1 if `v1 > v2`, and -1 if `v1 < v2`.
+ * @category Comparison operations
+ * @function
+ */
+export const compare = semver.compare
+ 
+/**
+ * Same as {@link compare} except it compares build if two versions are otherwise equal.
+ * @param {string} v1 - The first version to compare.
+ * @param {string} v2 - The second version to compare.
+ * @param {object} options - The options to pass to the semver.compareBuild function.
+ * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
+ * @returns {number} - 0 if `v1 == v2`, 1 if `v1 > v2`, and -1 if `v1 < v2`.
+ * @category Comparison operations
+ * @function
+ */
+export const compareBuild = semver.compareBuild
+ 
+/**
+ * Reverse of {@link compare}.
+ * @param {string} v1 - The first version to compare.
+ * @param {string} v2 - The second version to compare.
+ * @param {object} options - The options to pass to the semver.rcompare function.
+ * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
+ * @returns {number} - 0 if `v1 == v2`, -1 if `v1 > v2`, and 1 if `v1 < v2`.
+ * @category Comparison operations
+ * @function
+ */
+export const rcompare = semver.rcompare
+ 
+/**
+ * Short for {@link compare} with `options.loose = true`.
+ * @param {string} v1 - The first version to compare.
+ * @param {string} v2 - The second version to compare.
+ * @returns {number} - 0 if `v1 == v2`, 1 if `v1 > v2`, and -1 if `v1 < v2`.
+ * @category Comparison operations
+ * @function
+ */
+export const compareLoose = semver.compareLoose
+ 
+/**
+ * Returns the difference between two versions. I.e., the most significant version component by which `v1` and `v2`
+ * differ.
+ * @param {string} v1 - The first version to compare.
+ * @param {string} v2 - The second version to compare.
+ * @param {object} options - The options to pass to the semver.diff function.
+ * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
+ * @returns {string|null} - `major`, 'minor', 'patch', 'prerelease', 'premajor', 'preminor', or 'prepatch' or null if
+ * the `v1` and `v2` are identical (disregarding build metadata).
+ * @category Comparison operations
+ * @function
+ */
+export const diff = semver.diff
+ 
+/**
+ * Sorts an array of versions in ascending order using {@link compareBuild}.
+ * @param {string[]} versions - The versions to sort.
+ * @param {object} options - The options to pass to the semver.sort function.
+ * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
+ * @returns {string[]} - The sorted versions.
+ * @category Comparison operations
+ * @function
+ */
+export const sort = semver.sort
+ 
+/**
+ * Sorts an array of versions in descending order using {@link compareBuild}.
+ * @param {string[]} versions - The versions to sort.
+ * @param {object} options - The options to pass to the semver.rsort function.
+ * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
+ * @returns {string[]} - The sorted versions.
+ * @category Comparison operations
+ * @function
+ */
+export const rsort = semver.rsort
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/qa/coverage/src/semver-range-ops.mjs.html b/qa/coverage/src/semver-range-ops.mjs.html new file mode 100644 index 0000000..41e760a --- /dev/null +++ b/qa/coverage/src/semver-range-ops.mjs.html @@ -0,0 +1,436 @@ + + + + + + Code coverage report for src/semver-range-ops.mjs + + + + + + + + + +
+
+

All files / src semver-range-ops.mjs

+
+ +
+ 100% + Statements + 10/10 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 0/0 +
+ + +
+ 100% + Lines + 10/10 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +1181x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +1x + 
import semver from 'semver'
+ 
+// note:
+// - `maxSatisfying` is overriden and defined in `max-satisfying.mjs`
+// - `minVersion` is overriden and defined in `min-version.mjs`
+ 
+/**
+ * Returns a parsed, normalized range string or null if the range is invalid.
+ * @param {string} range - The range to parse.
+ * @param {object} options - The options to pass to the semver.validRange function.
+ * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
+ * @returns {string|null} - The parsed, normalized range string or null if the range is invalid.
+ * @category Range operations
+ * @function
+ */
+export const validRange = semver.validRange
+ 
+/**
+ * Returns `true` if the version satisfies the range, `false` otherwise.
+ * @param {string} version - The version to check.
+ * @param {string} range - The range to check.
+ * @param {object} options - The options to pass to the semver.satisfies function.
+ * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
+ * @returns {boolean} - `true` if the version satisfies the range, `false` otherwise.
+ * @category Range operations
+ * @function
+ */
+export const satisfies = semver.satisfies
+ 
+/**
+ * Returns the lowest version in `versions` that satisfies the range, or null if no version satisfies the range.
+ * @param {string[]} versions - The versions to check.
+ * @param {string} range - The range to check.
+ * @param {object} options - The options to pass to the semver.minSatisfying function.
+ * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
+ * @returns {string|null} - The lowest version that satisfies the range, or null if no version satisfies the range.
+ * @category Range operations
+ * @function
+ */
+export const minSatisfying = semver.minSatisfying
+ 
+/**
+ * Returns `true` if `version` is greater than is greater than any version in `range`, `false` otherwise.
+ * @param {string} version - The version to check.
+ * @param {string} range - The range to check.
+ * @param {object} options - The options to pass to the semver.gtr function.
+ * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
+ * @returns {boolean} - `true` if `version` is greater than is greater than any version in `range`, `false` otherwise.
+ * @category Range operations
+ * @function
+ */
+export const gtr = semver.gtr
+ 
+/**
+ * Returns `true` if `version` is less than is less than any version in `range`, `false` otherwise.
+ * @param {string} version - The version to check.
+ * @param {string} range - The range to check.
+ * @param {object} options - The options to pass to the semver.ltr function.
+ * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
+ * @returns {boolean} - `true` if `version` is less than is less than any version in `range`, `false` otherwise.
+ * @category Range operations
+ * @function
+ */
+export const ltr = semver.ltr
+ 
+/**
+ * Returns `true` if `version` is outside of `range` in the indicated direction, `false` otherwise. `outside(v, r, '>)`
+ * is equivalent to `gtr(v, r)`.
+ * @param {string} version - The version to check.
+ * @param {string} range - The range to check.
+ * @param {string} direction - The direction to check. Must be '>' or '<'.
+ * @param {object} options - The options to pass to the semver.outside function.
+ * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
+ * @returns {boolean} - `true` if `version` is outside of `range` in the indicated direction, `false` otherwise.
+ * @category Range operations
+ * @function
+ */
+export const outside = semver.outside
+ 
+/**
+ * Returns `true` if any of the comparators in the range intersect with each other.
+ * @param {string} range - The first version range or comparator.
+ * @param {object} options - The options to pass to the semver.intersects function.
+ * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
+ * @returns {boolean} - `true` if any of the comparators in the range intersect with each other, `false` otherwise.
+ * @category Range operations
+ * @function
+ */
+export const intersects = semver.intersects
+ 
+/**
+ * Return a "simplified" range that matches the same items in the versions list as the range specified. Note that it
+ * does not guarantee that it would match the same versions in all cases, only for the set of versions provided. This
+ * is useful when generating ranges by joining together multiple versions with || programmatically, to provide the user
+ * with something a bit more ergonomic. If the provided range is shorter in string-length than the generated range,
+ * then that is returned.
+ * @param {string[]} versions - The versions to check.
+ * @param {string} range - The range to simplify.
+ * @param {object} options - The options to pass to the semver.simplifyRange function.
+ * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
+ * @returns {string} - The simplified range.
+ * @category Range operations
+ * @function
+ */
+export const simplifyRange = semver.simplifyRange
+ 
+/**
+ * Returns `true` if `subRange` is a subset of `superRange`, `false` otherwise.
+ * @param {string} subRange - The sub-range to check.
+ * @param {string} superRange - The super-range to check.
+ * @param {object} options - The options to pass to the semver.subset function.
+ * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
+ * @returns {boolean} - `true` if `subRange` is a subset of `superRange`, `false` otherwise.
+ * @category Range operations
+ * @function
+ */
+export const subset = semver.subset
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/qa/coverage/src/semver-version-ops.mjs.html b/qa/coverage/src/semver-version-ops.mjs.html new file mode 100644 index 0000000..4252aec --- /dev/null +++ b/qa/coverage/src/semver-version-ops.mjs.html @@ -0,0 +1,412 @@ + + + + + + Code coverage report for src/semver-version-ops.mjs + + + + + + + + + +
+
+

All files / src semver-version-ops.mjs

+
+ +
+ 100% + Statements + 10/10 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 0/0 +
+ + +
+ 100% + Lines + 10/10 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +1101x +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +1x + 
import semver from 'semver'
+ 
+/**
+ * Returns a parsed, normalized version string or null if the version is invalid.
+ * @param {string} version - The version to parse.
+ * @param {object} options - The options to pass to the semver.valid function.
+ * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
+ * @param {boolean} options.includePrerelease - Whether to include prerelease versions.
+ * @returns {string|null} - The parsed, normalized version string or null if the version is invalid.
+ * @category Version operations
+ * @function
+ */
+export const valid = semver.valid
+ 
+/**
+ * Returns a new version string incremented by the specified part.
+ * @param {string} version - The version to increment.
+ * @param {string} increment - The increment to use.
+ * @param {object} options - The options to pass to the semver.inc function.
+ * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
+ * @param {boolean} options.includePrerelease - Whether to include prerelease versions.
+ * @param {string} identifier - Used to specify the prerelease name for prerelease increments.
+ * @param {false|0|1} identifierBase - When incrementing to a new prerelease name, specifies the base number or
+ * `false` for no number.
+ * @returns {string} - The new version string.
+ * @category Version operations
+ * @function
+ */
+export const inc = semver.inc
+ 
+/**
+ * Returns an array of prerelease components or `null` if the version is not a prerelease. A 'component' is just a '.'
+ * separated string.
+ * @param {string} version - The version to parse.
+ * @param {object} options - The options to pass to the semver.inc function.
+ * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
+ * @returns {string[]|null} - The prerelease components or `null` if the version is not a prerelease.
+ * @category Version operations
+ * @function
+ */
+export const prerelease = semver.prerelease
+ 
+/**
+ * Returns the major version number.
+ * @param {string} version - The version to parse.
+ * @param {object} options - The options to pass to the semver.major function.
+ * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
+ * @returns {number} - The major version number.
+ * @category Version operations
+ * @function
+ */
+export const major = semver.major
+ 
+/**
+ * Returns the minor version number.
+ * @param {string} version - The version to parse.
+ * @param {object} options - The options to pass to the semver.minor function.
+ * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
+ * @returns {number} - The minor version number.
+ * @category Version operations
+ * @function
+ */
+export const minor = semver.minor
+ 
+/**
+ * Returns the patch version number.
+ * @param {string} version - The version to parse.
+ * @param {object} options - The options to pass to the semver.patch function.
+ * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
+ * @returns {number} - The patch version number.
+ * @category Version operations
+ * @function
+ */
+export const patch = semver.patch
+ 
+/**
+ * Attempts to parse and normalize a string as a semver string. An aliase for {@link valid}.
+ * @category Version operations
+ * @function
+ */
+export const parse = semver.parse
+ 
+/**
+ * Aggressively attempts to coerce a string into a valid semver string. Basically, starting from the left side of the
+ * string, it looks for a digit and then includes anything to the right of the digit that looks like part of a semver.
+ * So, 'Number 1!' -> '1.0.0', 'Upgrade 1.2 to 1.3' -> '1.2.0', etc.
+ * @param {string} version - The version to coerce.
+ * @param {object} options - The options to pass to the semver.coerce function.
+ * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
+ * @param {boolean} options.includePrerelease - Unless true, prerelease tags (and build metadata) are stripped. If
+ * @param {boolean} options.rtl - Instead of searching for a digit from the left, start searching from the right.
+ * true, then they are preserved.
+ * @returns {string|null} - The coerced version string or null if the version is invalid.
+ * @category Version operations
+ * @function
+ */
+export const coerce = semver.coerce
+ 
+/**
+ * Returns a cleaned version string removing unecessary comparators and, if `options.loose` is true, fixing space
+ * issues. Only works for versions, not ranges.
+ * @param {string} version - The version to clean.
+ * @param {object} options - The options to pass to the semver.clean function.
+ * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
+ * @returns {string|null} - The cleaned version string or null if the version is invalid.
+ * @category Version operations
+ * @function
+ */
+export const clean = semver.clean
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/qa/coverage/src/upper-bound.mjs.html b/qa/coverage/src/upper-bound.mjs.html new file mode 100644 index 0000000..610e047 --- /dev/null +++ b/qa/coverage/src/upper-bound.mjs.html @@ -0,0 +1,154 @@ + + + + + + Code coverage report for src/upper-bound.mjs + + + + + + + + + +
+
+

All files / src upper-bound.mjs

+
+ +
+ 88.88% + Statements + 8/9 +
+ + +
+ 80% + Branches + 4/5 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 88.88% + Lines + 8/9 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +242x +  +  +  +  +  +  +  +  +  +2x +47x +47x +  +  +  +47x +47x +  +47x +2x +  +  + 
import semver from 'semver'
+ 
+/**
+ * Finds the ceiling of a range. For '*', the ceiling is '*'. For specific versions or any range capped by a specific
+ * version, the ceiling is that version. For any open-ended range, the ceiling is defined by a '<version>-0' range
+ * function where 'verision-0' least range above the given range.
+ * @param {string} range - The range to find the ceiling for.
+ * @returns {string} - Either '*', a specific version, or a '<version>-0'.
+ * @category Range operations
+ */
+const upperBound = (range, { stripOperators = false } = {}) => {
+  const normalizedRange = semver.validRange(range)
+  Iif (normalizedRange === null) {
+    return null
+  }
+ 
+  const ranges = normalizedRange.split(' ')
+  const upperRange = ranges[ranges.length - 1]
+ 
+  return stripOperators === true ? upperRange.replace(/^[<>=]+/, '') : upperRange.replace(/^<=/, '')
+}
+ 
+export { upperBound }
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/qa/coverage/src/valid-version-or-range.mjs.html b/qa/coverage/src/valid-version-or-range.mjs.html new file mode 100644 index 0000000..966b04b --- /dev/null +++ b/qa/coverage/src/valid-version-or-range.mjs.html @@ -0,0 +1,268 @@ + + + + + + Code coverage report for src/valid-version-or-range.mjs + + + + + + + + + +
+
+

All files / src valid-version-or-range.mjs

+
+ +
+ 77.27% + Statements + 17/22 +
+ + +
+ 83.33% + Branches + 25/30 +
+ + +
+ 50% + Functions + 1/2 +
+ + +
+ 80.95% + Lines + 17/21 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +622x +  +2x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2x +  +  +  +  +  +  +15x +1x +  +14x +  +  +  +14x +  +14x +  +  +  +  +  +  +14x +2x +1x +  +1x +  +  +13x +4x +  +  +  +4x +  +  +9x +2x +  +  + 
import semver from 'semver'
+ 
+import { xRangeRE } from './constants'
+ 
+/**
+ * Validates a string to be a valid version or range. By default, an exception is raised unless `options.disallowVersions`
+ * is `true`, in which case it filters out invalid strings and returns a new array.
+ * @param {string} input - The string to validate.
+ * @param {object} options - The options to pass to the semver.valid function.
+ * @param {boolean} options.disallowRanges - Whether to disallow ranges.
+ * @param {boolean} options.disallowVersions - Whether to disallow versions and ranges which are valid versions.
+ * @param {boolean} options.includePrerelease - Whether to include prerelease versions.
+ * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
+ * @param {boolean} options.onlyXRange - Whether to only allow x-ranges. Note, even if this is `true`, and a valid
+ * x-range is presented, the returned string will still be normalized.
+ * @param {boolean} options.throwIfInvalid - If true, throws an exception if the string is invalid.
+ * @returns {string|null} - A normalized version or range string or `null` if the string is invalid (if
+ * `options.throwIfInvalid` is `true`, in which case an exception is thrown).
+ */
+const validVersionOrRange = (input = throw new Error("'input' is required."), {
+  disallowRanges = false,
+  disallowVersions = false,
+  onlyXRange = false,
+  throwIfInvalid = false,
+  ...options
+} = {}) => {
+  if (disallowVersions === true && disallowRanges === true) {
+    throw new Error("'disallowVersions' and 'disallowRanges' cannot both be true.")
+  }
+  Iif (disallowRanges === true && onlyXRange === true) {
+    throw new Error("'disallowRanges' and 'onlyXRange' cannot both be true.")
+  }
+ 
+  let normalized = disallowRanges === true ? semver.valid(input, options) : semver.validRange(input, options)
+  // test for x-range specifically
+  Iif (normalized !== null && onlyXRange === true && input.match(xRangeRE) === null) {
+    Iif (throwIfInvalid === true) {
+      throw new Error(`'${input}' is a valid range, but an x-range is specifically expected.`)
+    }
+    normalized = null
+  }
+  // test for range exclusive of versions
+  if (disallowVersions === true && semver.valid(input, options) !== null) {
+    if (throwIfInvalid === true) {
+      throw new Error(`'${input}' is a valid version, and a non-version range is expected.`)
+    }
+    normalized = null
+  }
+  // throw an exception if the string is invalid and `options.throwIfInvalid` is `true`
+  if (normalized === null && throwIfInvalid === true) {
+    const msg = `'${input}' is not a valid `
+      + `${disallowVersions === true
+        ? 'range exclusive of versions'
+        : (disallowRanges === true ? 'version' : 'version or range')}.`
+    throw new Error(msg)
+  }
+ 
+  return normalized
+}
+ 
+export { validVersionOrRange }
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/qa/coverage/src/x-sort.mjs.html b/qa/coverage/src/x-sort.mjs.html new file mode 100644 index 0000000..8e30af4 --- /dev/null +++ b/qa/coverage/src/x-sort.mjs.html @@ -0,0 +1,418 @@ + + + + + + Code coverage report for src/x-sort.mjs + + + + + + + + + +
+
+

All files / src x-sort.mjs

+
+ +
+ 86.66% + Statements + 52/60 +
+ + +
+ 72.41% + Branches + 21/29 +
+ + +
+ 100% + Functions + 4/4 +
+ + +
+ 86.2% + Lines + 50/58 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +1121x +  +1x +1x +  +  +  +  +  +  +  +1x +  +16x +16x +  +  +47x +  +16x +47x +26x +  +  +21x +21x +21x +  +  +  +  +  +  +  +  +  +  +  +  +  +16x +  +16x +20x +20x +  +20x +  +  +20x +7x +  +13x +  +  +13x +  +  +13x +  +  +  +13x +  +  +  +16x +3x +  +13x +4x +  +  +9x +  +9x +9x +19x +9x +9x +  +  +10x +10x +8x +  +  +  +8x +8x +7x +7x +  +  +1x +  +  +2x +1x +1x +  +1x +1x +1x +  +  +  +9x +1x +  +  + 
import semver from 'semver'
+ 
+import { xRangeRE } from './constants'
+import { upperBound } from './upper-bound'
+ 
+/**
+ * Ascend sorts a mix of semver versions and x-range specified ranges (e.g., 1.2.* or 1.2.x). The ranges are sorted according to their highest version; e.g., 1.3.34 < 1.3.*. (I believe it can accept caret ranges too, but I would need to review the spec.)
+ * @param {string[]} versionsAndRanges - The versions and ranges to sort.
+ * @returns {string[]} - The sorted versions and ranges.
+ * @category Comparison operations
+ */
+const xSort = (versionsAndRanges) => {
+  // TODO: to sort any range type, develop 'minOutOfRange' and use those to sort ranges
+  const versions = []
+  const ranges = []
+ 
+  // filter out duplicates
+  versionsAndRanges = versionsAndRanges.filter((v, i, a) => i === a.indexOf(v))
+ 
+  for (const versionOrRange of versionsAndRanges) {
+    if (versionOrRange.match(xRangeRE)) {
+      ranges.push(versionOrRange)
+    }
+    else {
+      const version = semver.valid(versionOrRange)
+      if (version !== null) {
+        versions.push(versionOrRange)
+      }
+      else E{
+        const range = semver.validRange(versionOrRange)
+        if (range !== null) {
+          ranges.push(versionOrRange)
+        }
+        else {
+          throw new Error(`Input '${versionOrRange}' is neither a version nor version range.`)
+        }
+      }
+    }
+  }
+ 
+  const sortedVersions = versions.sort(semver.compare)
+ 
+  const sortedRanges = ranges.sort((a, b) => {
+    const firstPastA = upperBound(a, { stripOperators : true })
+    const firstPastB = upperBound(b, { stripOperators : true })
+ 
+    Iif (firstPastA === '*') {
+      return 1
+    }
+    else if (firstPastB === '*') {
+      return -1
+    }
+    else Iif (firstPastA === null && firstPastB === null) {
+      return 0
+    }
+    else Iif (firstPastA === null) {
+      return 1
+    }
+    else Iif (firstPastB === null) {
+      return -1
+    }
+    else {
+      return semver.compare(firstPastA, firstPastB)
+    }
+  })
+ 
+  if (sortedVersions.length === 0) {
+    return sortedRanges
+  }
+  else if (sortedRanges.length === 0) {
+    return sortedVersions
+  }
+ 
+  const allSorted = [...versions]
+ 
+  let allRangesGreater = false
+  for (const range of sortedRanges) {
+    if (allRangesGreater === true) {
+      allSorted.push(range)
+      continue
+    }
+ 
+    const lastVersion = semver.maxSatisfying(sortedVersions, range)
+    if (lastVersion !== null) {
+      const indexOfLastVersion = allSorted.indexOf(lastVersion)
+      // we may have already inserted a range, so we need to find where the possible sequence of ranges ends and the
+      // next version begins (because ranges are sorted, we want to insert our range at the end of the sequence of
+      // ranges, if any).
+      const nextVersionOffset = allSorted.slice(indexOfLastVersion + 1).findIndex((vOrR) => semver.valid(vOrR))
+      if (nextVersionOffset === -1) {
+        allSorted.push(range)
+        allRangesGreater = true
+      }
+      else {
+        allSorted.splice(indexOfLastVersion + 1 + nextVersionOffset, 0, range)
+      }
+    }
+    else if (semver.gtr(sortedVersions[0], range)) {
+      const indexOfLowestRange = allSorted.indexOf(sortedVersions[0])
+      allSorted.splice(indexOfLowestRange, 0, range)
+    }
+    else if (semver.ltr(sortedVersions[sortedVersions.length - 1], range)) {
+      allSorted.push(range)
+      allRangesGreater = true
+    }
+  }
+ 
+  return allSorted
+}
+ 
+export { xSort }
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/qa/lint.txt b/qa/lint.txt new file mode 100644 index 0000000..9b13e13 --- /dev/null +++ b/qa/lint.txt @@ -0,0 +1 @@ +Test git rev: abf8dcd30189d8392473cb78f8721ed2154a2214 diff --git a/qa/unit-test.txt b/qa/unit-test.txt new file mode 100644 index 0000000..951d045 --- /dev/null +++ b/qa/unit-test.txt @@ -0,0 +1,34 @@ +Test git rev: 82169d0c77780d6bd449bcfb19143c8d722fc1ef +PASS test/valid-version-or-range.test.js +PASS test/next-version.test.js +PASS test/max-satisfying.test.js +PASS test/x-sort.test.js +PASS test/min-version.test.js +PASS test/prerelease.test.js +PASS test/upper-bound.test.js +-----------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +-----------------------------|---------|----------|---------|---------|------------------- +All files | 86.42 | 82.39 | 75 | 86.97 | + src | 92.71 | 87.96 | 90 | 93.03 | + constants.mjs | 100 | 100 | 100 | 100 | + ext-constants.mjs | 100 | 100 | 100 | 100 | + max-satisfying.mjs | 93.75 | 100 | 100 | 93.75 | 29 + min-version.mjs | 100 | 85.71 | 100 | 100 | 22 + next-version.mjs | 100 | 98.03 | 100 | 100 | 25 + semver-comparison-ops.mjs | 100 | 100 | 100 | 100 | + semver-range-ops.mjs | 100 | 100 | 100 | 100 | + semver-version-ops.mjs | 100 | 100 | 100 | 100 | + upper-bound.mjs | 88.88 | 80 | 100 | 88.88 | 14 + valid-version-or-range.mjs | 77.27 | 83.33 | 50 | 80.95 | 31,37-40 + x-sort.mjs | 86.66 | 72.41 | 100 | 86.2 | 30-35,48,54,57,60 + src/lib | 0 | 0 | 0 | 0 | + compare-helper.mjs | 0 | 0 | 0 | 0 | 1-14 + set-default-options.mjs | 0 | 0 | 0 | 0 | 1-10 +-----------------------------|---------|----------|---------|---------|------------------- + +Test Suites: 7 passed, 7 total +Tests: 128 passed, 128 total +Snapshots: 0 total +Time: 0.34 s, estimated 1 s +Ran all test suites. From 90f6fea70e96b489bc8337dcdf1980b653f0a6e0 Mon Sep 17 00:00:00 2001 From: Zane Rockenbaugh Date: Sun, 19 Oct 2025 15:40:16 -0500 Subject: [PATCH 9/9] removed QA files --- qa/coverage/base.css | 224 ------- qa/coverage/block-navigation.js | 87 --- qa/coverage/clover.xml | 266 -------- qa/coverage/coverage-final.json | 14 - qa/coverage/favicon.png | Bin 445 -> 0 bytes qa/coverage/index.html | 131 ---- qa/coverage/prettify.css | 1 - qa/coverage/prettify.js | 2 - qa/coverage/sort-arrow-sprite.png | Bin 138 -> 0 bytes qa/coverage/sorter.js | 196 ------ qa/coverage/src/constants.mjs.html | 100 --- qa/coverage/src/ext-constants.mjs.html | 154 ----- qa/coverage/src/index.html | 266 -------- qa/coverage/src/lib/compare-helper.mjs.html | 133 ---- qa/coverage/src/lib/index.html | 131 ---- .../src/lib/set-default-options.mjs.html | 121 ---- qa/coverage/src/max-satisfying.mjs.html | 217 ------- qa/coverage/src/min-version.mjs.html | 169 ----- qa/coverage/src/next-version.mjs.html | 403 ------------ .../src/semver-comparison-ops.mjs.html | 595 ------------------ qa/coverage/src/semver-range-ops.mjs.html | 436 ------------- qa/coverage/src/semver-version-ops.mjs.html | 412 ------------ qa/coverage/src/upper-bound.mjs.html | 154 ----- .../src/valid-version-or-range.mjs.html | 268 -------- qa/coverage/src/x-sort.mjs.html | 418 ------------ qa/lint.txt | 1 - qa/unit-test.txt | 34 - 27 files changed, 4933 deletions(-) delete mode 100644 qa/coverage/base.css delete mode 100644 qa/coverage/block-navigation.js delete mode 100644 qa/coverage/clover.xml delete mode 100644 qa/coverage/coverage-final.json delete mode 100644 qa/coverage/favicon.png delete mode 100644 qa/coverage/index.html delete mode 100644 qa/coverage/prettify.css delete mode 100644 qa/coverage/prettify.js delete mode 100644 qa/coverage/sort-arrow-sprite.png delete mode 100644 qa/coverage/sorter.js delete mode 100644 qa/coverage/src/constants.mjs.html delete mode 100644 qa/coverage/src/ext-constants.mjs.html delete mode 100644 qa/coverage/src/index.html delete mode 100644 qa/coverage/src/lib/compare-helper.mjs.html delete mode 100644 qa/coverage/src/lib/index.html delete mode 100644 qa/coverage/src/lib/set-default-options.mjs.html delete mode 100644 qa/coverage/src/max-satisfying.mjs.html delete mode 100644 qa/coverage/src/min-version.mjs.html delete mode 100644 qa/coverage/src/next-version.mjs.html delete mode 100644 qa/coverage/src/semver-comparison-ops.mjs.html delete mode 100644 qa/coverage/src/semver-range-ops.mjs.html delete mode 100644 qa/coverage/src/semver-version-ops.mjs.html delete mode 100644 qa/coverage/src/upper-bound.mjs.html delete mode 100644 qa/coverage/src/valid-version-or-range.mjs.html delete mode 100644 qa/coverage/src/x-sort.mjs.html delete mode 100644 qa/lint.txt delete mode 100644 qa/unit-test.txt diff --git a/qa/coverage/base.css b/qa/coverage/base.css deleted file mode 100644 index f418035..0000000 --- a/qa/coverage/base.css +++ /dev/null @@ -1,224 +0,0 @@ -body, html { - margin:0; padding: 0; - height: 100%; -} -body { - font-family: Helvetica Neue, Helvetica, Arial; - font-size: 14px; - color:#333; -} -.small { font-size: 12px; } -*, *:after, *:before { - -webkit-box-sizing:border-box; - -moz-box-sizing:border-box; - box-sizing:border-box; - } -h1 { font-size: 20px; margin: 0;} -h2 { font-size: 14px; } -pre { - font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; - margin: 0; - padding: 0; - -moz-tab-size: 2; - -o-tab-size: 2; - tab-size: 2; -} -a { color:#0074D9; text-decoration:none; } -a:hover { text-decoration:underline; } -.strong { font-weight: bold; } -.space-top1 { padding: 10px 0 0 0; } -.pad2y { padding: 20px 0; } -.pad1y { padding: 10px 0; } -.pad2x { padding: 0 20px; } -.pad2 { padding: 20px; } -.pad1 { padding: 10px; } -.space-left2 { padding-left:55px; } -.space-right2 { padding-right:20px; } -.center { text-align:center; } -.clearfix { display:block; } -.clearfix:after { - content:''; - display:block; - height:0; - clear:both; - visibility:hidden; - } -.fl { float: left; } -@media only screen and (max-width:640px) { - .col3 { width:100%; max-width:100%; } - .hide-mobile { display:none!important; } -} - -.quiet { - color: #7f7f7f; - color: rgba(0,0,0,0.5); -} -.quiet a { opacity: 0.7; } - -.fraction { - font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; - font-size: 10px; - color: #555; - background: #E8E8E8; - padding: 4px 5px; - border-radius: 3px; - vertical-align: middle; -} - -div.path a:link, div.path a:visited { color: #333; } -table.coverage { - border-collapse: collapse; - margin: 10px 0 0 0; - padding: 0; -} - -table.coverage td { - margin: 0; - padding: 0; - vertical-align: top; -} -table.coverage td.line-count { - text-align: right; - padding: 0 5px 0 20px; -} -table.coverage td.line-coverage { - text-align: right; - padding-right: 10px; - min-width:20px; -} - -table.coverage td span.cline-any { - display: inline-block; - padding: 0 5px; - width: 100%; -} -.missing-if-branch { - display: inline-block; - margin-right: 5px; - border-radius: 3px; - position: relative; - padding: 0 4px; - background: #333; - color: yellow; -} - -.skip-if-branch { - display: none; - margin-right: 10px; - position: relative; - padding: 0 4px; - background: #ccc; - color: white; -} -.missing-if-branch .typ, .skip-if-branch .typ { - color: inherit !important; -} -.coverage-summary { - border-collapse: collapse; - width: 100%; -} -.coverage-summary tr { border-bottom: 1px solid #bbb; } -.keyline-all { border: 1px solid #ddd; } -.coverage-summary td, .coverage-summary th { padding: 10px; } -.coverage-summary tbody { border: 1px solid #bbb; } -.coverage-summary td { border-right: 1px solid #bbb; } -.coverage-summary td:last-child { border-right: none; } -.coverage-summary th { - text-align: left; - font-weight: normal; - white-space: nowrap; -} -.coverage-summary th.file { border-right: none !important; } -.coverage-summary th.pct { } -.coverage-summary th.pic, -.coverage-summary th.abs, -.coverage-summary td.pct, -.coverage-summary td.abs { text-align: right; } -.coverage-summary td.file { white-space: nowrap; } -.coverage-summary td.pic { min-width: 120px !important; } -.coverage-summary tfoot td { } - -.coverage-summary .sorter { - height: 10px; - width: 7px; - display: inline-block; - margin-left: 0.5em; - background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; -} -.coverage-summary .sorted .sorter { - background-position: 0 -20px; -} -.coverage-summary .sorted-desc .sorter { - background-position: 0 -10px; -} -.status-line { height: 10px; } -/* yellow */ -.cbranch-no { background: yellow !important; color: #111; } -/* dark red */ -.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } -.low .chart { border:1px solid #C21F39 } -.highlighted, -.highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{ - background: #C21F39 !important; -} -/* medium red */ -.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } -/* light red */ -.low, .cline-no { background:#FCE1E5 } -/* light green */ -.high, .cline-yes { background:rgb(230,245,208) } -/* medium green */ -.cstat-yes { background:rgb(161,215,106) } -/* dark green */ -.status-line.high, .high .cover-fill { background:rgb(77,146,33) } -.high .chart { border:1px solid rgb(77,146,33) } -/* dark yellow (gold) */ -.status-line.medium, .medium .cover-fill { background: #f9cd0b; } -.medium .chart { border:1px solid #f9cd0b; } -/* light yellow */ -.medium { background: #fff4c2; } - -.cstat-skip { background: #ddd; color: #111; } -.fstat-skip { background: #ddd; color: #111 !important; } -.cbranch-skip { background: #ddd !important; color: #111; } - -span.cline-neutral { background: #eaeaea; } - -.coverage-summary td.empty { - opacity: .5; - padding-top: 4px; - padding-bottom: 4px; - line-height: 1; - color: #888; -} - -.cover-fill, .cover-empty { - display:inline-block; - height: 12px; -} -.chart { - line-height: 0; -} -.cover-empty { - background: white; -} -.cover-full { - border-right: none !important; -} -pre.prettyprint { - border: none !important; - padding: 0 !important; - margin: 0 !important; -} -.com { color: #999 !important; } -.ignore-none { color: #999; font-weight: normal; } - -.wrapper { - min-height: 100%; - height: auto !important; - height: 100%; - margin: 0 auto -48px; -} -.footer, .push { - height: 48px; -} diff --git a/qa/coverage/block-navigation.js b/qa/coverage/block-navigation.js deleted file mode 100644 index cc12130..0000000 --- a/qa/coverage/block-navigation.js +++ /dev/null @@ -1,87 +0,0 @@ -/* eslint-disable */ -var jumpToCode = (function init() { - // Classes of code we would like to highlight in the file view - var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no']; - - // Elements to highlight in the file listing view - var fileListingElements = ['td.pct.low']; - - // We don't want to select elements that are direct descendants of another match - var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > ` - - // Selecter that finds elements on the page to which we can jump - var selector = - fileListingElements.join(', ') + - ', ' + - notSelector + - missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b` - - // The NodeList of matching elements - var missingCoverageElements = document.querySelectorAll(selector); - - var currentIndex; - - function toggleClass(index) { - missingCoverageElements - .item(currentIndex) - .classList.remove('highlighted'); - missingCoverageElements.item(index).classList.add('highlighted'); - } - - function makeCurrent(index) { - toggleClass(index); - currentIndex = index; - missingCoverageElements.item(index).scrollIntoView({ - behavior: 'smooth', - block: 'center', - inline: 'center' - }); - } - - function goToPrevious() { - var nextIndex = 0; - if (typeof currentIndex !== 'number' || currentIndex === 0) { - nextIndex = missingCoverageElements.length - 1; - } else if (missingCoverageElements.length > 1) { - nextIndex = currentIndex - 1; - } - - makeCurrent(nextIndex); - } - - function goToNext() { - var nextIndex = 0; - - if ( - typeof currentIndex === 'number' && - currentIndex < missingCoverageElements.length - 1 - ) { - nextIndex = currentIndex + 1; - } - - makeCurrent(nextIndex); - } - - return function jump(event) { - if ( - document.getElementById('fileSearch') === document.activeElement && - document.activeElement != null - ) { - // if we're currently focused on the search input, we don't want to navigate - return; - } - - switch (event.which) { - case 78: // n - case 74: // j - goToNext(); - break; - case 66: // b - case 75: // k - case 80: // p - goToPrevious(); - break; - } - }; -})(); -window.addEventListener('keydown', jumpToCode); diff --git a/qa/coverage/clover.xml b/qa/coverage/clover.xml deleted file mode 100644 index 34898ce..0000000 --- a/qa/coverage/clover.xml +++ /dev/null @@ -1,266 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/qa/coverage/coverage-final.json b/qa/coverage/coverage-final.json deleted file mode 100644 index c8fbe44..0000000 --- a/qa/coverage/coverage-final.json +++ /dev/null @@ -1,14 +0,0 @@ -{"/Users/zane/playground/liquid-labs/semver-plus/src/constants.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/constants.mjs","statementMap":{"0":{"start":{"line":1,"column":21},"end":{"line":4,"column":121}},"1":{"start":{"line":5,"column":31},"end":{"line":5,"column":96}}},"fnMap":{},"branchMap":{},"s":{"0":4,"1":4},"f":{},"b":{}} -,"/Users/zane/playground/liquid-labs/semver-plus/src/ext-constants.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/ext-constants.mjs","statementMap":{"0":{"start":{"line":1,"column":32},"end":{"line":13,"column":null}},"1":{"start":{"line":16,"column":43},"end":{"line":16,"column":102}},"2":{"start":{"line":17,"column":38},"end":{"line":17,"column":64}},"3":{"start":{"line":18,"column":35},"end":{"line":18,"column":76}},"4":{"start":{"line":20,"column":0},"end":{"line":20,"column":null}},"5":{"start":{"line":21,"column":0},"end":{"line":21,"column":null}},"6":{"start":{"line":22,"column":0},"end":{"line":22,"column":null}},"7":{"start":{"line":23,"column":0},"end":{"line":23,"column":null}}},"fnMap":{},"branchMap":{},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1},"f":{},"b":{}} -,"/Users/zane/playground/liquid-labs/semver-plus/src/max-satisfying.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/max-satisfying.mjs","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":null}},"2":{"start":{"line":4,"column":0},"end":{"line":4,"column":null}},"3":{"start":{"line":5,"column":0},"end":{"line":5,"column":null}},"4":{"start":{"line":26,"column":29},"end":{"line":44,"column":1}},"5":{"start":{"line":27,"column":2},"end":{"line":30,"column":null}},"6":{"start":{"line":28,"column":4},"end":{"line":28,"column":null}},"7":{"start":{"line":29,"column":4},"end":{"line":29,"column":null}},"8":{"start":{"line":32,"column":2},"end":{"line":34,"column":null}},"9":{"start":{"line":33,"column":4},"end":{"line":33,"column":null}},"10":{"start":{"line":36,"column":2},"end":{"line":36,"column":null}},"11":{"start":{"line":38,"column":2},"end":{"line":42,"column":null}},"12":{"start":{"line":39,"column":4},"end":{"line":41,"column":null}},"13":{"start":{"line":40,"column":6},"end":{"line":40,"column":null}},"14":{"start":{"line":43,"column":2},"end":{"line":43,"column":null}},"15":{"start":{"line":44,"column":1},"end":{"line":44,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":26,"column":29},"end":{"line":26,"column":30}},"loc":{"start":{"line":26,"column":59},"end":{"line":44,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":27,"column":2},"end":{"line":30,"column":null}},"type":"if","locations":[{"start":{"line":27,"column":2},"end":{"line":30,"column":null}}]},"1":{"loc":{"start":{"line":27,"column":6},"end":{"line":27,"column":29}},"type":"cond-expr","locations":[{"start":{"line":27,"column":13},"end":{"line":27,"column":15}},{"start":{"line":27,"column":6},"end":{"line":27,"column":29}}]},"2":{"loc":{"start":{"line":27,"column":6},"end":{"line":27,"column":15}},"type":"binary-expr","locations":[{"start":{"line":27,"column":6},"end":{"line":27,"column":15}},{"start":{"line":27,"column":6},"end":{"line":27,"column":15}}]},"3":{"loc":{"start":{"line":32,"column":2},"end":{"line":34,"column":null}},"type":"if","locations":[{"start":{"line":32,"column":2},"end":{"line":34,"column":null}}]},"4":{"loc":{"start":{"line":32,"column":6},"end":{"line":32,"column":21}},"type":"cond-expr","locations":[{"start":{"line":32,"column":13},"end":{"line":32,"column":15}},{"start":{"line":32,"column":6},"end":{"line":32,"column":21}}]},"5":{"loc":{"start":{"line":32,"column":6},"end":{"line":32,"column":15}},"type":"binary-expr","locations":[{"start":{"line":32,"column":6},"end":{"line":32,"column":15}},{"start":{"line":32,"column":6},"end":{"line":32,"column":15}}]},"6":{"loc":{"start":{"line":39,"column":4},"end":{"line":41,"column":null}},"type":"if","locations":[{"start":{"line":39,"column":4},"end":{"line":41,"column":null}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":16,"6":1,"7":0,"8":15,"9":1,"10":14,"11":14,"12":18,"13":11,"14":3,"15":1},"f":{"0":16},"b":{"0":[1],"1":[7,9],"2":[16,16],"3":[1],"4":[7,8],"5":[15,15],"6":[11]}} -,"/Users/zane/playground/liquid-labs/semver-plus/src/min-version.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/min-version.mjs","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":null}},"2":{"start":{"line":19,"column":19},"end":{"line":26,"column":1}},"3":{"start":{"line":22,"column":2},"end":{"line":24,"column":null}},"4":{"start":{"line":23,"column":4},"end":{"line":23,"column":null}},"5":{"start":{"line":25,"column":2},"end":{"line":25,"column":null}},"6":{"start":{"line":26,"column":1},"end":{"line":26,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":19,"column":19},"end":{"line":19,"column":20}},"loc":{"start":{"line":19,"column":39},"end":{"line":26,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":22,"column":2},"end":{"line":24,"column":null}},"type":"if","locations":[{"start":{"line":22,"column":2},"end":{"line":24,"column":null}}]},"1":{"loc":{"start":{"line":22,"column":6},"end":{"line":22,"column":65}},"type":"binary-expr","locations":[{"start":{"line":22,"column":6},"end":{"line":22,"column":30}},{"start":{"line":22,"column":34},"end":{"line":22,"column":65}}]},"2":{"loc":{"start":{"line":22,"column":6},"end":{"line":22,"column":21}},"type":"cond-expr","locations":[{"start":{"line":22,"column":13},"end":{"line":22,"column":15}},{"start":{"line":22,"column":6},"end":{"line":22,"column":21}}]},"3":{"loc":{"start":{"line":22,"column":6},"end":{"line":22,"column":15}},"type":"binary-expr","locations":[{"start":{"line":22,"column":6},"end":{"line":22,"column":15}},{"start":{"line":22,"column":6},"end":{"line":22,"column":15}}]}},"s":{"0":1,"1":1,"2":1,"3":21,"4":5,"5":16,"6":1},"f":{"0":21},"b":{"0":[5],"1":[21,21],"2":[21,0],"3":[21,21]}} -,"/Users/zane/playground/liquid-labs/semver-plus/src/next-version.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/next-version.mjs","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":null}},"2":{"start":{"line":4,"column":0},"end":{"line":4,"column":null}},"3":{"start":{"line":23,"column":20},"end":{"line":104,"column":1}},"4":{"start":{"line":24,"column":2},"end":{"line":27,"column":null}},"5":{"start":{"line":25,"column":17},"end":{"line":25,"column":108}},"6":{"start":{"line":26,"column":4},"end":{"line":26,"column":null}},"7":{"start":{"line":29,"column":2},"end":{"line":31,"column":null}},"8":{"start":{"line":30,"column":4},"end":{"line":30,"column":null}},"9":{"start":{"line":32,"column":30},"end":{"line":32,"column":53}},"10":{"start":{"line":33,"column":30},"end":{"line":33,"column":117}},"11":{"start":{"line":35,"column":2},"end":{"line":35,"column":null}},"12":{"start":{"line":40,"column":35},"end":{"line":40,"column":61}},"13":{"start":{"line":41,"column":25},"end":{"line":41,"column":102}},"14":{"start":{"line":44,"column":29},"end":{"line":44,"column":126}},"15":{"start":{"line":45,"column":33},"end":{"line":47,"column":72}},"16":{"start":{"line":48,"column":35},"end":{"line":48,"column":93}},"17":{"start":{"line":51,"column":2},"end":{"line":53,"column":null}},"18":{"start":{"line":52,"column":4},"end":{"line":52,"column":null}},"19":{"start":{"line":54,"column":2},"end":{"line":69,"column":null}},"20":{"start":{"line":55,"column":4},"end":{"line":55,"column":null}},"21":{"start":{"line":57,"column":7},"end":{"line":69,"column":null}},"22":{"start":{"line":58,"column":22},"end":{"line":58,"column":79}},"23":{"start":{"line":59,"column":27},"end":{"line":59,"column":71}},"24":{"start":{"line":60,"column":4},"end":{"line":62,"column":null}},"25":{"start":{"line":61,"column":6},"end":{"line":61,"column":null}},"26":{"start":{"line":64,"column":7},"end":{"line":69,"column":null}},"27":{"start":{"line":65,"column":4},"end":{"line":65,"column":null}},"28":{"start":{"line":67,"column":7},"end":{"line":69,"column":null}},"29":{"start":{"line":68,"column":4},"end":{"line":68,"column":null}},"30":{"start":{"line":72,"column":2},"end":{"line":94,"column":null}},"31":{"start":{"line":73,"column":4},"end":{"line":77,"column":null}},"32":{"start":{"line":73,"column":44},"end":{"line":73,"column":null}},"33":{"start":{"line":74,"column":9},"end":{"line":77,"column":null}},"34":{"start":{"line":74,"column":48},"end":{"line":74,"column":null}},"35":{"start":{"line":75,"column":9},"end":{"line":77,"column":null}},"36":{"start":{"line":76,"column":6},"end":{"line":76,"column":null}},"37":{"start":{"line":79,"column":4},"end":{"line":79,"column":19}},"38":{"start":{"line":81,"column":7},"end":{"line":94,"column":null}},"39":{"start":{"line":82,"column":4},"end":{"line":87,"column":null}},"40":{"start":{"line":83,"column":6},"end":{"line":83,"column":null}},"41":{"start":{"line":86,"column":6},"end":{"line":86,"column":null}},"42":{"start":{"line":89,"column":4},"end":{"line":89,"column":null}},"43":{"start":{"line":91,"column":7},"end":{"line":94,"column":null}},"44":{"start":{"line":93,"column":4},"end":{"line":93,"column":null}},"45":{"start":{"line":96,"column":2},"end":{"line":96,"column":null}},"46":{"start":{"line":104,"column":1},"end":{"line":104,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":23,"column":20},"end":{"line":23,"column":21}},"loc":{"start":{"line":23,"column":44},"end":{"line":104,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":24,"column":2},"end":{"line":27,"column":null}},"type":"if","locations":[{"start":{"line":24,"column":2},"end":{"line":27,"column":null}}]},"1":{"loc":{"start":{"line":25,"column":50},"end":{"line":25,"column":107}},"type":"cond-expr","locations":[{"start":{"line":25,"column":79},"end":{"line":25,"column":101}},{"start":{"line":25,"column":104},"end":{"line":25,"column":107}}]},"2":{"loc":{"start":{"line":29,"column":2},"end":{"line":31,"column":null}},"type":"if","locations":[{"start":{"line":29,"column":2},"end":{"line":31,"column":null}}]},"3":{"loc":{"start":{"line":29,"column":6},"end":{"line":29,"column":73}},"type":"binary-expr","locations":[{"start":{"line":29,"column":6},"end":{"line":29,"column":29}},{"start":{"line":29,"column":33},"end":{"line":29,"column":73}}]},"4":{"loc":{"start":{"line":35,"column":14},"end":{"line":35,"column":73}},"type":"binary-expr","locations":[{"start":{"line":35,"column":14},"end":{"line":35,"column":23}},{"start":{"line":35,"column":28},"end":{"line":35,"column":72}}]},"5":{"loc":{"start":{"line":35,"column":28},"end":{"line":35,"column":72}},"type":"cond-expr","locations":[{"start":{"line":35,"column":50},"end":{"line":35,"column":57}},{"start":{"line":35,"column":60},"end":{"line":35,"column":72}}]},"6":{"loc":{"start":{"line":41,"column":25},"end":{"line":41,"column":102}},"type":"cond-expr","locations":[{"start":{"line":41,"column":61},"end":{"line":41,"column":65}},{"start":{"line":41,"column":68},"end":{"line":41,"column":102}}]},"7":{"loc":{"start":{"line":44,"column":29},"end":{"line":44,"column":126}},"type":"cond-expr","locations":[{"start":{"line":44,"column":55},"end":{"line":44,"column":59}},{"start":{"line":44,"column":62},"end":{"line":44,"column":126}}]},"8":{"loc":{"start":{"line":45,"column":33},"end":{"line":47,"column":72}},"type":"cond-expr","locations":[{"start":{"line":46,"column":6},"end":{"line":46,"column":10}},{"start":{"line":47,"column":7},"end":{"line":47,"column":72}}]},"9":{"loc":{"start":{"line":47,"column":7},"end":{"line":47,"column":72}},"type":"cond-expr","locations":[{"start":{"line":47,"column":45},"end":{"line":47,"column":47}},{"start":{"line":47,"column":50},"end":{"line":47,"column":72}}]},"10":{"loc":{"start":{"line":51,"column":2},"end":{"line":53,"column":null}},"type":"if","locations":[{"start":{"line":51,"column":2},"end":{"line":53,"column":null}}]},"11":{"loc":{"start":{"line":51,"column":6},"end":{"line":51,"column":92}},"type":"binary-expr","locations":[{"start":{"line":51,"column":6},"end":{"line":51,"column":29}},{"start":{"line":51,"column":33},"end":{"line":51,"column":92}}]},"12":{"loc":{"start":{"line":54,"column":2},"end":{"line":69,"column":null}},"type":"if","locations":[{"start":{"line":54,"column":2},"end":{"line":69,"column":null}},{"start":{"line":57,"column":7},"end":{"line":69,"column":null}}]},"13":{"loc":{"start":{"line":54,"column":6},"end":{"line":54,"column":67}},"type":"binary-expr","locations":[{"start":{"line":54,"column":6},"end":{"line":54,"column":32}},{"start":{"line":54,"column":36},"end":{"line":54,"column":67}}]},"14":{"loc":{"start":{"line":57,"column":7},"end":{"line":69,"column":null}},"type":"if","locations":[{"start":{"line":57,"column":7},"end":{"line":69,"column":null}},{"start":{"line":64,"column":7},"end":{"line":69,"column":null}}]},"15":{"loc":{"start":{"line":57,"column":11},"end":{"line":57,"column":93}},"type":"binary-expr","locations":[{"start":{"line":57,"column":11},"end":{"line":57,"column":44}},{"start":{"line":57,"column":48},"end":{"line":57,"column":93}}]},"16":{"loc":{"start":{"line":60,"column":4},"end":{"line":62,"column":null}},"type":"if","locations":[{"start":{"line":60,"column":4},"end":{"line":62,"column":null}}]},"17":{"loc":{"start":{"line":64,"column":7},"end":{"line":69,"column":null}},"type":"if","locations":[{"start":{"line":64,"column":7},"end":{"line":69,"column":null}},{"start":{"line":67,"column":7},"end":{"line":69,"column":null}}]},"18":{"loc":{"start":{"line":64,"column":11},"end":{"line":64,"column":84}},"type":"binary-expr","locations":[{"start":{"line":64,"column":11},"end":{"line":64,"column":30}},{"start":{"line":64,"column":34},"end":{"line":64,"column":84}}]},"19":{"loc":{"start":{"line":67,"column":7},"end":{"line":69,"column":null}},"type":"if","locations":[{"start":{"line":67,"column":7},"end":{"line":69,"column":null}}]},"20":{"loc":{"start":{"line":67,"column":11},"end":{"line":67,"column":86}},"type":"binary-expr","locations":[{"start":{"line":67,"column":11},"end":{"line":67,"column":31}},{"start":{"line":67,"column":35},"end":{"line":67,"column":86}}]},"21":{"loc":{"start":{"line":72,"column":2},"end":{"line":94,"column":null}},"type":"if","locations":[{"start":{"line":72,"column":2},"end":{"line":94,"column":null}},{"start":{"line":81,"column":7},"end":{"line":94,"column":null}}]},"22":{"loc":{"start":{"line":73,"column":4},"end":{"line":77,"column":null}},"type":"if","locations":[{"start":{"line":73,"column":4},"end":{"line":77,"column":null}},{"start":{"line":74,"column":9},"end":{"line":77,"column":null}}]},"23":{"loc":{"start":{"line":74,"column":9},"end":{"line":77,"column":null}},"type":"if","locations":[{"start":{"line":74,"column":9},"end":{"line":77,"column":null}},{"start":{"line":75,"column":9},"end":{"line":77,"column":null}}]},"24":{"loc":{"start":{"line":75,"column":9},"end":{"line":77,"column":null}},"type":"if","locations":[{"start":{"line":75,"column":9},"end":{"line":77,"column":null}}]},"25":{"loc":{"start":{"line":81,"column":7},"end":{"line":94,"column":null}},"type":"if","locations":[{"start":{"line":81,"column":7},"end":{"line":94,"column":null}},{"start":{"line":91,"column":7},"end":{"line":94,"column":null}}]},"26":{"loc":{"start":{"line":82,"column":4},"end":{"line":87,"column":null}},"type":"if","locations":[{"start":{"line":82,"column":4},"end":{"line":87,"column":null}},{"start":{"line":85,"column":9},"end":{"line":87,"column":null}}]},"27":{"loc":{"start":{"line":91,"column":7},"end":{"line":94,"column":null}},"type":"if","locations":[{"start":{"line":91,"column":7},"end":{"line":94,"column":null}}]},"28":{"loc":{"start":{"line":91,"column":11},"end":{"line":91,"column":68}},"type":"binary-expr","locations":[{"start":{"line":91,"column":11},"end":{"line":91,"column":37}},{"start":{"line":91,"column":41},"end":{"line":91,"column":68}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":47,"5":4,"6":4,"7":43,"8":1,"9":42,"10":42,"11":42,"12":42,"13":42,"14":42,"15":42,"16":42,"17":42,"18":1,"19":41,"20":2,"21":39,"22":8,"23":8,"24":8,"25":5,"26":31,"27":3,"28":28,"29":6,"30":25,"31":4,"32":1,"33":3,"34":1,"35":2,"36":2,"37":4,"38":21,"39":6,"40":3,"41":3,"42":6,"43":15,"44":3,"45":12,"46":1},"f":{"0":47},"b":{"0":[4],"1":[4,0],"2":[1],"3":[43,37],"4":[42,6],"5":[1,5],"6":[11,31],"7":[11,31],"8":[12,30],"9":[1,29],"10":[1],"11":[42,5],"12":[2,39],"13":[41,10],"14":[8,31],"15":[39,27],"16":[5],"17":[3,28],"18":[31,10],"19":[6],"20":[28,21],"21":[4,21],"22":[1,3],"23":[1,2],"24":[2],"25":[6,15],"26":[3,3],"27":[3],"28":[15,7]}} -,"/Users/zane/playground/liquid-labs/semver-plus/src/semver-comparison-ops.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/semver-comparison-ops.mjs","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":13,"column":15},"end":{"line":13,"column":27}},"2":{"start":{"line":25,"column":16},"end":{"line":25,"column":29}},"3":{"start":{"line":37,"column":15},"end":{"line":37,"column":27}},"4":{"start":{"line":49,"column":16},"end":{"line":49,"column":29}},"5":{"start":{"line":61,"column":15},"end":{"line":61,"column":27}},"6":{"start":{"line":73,"column":16},"end":{"line":73,"column":29}},"7":{"start":{"line":87,"column":16},"end":{"line":87,"column":29}},"8":{"start":{"line":100,"column":20},"end":{"line":100,"column":37}},"9":{"start":{"line":112,"column":25},"end":{"line":112,"column":47}},"10":{"start":{"line":124,"column":21},"end":{"line":124,"column":39}},"11":{"start":{"line":134,"column":25},"end":{"line":134,"column":47}},"12":{"start":{"line":148,"column":17},"end":{"line":148,"column":31}},"13":{"start":{"line":159,"column":17},"end":{"line":159,"column":31}},"14":{"start":{"line":170,"column":18},"end":{"line":170,"column":33}}},"fnMap":{},"branchMap":{},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1},"f":{},"b":{}} -,"/Users/zane/playground/liquid-labs/semver-plus/src/semver-range-ops.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/semver-range-ops.mjs","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":16,"column":23},"end":{"line":16,"column":43}},"2":{"start":{"line":28,"column":22},"end":{"line":28,"column":41}},"3":{"start":{"line":40,"column":26},"end":{"line":40,"column":49}},"4":{"start":{"line":52,"column":16},"end":{"line":52,"column":29}},"5":{"start":{"line":64,"column":16},"end":{"line":64,"column":29}},"6":{"start":{"line":78,"column":20},"end":{"line":78,"column":37}},"7":{"start":{"line":89,"column":23},"end":{"line":89,"column":43}},"8":{"start":{"line":105,"column":26},"end":{"line":105,"column":49}},"9":{"start":{"line":117,"column":19},"end":{"line":117,"column":35}}},"fnMap":{},"branchMap":{},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1},"f":{},"b":{}} -,"/Users/zane/playground/liquid-labs/semver-plus/src/semver-version-ops.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/semver-version-ops.mjs","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":13,"column":18},"end":{"line":13,"column":33}},"2":{"start":{"line":29,"column":16},"end":{"line":29,"column":29}},"3":{"start":{"line":41,"column":23},"end":{"line":41,"column":43}},"4":{"start":{"line":52,"column":18},"end":{"line":52,"column":33}},"5":{"start":{"line":63,"column":18},"end":{"line":63,"column":33}},"6":{"start":{"line":74,"column":18},"end":{"line":74,"column":33}},"7":{"start":{"line":81,"column":18},"end":{"line":81,"column":33}},"8":{"start":{"line":97,"column":19},"end":{"line":97,"column":35}},"9":{"start":{"line":109,"column":18},"end":{"line":109,"column":33}}},"fnMap":{},"branchMap":{},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1},"f":{},"b":{}} -,"/Users/zane/playground/liquid-labs/semver-plus/src/upper-bound.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/upper-bound.mjs","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":11,"column":19},"end":{"line":21,"column":1}},"2":{"start":{"line":12,"column":26},"end":{"line":12,"column":50}},"3":{"start":{"line":13,"column":2},"end":{"line":15,"column":null}},"4":{"start":{"line":14,"column":4},"end":{"line":14,"column":null}},"5":{"start":{"line":17,"column":17},"end":{"line":17,"column":43}},"6":{"start":{"line":18,"column":21},"end":{"line":18,"column":46}},"7":{"start":{"line":20,"column":2},"end":{"line":20,"column":null}},"8":{"start":{"line":21,"column":1},"end":{"line":21,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":11,"column":19},"end":{"line":11,"column":20}},"loc":{"start":{"line":11,"column":63},"end":{"line":21,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":11,"column":27},"end":{"line":11,"column":58}},"type":"default-arg","locations":[{"start":{"line":11,"column":56},"end":{"line":11,"column":58}}]},"1":{"loc":{"start":{"line":11,"column":29},"end":{"line":11,"column":52}},"type":"default-arg","locations":[{"start":{"line":11,"column":46},"end":{"line":11,"column":52}}]},"2":{"loc":{"start":{"line":13,"column":2},"end":{"line":15,"column":null}},"type":"if","locations":[{"start":{"line":13,"column":2},"end":{"line":15,"column":null}}]},"3":{"loc":{"start":{"line":20,"column":9},"end":{"line":20,"column":100}},"type":"cond-expr","locations":[{"start":{"line":20,"column":35},"end":{"line":20,"column":68}},{"start":{"line":20,"column":71},"end":{"line":20,"column":100}}]}},"s":{"0":2,"1":2,"2":47,"3":47,"4":0,"5":47,"6":47,"7":47,"8":2},"f":{"0":47},"b":{"0":[7],"1":[7],"2":[0],"3":[40,7]}} -,"/Users/zane/playground/liquid-labs/semver-plus/src/valid-version-or-range.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/valid-version-or-range.mjs","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":null}},"2":{"start":{"line":20,"column":28},"end":{"line":59,"column":1}},"3":{"start":{"line":20,"column":34},"end":{"line":20,"column":43}},"4":{"start":{"line":27,"column":2},"end":{"line":29,"column":null}},"5":{"start":{"line":28,"column":4},"end":{"line":28,"column":null}},"6":{"start":{"line":30,"column":2},"end":{"line":32,"column":null}},"7":{"start":{"line":31,"column":4},"end":{"line":31,"column":null}},"8":{"start":{"line":34,"column":19},"end":{"line":34,"column":109}},"9":{"start":{"line":36,"column":2},"end":{"line":41,"column":null}},"10":{"start":{"line":37,"column":4},"end":{"line":39,"column":null}},"11":{"start":{"line":38,"column":6},"end":{"line":38,"column":null}},"12":{"start":{"line":40,"column":4},"end":{"line":40,"column":null}},"13":{"start":{"line":43,"column":2},"end":{"line":48,"column":null}},"14":{"start":{"line":44,"column":4},"end":{"line":46,"column":null}},"15":{"start":{"line":45,"column":6},"end":{"line":45,"column":null}},"16":{"start":{"line":47,"column":4},"end":{"line":47,"column":null}},"17":{"start":{"line":50,"column":2},"end":{"line":56,"column":null}},"18":{"start":{"line":51,"column":17},"end":{"line":54,"column":71}},"19":{"start":{"line":55,"column":4},"end":{"line":55,"column":null}},"20":{"start":{"line":58,"column":2},"end":{"line":58,"column":null}},"21":{"start":{"line":59,"column":1},"end":{"line":59,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":20,"column":28},"end":{"line":20,"column":29}},"loc":{"start":{"line":26,"column":11},"end":{"line":59,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":20,"column":34},"end":{"line":20,"column":43}},"loc":{"start":{"line":20,"column":34},"end":{"line":20,"column":43}}}},"branchMap":{"0":{"loc":{"start":{"line":20,"column":29},"end":{"line":20,"column":78}},"type":"default-arg","locations":[{"start":{"line":20,"column":34},"end":{"line":20,"column":78}}]},"1":{"loc":{"start":{"line":20,"column":78},"end":{"line":26,"column":6}},"type":"default-arg","locations":[{"start":{"line":26,"column":4},"end":{"line":26,"column":6}}]},"2":{"loc":{"start":{"line":21,"column":2},"end":{"line":21,"column":24}},"type":"default-arg","locations":[{"start":{"line":21,"column":19},"end":{"line":21,"column":24}}]},"3":{"loc":{"start":{"line":22,"column":2},"end":{"line":22,"column":26}},"type":"default-arg","locations":[{"start":{"line":22,"column":21},"end":{"line":22,"column":26}}]},"4":{"loc":{"start":{"line":23,"column":2},"end":{"line":23,"column":20}},"type":"default-arg","locations":[{"start":{"line":23,"column":15},"end":{"line":23,"column":20}}]},"5":{"loc":{"start":{"line":24,"column":2},"end":{"line":24,"column":24}},"type":"default-arg","locations":[{"start":{"line":24,"column":19},"end":{"line":24,"column":24}}]},"6":{"loc":{"start":{"line":27,"column":2},"end":{"line":29,"column":null}},"type":"if","locations":[{"start":{"line":27,"column":2},"end":{"line":29,"column":null}}]},"7":{"loc":{"start":{"line":27,"column":6},"end":{"line":27,"column":58}},"type":"binary-expr","locations":[{"start":{"line":27,"column":6},"end":{"line":27,"column":31}},{"start":{"line":27,"column":35},"end":{"line":27,"column":58}}]},"8":{"loc":{"start":{"line":30,"column":2},"end":{"line":32,"column":null}},"type":"if","locations":[{"start":{"line":30,"column":2},"end":{"line":32,"column":null}}]},"9":{"loc":{"start":{"line":30,"column":6},"end":{"line":30,"column":52}},"type":"binary-expr","locations":[{"start":{"line":30,"column":6},"end":{"line":30,"column":29}},{"start":{"line":30,"column":33},"end":{"line":30,"column":52}}]},"10":{"loc":{"start":{"line":34,"column":19},"end":{"line":34,"column":109}},"type":"cond-expr","locations":[{"start":{"line":34,"column":45},"end":{"line":34,"column":73}},{"start":{"line":34,"column":76},"end":{"line":34,"column":109}}]},"11":{"loc":{"start":{"line":36,"column":2},"end":{"line":41,"column":null}},"type":"if","locations":[{"start":{"line":36,"column":2},"end":{"line":41,"column":null}}]},"12":{"loc":{"start":{"line":36,"column":6},"end":{"line":36,"column":82}},"type":"binary-expr","locations":[{"start":{"line":36,"column":6},"end":{"line":36,"column":25}},{"start":{"line":36,"column":29},"end":{"line":36,"column":48}},{"start":{"line":36,"column":52},"end":{"line":36,"column":82}}]},"13":{"loc":{"start":{"line":37,"column":4},"end":{"line":39,"column":null}},"type":"if","locations":[{"start":{"line":37,"column":4},"end":{"line":39,"column":null}}]},"14":{"loc":{"start":{"line":43,"column":2},"end":{"line":48,"column":null}},"type":"if","locations":[{"start":{"line":43,"column":2},"end":{"line":48,"column":null}}]},"15":{"loc":{"start":{"line":43,"column":6},"end":{"line":43,"column":72}},"type":"binary-expr","locations":[{"start":{"line":43,"column":6},"end":{"line":43,"column":31}},{"start":{"line":43,"column":35},"end":{"line":43,"column":72}}]},"16":{"loc":{"start":{"line":44,"column":4},"end":{"line":46,"column":null}},"type":"if","locations":[{"start":{"line":44,"column":4},"end":{"line":46,"column":null}}]},"17":{"loc":{"start":{"line":50,"column":2},"end":{"line":56,"column":null}},"type":"if","locations":[{"start":{"line":50,"column":2},"end":{"line":56,"column":null}}]},"18":{"loc":{"start":{"line":50,"column":6},"end":{"line":50,"column":52}},"type":"binary-expr","locations":[{"start":{"line":50,"column":6},"end":{"line":50,"column":25}},{"start":{"line":50,"column":29},"end":{"line":50,"column":52}}]},"19":{"loc":{"start":{"line":52,"column":11},"end":{"line":54,"column":69}},"type":"cond-expr","locations":[{"start":{"line":53,"column":10},"end":{"line":53,"column":39}},{"start":{"line":54,"column":11},"end":{"line":54,"column":69}}]},"20":{"loc":{"start":{"line":54,"column":11},"end":{"line":54,"column":69}},"type":"cond-expr","locations":[{"start":{"line":54,"column":37},"end":{"line":54,"column":46}},{"start":{"line":54,"column":49},"end":{"line":54,"column":69}}]}},"s":{"0":2,"1":2,"2":2,"3":0,"4":15,"5":1,"6":14,"7":0,"8":14,"9":14,"10":0,"11":0,"12":0,"13":14,"14":2,"15":1,"16":1,"17":13,"18":4,"19":4,"20":9,"21":2},"f":{"0":15,"1":0},"b":{"0":[0],"1":[6],"2":[11],"3":[12],"4":[14],"5":[10],"6":[1],"7":[15,3],"8":[0],"9":[14,3],"10":[3,11],"11":[0],"12":[14,7,1],"13":[0],"14":[2],"15":[14,2],"16":[1],"17":[4],"18":[13,8],"19":[0,4],"20":[2,2]}} -,"/Users/zane/playground/liquid-labs/semver-plus/src/x-sort.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/x-sort.mjs","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":null}},"2":{"start":{"line":4,"column":0},"end":{"line":4,"column":null}},"3":{"start":{"line":12,"column":15},"end":{"line":109,"column":1}},"4":{"start":{"line":14,"column":19},"end":{"line":14,"column":21}},"5":{"start":{"line":15,"column":17},"end":{"line":15,"column":19}},"6":{"start":{"line":18,"column":2},"end":{"line":18,"column":null}},"7":{"start":{"line":18,"column":60},"end":{"line":18,"column":78}},"8":{"start":{"line":20,"column":2},"end":{"line":39,"column":null}},"9":{"start":{"line":21,"column":4},"end":{"line":38,"column":null}},"10":{"start":{"line":22,"column":6},"end":{"line":22,"column":null}},"11":{"start":{"line":25,"column":22},"end":{"line":25,"column":50}},"12":{"start":{"line":26,"column":6},"end":{"line":37,"column":null}},"13":{"start":{"line":27,"column":8},"end":{"line":27,"column":null}},"14":{"start":{"line":30,"column":22},"end":{"line":30,"column":55}},"15":{"start":{"line":31,"column":8},"end":{"line":36,"column":null}},"16":{"start":{"line":32,"column":10},"end":{"line":32,"column":null}},"17":{"start":{"line":35,"column":10},"end":{"line":35,"column":null}},"18":{"start":{"line":41,"column":25},"end":{"line":41,"column":54}},"19":{"start":{"line":43,"column":23},"end":{"line":65,"column":4}},"20":{"start":{"line":44,"column":23},"end":{"line":44,"column":63}},"21":{"start":{"line":45,"column":23},"end":{"line":45,"column":63}},"22":{"start":{"line":47,"column":4},"end":{"line":64,"column":null}},"23":{"start":{"line":48,"column":6},"end":{"line":48,"column":null}},"24":{"start":{"line":50,"column":9},"end":{"line":64,"column":null}},"25":{"start":{"line":51,"column":6},"end":{"line":51,"column":null}},"26":{"start":{"line":53,"column":9},"end":{"line":64,"column":null}},"27":{"start":{"line":54,"column":6},"end":{"line":54,"column":null}},"28":{"start":{"line":56,"column":9},"end":{"line":64,"column":null}},"29":{"start":{"line":57,"column":6},"end":{"line":57,"column":null}},"30":{"start":{"line":59,"column":9},"end":{"line":64,"column":null}},"31":{"start":{"line":60,"column":6},"end":{"line":60,"column":null}},"32":{"start":{"line":63,"column":6},"end":{"line":63,"column":null}},"33":{"start":{"line":67,"column":2},"end":{"line":72,"column":null}},"34":{"start":{"line":68,"column":4},"end":{"line":68,"column":null}},"35":{"start":{"line":70,"column":7},"end":{"line":72,"column":null}},"36":{"start":{"line":71,"column":4},"end":{"line":71,"column":null}},"37":{"start":{"line":74,"column":20},"end":{"line":74,"column":33}},"38":{"start":{"line":76,"column":25},"end":{"line":76,"column":30}},"39":{"start":{"line":77,"column":2},"end":{"line":106,"column":null}},"40":{"start":{"line":78,"column":4},"end":{"line":81,"column":null}},"41":{"start":{"line":79,"column":6},"end":{"line":79,"column":null}},"42":{"start":{"line":80,"column":6},"end":{"line":80,"column":null}},"43":{"start":{"line":83,"column":24},"end":{"line":83,"column":67}},"44":{"start":{"line":84,"column":4},"end":{"line":105,"column":null}},"45":{"start":{"line":85,"column":33},"end":{"line":85,"column":63}},"46":{"start":{"line":89,"column":32},"end":{"line":89,"column":111}},"47":{"start":{"line":89,"column":92},"end":{"line":89,"column":110}},"48":{"start":{"line":90,"column":6},"end":{"line":96,"column":null}},"49":{"start":{"line":91,"column":8},"end":{"line":91,"column":null}},"50":{"start":{"line":92,"column":8},"end":{"line":92,"column":null}},"51":{"start":{"line":95,"column":8},"end":{"line":95,"column":null}},"52":{"start":{"line":98,"column":9},"end":{"line":105,"column":null}},"53":{"start":{"line":99,"column":33},"end":{"line":99,"column":69}},"54":{"start":{"line":100,"column":6},"end":{"line":100,"column":null}},"55":{"start":{"line":102,"column":9},"end":{"line":105,"column":null}},"56":{"start":{"line":103,"column":6},"end":{"line":103,"column":null}},"57":{"start":{"line":104,"column":6},"end":{"line":104,"column":null}},"58":{"start":{"line":108,"column":2},"end":{"line":108,"column":null}},"59":{"start":{"line":109,"column":1},"end":{"line":109,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":12,"column":15},"end":{"line":12,"column":32}},"loc":{"start":{"line":12,"column":37},"end":{"line":109,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":18,"column":47},"end":{"line":18,"column":48}},"loc":{"start":{"line":18,"column":60},"end":{"line":18,"column":78}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":43,"column":35},"end":{"line":43,"column":36}},"loc":{"start":{"line":43,"column":45},"end":{"line":65,"column":3}}},"3":{"name":"(anonymous_3)","decl":{"start":{"line":89,"column":83},"end":{"line":89,"column":87}},"loc":{"start":{"line":89,"column":92},"end":{"line":89,"column":110}}}},"branchMap":{"0":{"loc":{"start":{"line":21,"column":4},"end":{"line":38,"column":null}},"type":"if","locations":[{"start":{"line":21,"column":4},"end":{"line":38,"column":null}},{"start":{"line":24,"column":9},"end":{"line":38,"column":null}}]},"1":{"loc":{"start":{"line":26,"column":6},"end":{"line":37,"column":null}},"type":"if","locations":[{"start":{"line":26,"column":6},"end":{"line":37,"column":null}},{"start":{"line":29,"column":11},"end":{"line":37,"column":null}}]},"2":{"loc":{"start":{"line":31,"column":8},"end":{"line":36,"column":null}},"type":"if","locations":[{"start":{"line":31,"column":8},"end":{"line":36,"column":null}},{"start":{"line":34,"column":13},"end":{"line":36,"column":null}}]},"3":{"loc":{"start":{"line":47,"column":4},"end":{"line":64,"column":null}},"type":"if","locations":[{"start":{"line":47,"column":4},"end":{"line":64,"column":null}},{"start":{"line":50,"column":9},"end":{"line":64,"column":null}}]},"4":{"loc":{"start":{"line":50,"column":9},"end":{"line":64,"column":null}},"type":"if","locations":[{"start":{"line":50,"column":9},"end":{"line":64,"column":null}},{"start":{"line":53,"column":9},"end":{"line":64,"column":null}}]},"5":{"loc":{"start":{"line":53,"column":9},"end":{"line":64,"column":null}},"type":"if","locations":[{"start":{"line":53,"column":9},"end":{"line":64,"column":null}},{"start":{"line":56,"column":9},"end":{"line":64,"column":null}}]},"6":{"loc":{"start":{"line":53,"column":13},"end":{"line":53,"column":55}},"type":"binary-expr","locations":[{"start":{"line":53,"column":13},"end":{"line":53,"column":32}},{"start":{"line":53,"column":36},"end":{"line":53,"column":55}}]},"7":{"loc":{"start":{"line":56,"column":9},"end":{"line":64,"column":null}},"type":"if","locations":[{"start":{"line":56,"column":9},"end":{"line":64,"column":null}},{"start":{"line":59,"column":9},"end":{"line":64,"column":null}}]},"8":{"loc":{"start":{"line":59,"column":9},"end":{"line":64,"column":null}},"type":"if","locations":[{"start":{"line":59,"column":9},"end":{"line":64,"column":null}},{"start":{"line":62,"column":9},"end":{"line":64,"column":null}}]},"9":{"loc":{"start":{"line":67,"column":2},"end":{"line":72,"column":null}},"type":"if","locations":[{"start":{"line":67,"column":2},"end":{"line":72,"column":null}},{"start":{"line":70,"column":7},"end":{"line":72,"column":null}}]},"10":{"loc":{"start":{"line":70,"column":7},"end":{"line":72,"column":null}},"type":"if","locations":[{"start":{"line":70,"column":7},"end":{"line":72,"column":null}}]},"11":{"loc":{"start":{"line":78,"column":4},"end":{"line":81,"column":null}},"type":"if","locations":[{"start":{"line":78,"column":4},"end":{"line":81,"column":null}}]},"12":{"loc":{"start":{"line":84,"column":4},"end":{"line":105,"column":null}},"type":"if","locations":[{"start":{"line":84,"column":4},"end":{"line":105,"column":null}},{"start":{"line":98,"column":9},"end":{"line":105,"column":null}}]},"13":{"loc":{"start":{"line":90,"column":6},"end":{"line":96,"column":null}},"type":"if","locations":[{"start":{"line":90,"column":6},"end":{"line":96,"column":null}},{"start":{"line":94,"column":11},"end":{"line":96,"column":null}}]},"14":{"loc":{"start":{"line":98,"column":9},"end":{"line":105,"column":null}},"type":"if","locations":[{"start":{"line":98,"column":9},"end":{"line":105,"column":null}},{"start":{"line":102,"column":9},"end":{"line":105,"column":null}}]},"15":{"loc":{"start":{"line":102,"column":9},"end":{"line":105,"column":null}},"type":"if","locations":[{"start":{"line":102,"column":9},"end":{"line":105,"column":null}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":16,"5":16,"6":16,"7":47,"8":16,"9":47,"10":26,"11":21,"12":21,"13":21,"14":0,"15":0,"16":0,"17":0,"18":16,"19":16,"20":20,"21":20,"22":20,"23":0,"24":20,"25":7,"26":13,"27":0,"28":13,"29":0,"30":13,"31":0,"32":13,"33":16,"34":3,"35":13,"36":4,"37":9,"38":9,"39":9,"40":19,"41":9,"42":9,"43":10,"44":10,"45":8,"46":8,"47":1,"48":8,"49":7,"50":7,"51":1,"52":2,"53":1,"54":1,"55":1,"56":1,"57":1,"58":9,"59":1},"f":{"0":16,"1":47,"2":20,"3":1},"b":{"0":[26,21],"1":[21,0],"2":[0,0],"3":[0,20],"4":[7,13],"5":[0,13],"6":[13,0],"7":[0,13],"8":[0,13],"9":[3,13],"10":[4],"11":[9],"12":[8,2],"13":[7,1],"14":[1,1],"15":[1]}} -,"/Users/zane/playground/liquid-labs/semver-plus/src/lib/compare-helper.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/lib/compare-helper.mjs","statementMap":{"0":{"start":{"line":1,"column":22},"end":{"line":14,"column":1}},"1":{"start":{"line":3,"column":2},"end":{"line":11,"column":null}},"2":{"start":{"line":3,"column":15},"end":{"line":3,"column":16}},"3":{"start":{"line":4,"column":20},"end":{"line":4,"column":31}},"4":{"start":{"line":5,"column":4},"end":{"line":10,"column":null}},"5":{"start":{"line":6,"column":6},"end":{"line":6,"column":null}},"6":{"start":{"line":8,"column":9},"end":{"line":10,"column":null}},"7":{"start":{"line":9,"column":6},"end":{"line":9,"column":null}},"8":{"start":{"line":13,"column":2},"end":{"line":13,"column":null}},"9":{"start":{"line":14,"column":1},"end":{"line":14,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":1,"column":22},"end":{"line":1,"column":23}},"loc":{"start":{"line":1,"column":48},"end":{"line":14,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":5,"column":4},"end":{"line":10,"column":null}},"type":"if","locations":[{"start":{"line":5,"column":4},"end":{"line":10,"column":null}},{"start":{"line":8,"column":9},"end":{"line":10,"column":null}}]},"1":{"loc":{"start":{"line":8,"column":9},"end":{"line":10,"column":null}},"type":"if","locations":[{"start":{"line":8,"column":9},"end":{"line":10,"column":null}}]}},"s":{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0},"f":{"0":0},"b":{"0":[0,0],"1":[0]}} -,"/Users/zane/playground/liquid-labs/semver-plus/src/lib/set-default-options.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/lib/set-default-options.mjs","statementMap":{"0":{"start":{"line":1,"column":26},"end":{"line":10,"column":1}},"1":{"start":{"line":2,"column":2},"end":{"line":7,"column":null}},"2":{"start":{"line":6,"column":4},"end":{"line":6,"column":null}},"3":{"start":{"line":9,"column":2},"end":{"line":9,"column":null}},"4":{"start":{"line":10,"column":1},"end":{"line":10,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":1,"column":26},"end":{"line":1,"column":27}},"loc":{"start":{"line":1,"column":44},"end":{"line":10,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":39}},"type":"default-arg","locations":[{"start":{"line":1,"column":37},"end":{"line":1,"column":39}}]},"1":{"loc":{"start":{"line":2,"column":2},"end":{"line":7,"column":null}},"type":"if","locations":[{"start":{"line":2,"column":2},"end":{"line":7,"column":null}}]},"2":{"loc":{"start":{"line":2,"column":6},"end":{"line":5,"column":54}},"type":"binary-expr","locations":[{"start":{"line":2,"column":6},"end":{"line":2,"column":39}},{"start":{"line":3,"column":12},"end":{"line":3,"column":56}},{"start":{"line":4,"column":15},"end":{"line":4,"column":77}},{"start":{"line":5,"column":15},"end":{"line":5,"column":53}}]}},"s":{"0":0,"1":0,"2":0,"3":0,"4":0},"f":{"0":0},"b":{"0":[0],"1":[0],"2":[0,0,0,0]}} -} diff --git a/qa/coverage/favicon.png b/qa/coverage/favicon.png deleted file mode 100644 index c1525b811a167671e9de1fa78aab9f5c0b61cef7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 445 zcmV;u0Yd(XP))rP{nL}Ln%S7`m{0DjX9TLF* zFCb$4Oi7vyLOydb!7n&^ItCzb-%BoB`=x@N2jll2Nj`kauio%aw_@fe&*}LqlFT43 z8doAAe))z_%=P%v^@JHp3Hjhj^6*Kr_h|g_Gr?ZAa&y>wxHE99Gk>A)2MplWz2xdG zy8VD2J|Uf#EAw*bo5O*PO_}X2Tob{%bUoO2G~T`@%S6qPyc}VkhV}UifBuRk>%5v( z)x7B{I~z*k<7dv#5tC+m{km(D087J4O%+<<;K|qwefb6@GSX45wCK}Sn*> - - - - Code coverage report for All files - - - - - - - - - -
-
-

All files

-
- -
- 86.42% - Statements - 191/221 -
- - -
- 82.39% - Branches - 117/142 -
- - -
- 75% - Functions - 9/12 -
- - -
- 86.97% - Lines - 187/215 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
src -
-
92.71%191/20687.96%117/13390%9/1093.03%187/201
src/lib -
-
0%0/150%0/90%0/20%0/14
-
-
-
- - - - - - - - \ No newline at end of file diff --git a/qa/coverage/prettify.css b/qa/coverage/prettify.css deleted file mode 100644 index b317a7c..0000000 --- a/qa/coverage/prettify.css +++ /dev/null @@ -1 +0,0 @@ -.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/qa/coverage/prettify.js b/qa/coverage/prettify.js deleted file mode 100644 index b322523..0000000 --- a/qa/coverage/prettify.js +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/qa/coverage/sort-arrow-sprite.png b/qa/coverage/sort-arrow-sprite.png deleted file mode 100644 index 6ed68316eb3f65dec9063332d2f69bf3093bbfab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 138 zcmeAS@N?(olHy`uVBq!ia0vp^>_9Bd!3HEZxJ@+%Qh}Z>jv*C{$p!i!8j}?a+@3A= zIAGwzjijN=FBi!|L1t?LM;Q;gkwn>2cAy-KV{dn nf0J1DIvEHQu*n~6U}x}qyky7vi4|9XhBJ7&`njxgN@xNA8m%nc diff --git a/qa/coverage/sorter.js b/qa/coverage/sorter.js deleted file mode 100644 index 2bb296a..0000000 --- a/qa/coverage/sorter.js +++ /dev/null @@ -1,196 +0,0 @@ -/* eslint-disable */ -var addSorting = (function() { - 'use strict'; - var cols, - currentSort = { - index: 0, - desc: false - }; - - // returns the summary table element - function getTable() { - return document.querySelector('.coverage-summary'); - } - // returns the thead element of the summary table - function getTableHeader() { - return getTable().querySelector('thead tr'); - } - // returns the tbody element of the summary table - function getTableBody() { - return getTable().querySelector('tbody'); - } - // returns the th element for nth column - function getNthColumn(n) { - return getTableHeader().querySelectorAll('th')[n]; - } - - function onFilterInput() { - const searchValue = document.getElementById('fileSearch').value; - const rows = document.getElementsByTagName('tbody')[0].children; - for (let i = 0; i < rows.length; i++) { - const row = rows[i]; - if ( - row.textContent - .toLowerCase() - .includes(searchValue.toLowerCase()) - ) { - row.style.display = ''; - } else { - row.style.display = 'none'; - } - } - } - - // loads the search box - function addSearchBox() { - var template = document.getElementById('filterTemplate'); - var templateClone = template.content.cloneNode(true); - templateClone.getElementById('fileSearch').oninput = onFilterInput; - template.parentElement.appendChild(templateClone); - } - - // loads all columns - function loadColumns() { - var colNodes = getTableHeader().querySelectorAll('th'), - colNode, - cols = [], - col, - i; - - for (i = 0; i < colNodes.length; i += 1) { - colNode = colNodes[i]; - col = { - key: colNode.getAttribute('data-col'), - sortable: !colNode.getAttribute('data-nosort'), - type: colNode.getAttribute('data-type') || 'string' - }; - cols.push(col); - if (col.sortable) { - col.defaultDescSort = col.type === 'number'; - colNode.innerHTML = - colNode.innerHTML + ''; - } - } - return cols; - } - // attaches a data attribute to every tr element with an object - // of data values keyed by column name - function loadRowData(tableRow) { - var tableCols = tableRow.querySelectorAll('td'), - colNode, - col, - data = {}, - i, - val; - for (i = 0; i < tableCols.length; i += 1) { - colNode = tableCols[i]; - col = cols[i]; - val = colNode.getAttribute('data-value'); - if (col.type === 'number') { - val = Number(val); - } - data[col.key] = val; - } - return data; - } - // loads all row data - function loadData() { - var rows = getTableBody().querySelectorAll('tr'), - i; - - for (i = 0; i < rows.length; i += 1) { - rows[i].data = loadRowData(rows[i]); - } - } - // sorts the table using the data for the ith column - function sortByIndex(index, desc) { - var key = cols[index].key, - sorter = function(a, b) { - a = a.data[key]; - b = b.data[key]; - return a < b ? -1 : a > b ? 1 : 0; - }, - finalSorter = sorter, - tableBody = document.querySelector('.coverage-summary tbody'), - rowNodes = tableBody.querySelectorAll('tr'), - rows = [], - i; - - if (desc) { - finalSorter = function(a, b) { - return -1 * sorter(a, b); - }; - } - - for (i = 0; i < rowNodes.length; i += 1) { - rows.push(rowNodes[i]); - tableBody.removeChild(rowNodes[i]); - } - - rows.sort(finalSorter); - - for (i = 0; i < rows.length; i += 1) { - tableBody.appendChild(rows[i]); - } - } - // removes sort indicators for current column being sorted - function removeSortIndicators() { - var col = getNthColumn(currentSort.index), - cls = col.className; - - cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); - col.className = cls; - } - // adds sort indicators for current column being sorted - function addSortIndicators() { - getNthColumn(currentSort.index).className += currentSort.desc - ? ' sorted-desc' - : ' sorted'; - } - // adds event listeners for all sorter widgets - function enableUI() { - var i, - el, - ithSorter = function ithSorter(i) { - var col = cols[i]; - - return function() { - var desc = col.defaultDescSort; - - if (currentSort.index === i) { - desc = !currentSort.desc; - } - sortByIndex(i, desc); - removeSortIndicators(); - currentSort.index = i; - currentSort.desc = desc; - addSortIndicators(); - }; - }; - for (i = 0; i < cols.length; i += 1) { - if (cols[i].sortable) { - // add the click event handler on the th so users - // dont have to click on those tiny arrows - el = getNthColumn(i).querySelector('.sorter').parentElement; - if (el.addEventListener) { - el.addEventListener('click', ithSorter(i)); - } else { - el.attachEvent('onclick', ithSorter(i)); - } - } - } - } - // adds sorting functionality to the UI - return function() { - if (!getTable()) { - return; - } - cols = loadColumns(); - loadData(); - addSearchBox(); - addSortIndicators(); - enableUI(); - }; -})(); - -window.addEventListener('load', addSorting); diff --git a/qa/coverage/src/constants.mjs.html b/qa/coverage/src/constants.mjs.html deleted file mode 100644 index 3edf2ee..0000000 --- a/qa/coverage/src/constants.mjs.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - Code coverage report for src/constants.mjs - - - - - - - - - -
-
-

All files / src constants.mjs

-
- -
- 100% - Statements - 2/2 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 2/2 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -64x -  -  -  -4x - 
export const xRangeRE =
-  //  v single tuple  v doublpe tuple             v triple tuple            v quad/pre-release tuple
-  //          v if there's more than a single digit, it can't lead with a zero
-  /^(?:[Xx*]|[1-9]?[0-9]+\.[Xx*]|(?:[1-9]?[0-9]+\.){2}[Xx*]|(?:[1-9]?[0-9]+\.){2}[1-9]?[0-9]+-(?:alpha|beta|rc)\.[Xx*])$/
-export const prereleaseXRangeRE = /^(?:[1-9]?[0-9]+\.){2}[1-9]?[0-9]+-(?:alpha|beta|rc)\.[Xx*]$/
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/qa/coverage/src/ext-constants.mjs.html b/qa/coverage/src/ext-constants.mjs.html deleted file mode 100644 index b510b73..0000000 --- a/qa/coverage/src/ext-constants.mjs.html +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - Code coverage report for src/ext-constants.mjs - - - - - - - - - -
-
-

All files / src ext-constants.mjs

-
- -
- 100% - Statements - 8/8 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 8/8 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -241x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -1x -1x -  -1x -1x -1x -1x - 
export const STANDARD_INCREMENTS = [
-  'major',
-  'minor',
-  'patch',
-  'premajor',
-  'preminor',
-  'prepatch',
-  'prerelease',
-  'pretype',
-  'alpha',
-  'beta',
-  'rc',
-  'gold'
-]
- 
-export const STANDARD_PRERELEASE_INCREMENTS = ['prerelease', 'pretype', 'alpha', 'beta', 'rc', 'gold']
-export const STANDARD_PRERELEASE_NAMES = ['alpha', 'beta', 'rc']
-export const STANDARD_RELEASE_NAMES = [...STANDARD_PRERELEASE_NAMES, 'gold']
- 
-Object.freeze(STANDARD_PRERELEASE_INCREMENTS)
-Object.freeze(STANDARD_PRERELEASE_NAMES)
-Object.freeze(STANDARD_RELEASE_NAMES)
-Object.freeze(STANDARD_INCREMENTS)
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/qa/coverage/src/index.html b/qa/coverage/src/index.html deleted file mode 100644 index 2a46264..0000000 --- a/qa/coverage/src/index.html +++ /dev/null @@ -1,266 +0,0 @@ - - - - - - Code coverage report for src - - - - - - - - - -
-
-

All files src

-
- -
- 92.71% - Statements - 191/206 -
- - -
- 87.96% - Branches - 117/133 -
- - -
- 90% - Functions - 9/10 -
- - -
- 93.03% - Lines - 187/201 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
constants.mjs -
-
100%2/2100%0/0100%0/0100%2/2
ext-constants.mjs -
-
100%8/8100%0/0100%0/0100%8/8
max-satisfying.mjs -
-
93.75%15/16100%11/11100%1/193.75%15/16
min-version.mjs -
-
100%7/785.71%6/7100%1/1100%7/7
next-version.mjs -
-
100%47/4798.03%50/51100%1/1100%45/45
semver-comparison-ops.mjs -
-
100%15/15100%0/0100%0/0100%15/15
semver-range-ops.mjs -
-
100%10/10100%0/0100%0/0100%10/10
semver-version-ops.mjs -
-
100%10/10100%0/0100%0/0100%10/10
upper-bound.mjs -
-
88.88%8/980%4/5100%1/188.88%8/9
valid-version-or-range.mjs -
-
77.27%17/2283.33%25/3050%1/280.95%17/21
x-sort.mjs -
-
86.66%52/6072.41%21/29100%4/486.2%50/58
-
-
-
- - - - - - - - \ No newline at end of file diff --git a/qa/coverage/src/lib/compare-helper.mjs.html b/qa/coverage/src/lib/compare-helper.mjs.html deleted file mode 100644 index 5b95606..0000000 --- a/qa/coverage/src/lib/compare-helper.mjs.html +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - Code coverage report for src/lib/compare-helper.mjs - - - - - - - - - -
-
-

All files / src/lib compare-helper.mjs

-
- -
- 0% - Statements - 0/10 -
- - -
- 0% - Branches - 0/3 -
- - -
- 0% - Functions - 0/1 -
- - -
- 0% - Lines - 0/9 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
const compareHelper = (versions, semverTest) => {
-  let currLead
-  for (let i = 0; i < versions.length; i += 1) {
-    const testVer = versions[i]
-    if (currLead === undefined) {
-      currLead = testVer
-    }
-    else Iif (semverTest(currLead, testVer)) {
-      currLead = testVer
-    }
-  }
- 
-  return currLead
-}
- 
-export { compareHelper }
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/qa/coverage/src/lib/index.html b/qa/coverage/src/lib/index.html deleted file mode 100644 index 9e83eb1..0000000 --- a/qa/coverage/src/lib/index.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - Code coverage report for src/lib - - - - - - - - - -
-
-

All files src/lib

-
- -
- 0% - Statements - 0/15 -
- - -
- 0% - Branches - 0/9 -
- - -
- 0% - Functions - 0/2 -
- - -
- 0% - Lines - 0/14 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
compare-helper.mjs -
-
0%0/100%0/30%0/10%0/9
set-default-options.mjs -
-
0%0/50%0/60%0/10%0/5
-
-
-
- - - - - - - - \ No newline at end of file diff --git a/qa/coverage/src/lib/set-default-options.mjs.html b/qa/coverage/src/lib/set-default-options.mjs.html deleted file mode 100644 index cc62778..0000000 --- a/qa/coverage/src/lib/set-default-options.mjs.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - Code coverage report for src/lib/set-default-options.mjs - - - - - - - - - -
-
-

All files / src/lib set-default-options.mjs

-
- -
- 0% - Statements - 0/5 -
- - -
- 0% - Branches - 0/6 -
- - -
- 0% - Functions - 0/1 -
- - -
- 0% - Lines - 0/5 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13  -  -  -  -  -  -  -  -  -  -  -  - 
const setDefaultOptions = (options = {}) => {
-  Iif (!('includePrerelease' in options)
-        && (process.env.SEMVER_PLUS_COMPAT === undefined
-            || process.env.SEMVER_PLUS_COMPAT.toLocaleLowerCase() === 'false'
-            || process.env.SEMVER_PLUS_COMPAT === '0')) {
-    options.includePrerelease = true
-  }
- 
-  return options
-}
- 
-export { setDefaultOptions }
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/qa/coverage/src/max-satisfying.mjs.html b/qa/coverage/src/max-satisfying.mjs.html deleted file mode 100644 index 7e05f7e..0000000 --- a/qa/coverage/src/max-satisfying.mjs.html +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - Code coverage report for src/max-satisfying.mjs - - - - - - - - - -
-
-

All files / src max-satisfying.mjs

-
- -
- 93.75% - Statements - 15/16 -
- - -
- 100% - Branches - 11/11 -
- - -
- 100% - Functions - 1/1 -
- - -
- 93.75% - Lines - 15/16 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -451x -  -1x -1x -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -16x -1x -  -  -  -15x -1x -  -  -14x -  -14x -18x -11x -  -  -3x -1x - 
import semver from 'semver'
- 
-import { rsort } from './semver-comparison-ops'
-import { satisfies } from './semver-range-ops'
-import { validVersionOrRange } from './valid-version-or-range'
- 
-/**
- * Returns the highest version in `versions` that satisfies the range, or null if no version satisfies the range. This
- * implementation differs from the base `semver.maxSatisfying` in that it correctly handles the following case:
- * `maxSatisfying(['1.0.0-alpha.0', '1.0.0'], '<1.0.0')` -> '1.0.0-alpha.0'. The base `semver.maxSatisfying` function
- * returns `null` in this case. Note, support for this syntax is not comprehensive and more complicated expressions are
- * likely to yield incorrect results.
- * @param {string[]} versions - The versions to check.
- * @param {string} range - The range to check.
- * @param {object} options - The options to pass to the semver.maxSatisfying function.
- * @param {boolean} options.compat - If true, then uses the base `semver.maxSatisfying` function.
- * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
- * @param {boolean} options.includePrerelease - Include prerelease versions in the result. This is effectively implied
- * if the range contains prerelease components.
- * @param {boolean} options.throwIfInvalid - If true, throws an exception if any version or the range is invalid.
- * @returns {string|null} - The highest version that satisfies the range, or null if no version satisfies the range.
- * @category Range operations
- * @function
- */
-// export const maxSatisfying = semver.maxSatisfying
-export const maxSatisfying = (versions, range, options) => {
-  if (options?.throwIfInvalid === true) {
-    validVersionOrRange(versions, { ...options, disallowRanges : true })
-    validVersionOrRange([range], { ...options, disallowVersions : true })
-  }
- 
-  if (options?.compat === true) {
-    return semver.maxSatisfying(versions, range, options)
-  }
- 
-  versions = rsort(versions, options)
- 
-  for (const version of versions) {
-    if (satisfies(version, range, options)) {
-      return version
-    }
-  }
-  return null
-}
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/qa/coverage/src/min-version.mjs.html b/qa/coverage/src/min-version.mjs.html deleted file mode 100644 index 4a7124c..0000000 --- a/qa/coverage/src/min-version.mjs.html +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - Code coverage report for src/min-version.mjs - - - - - - - - - -
-
-

All files / src min-version.mjs

-
- -
- 100% - Statements - 7/7 -
- - -
- 85.71% - Branches - 6/7 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 7/7 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -291x -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -21x -5x -  -16x -1x -  -  - 
import semver from 'semver'
- 
-import { prereleaseXRangeRE } from './constants'
- 
-/**
- * Returns the lowest version that satisfies the range, or null if no version satisfies the range. This implementation
- * differs from the base `semver.minVersion` in that it correctly handles simple prerelease x-ranges. E.g.,
- * '1.0.0-alpha.x' -> '1.0.0-alpha.0'. To suppress this behavior, pass `options.compat = true`. Note, support for this
- * syntax is not comprehensive and more complicated expressions are likely to yield incorrect results.
- * @param {string} range - The range to check.
- * @param {object} options - The options to pass to the semver.minVersion function.
- * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
- * @param {boolean} options.includePrerelease - Whether to include prerelease versions.
- * @param {boolean} options.compat - If true, prerelease ranges are treated the same as in the base semver package;
- * e.g. `minVersion('1.0.0-alpha.x', { compat: true })` -> '1.0.0-alpha.x'.
- * @returns {string|null} - The lowest version that satisfies the range, or null if no version satisfies the range.
- * @category Range operations
- */
-const minVersion = (range, options) => {
-  // we have to do this first, because semver does not recognize prerelease X-ranges ending with '*' (even though it
-  // does recognize these as valid ranges)
-  if (options?.compat !== true && range.match(prereleaseXRangeRE)) {
-    return range.slice(0, -1) + '0'
-  }
-  return semver.minVersion(range, options)
-}
- 
-export { minVersion }
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/qa/coverage/src/next-version.mjs.html b/qa/coverage/src/next-version.mjs.html deleted file mode 100644 index ec9efe9..0000000 --- a/qa/coverage/src/next-version.mjs.html +++ /dev/null @@ -1,403 +0,0 @@ - - - - - - Code coverage report for src/next-version.mjs - - - - - - - - - -
-
-

All files / src next-version.mjs

-
- -
- 100% - Statements - 47/47 -
- - -
- 98.03% - Branches - 50/51 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 45/45 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -1071x -1x -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -47x -4x -4x -  -  -43x -1x -  -42x -42x -  -42x -  -  -  -  -42x -42x -  -  -42x -42x -  -  -42x -  -  -42x -1x -  -41x -2x -  -39x -8x -8x -8x -5x -  -  -31x -3x -  -28x -6x -  -  -  -25x -4x -3x -2x -2x -  -  -4x -  -21x -6x -3x -  -  -3x -  -  -6x -  -15x -  -3x -  -  -12x -  -  -  -  -  -  -  -1x -  -  - 
import createError from 'http-errors'
-import semver from 'semver'
- 
-import {
-  STANDARD_INCREMENTS,
-  STANDARD_PRERELEASE_INCREMENTS,
-  STANDARD_PRERELEASE_NAMES,
-  STANDARD_RELEASE_NAMES
-} from './ext-constants'
- 
-/**
- * Given a current version generates the next version string accourding to `increment`. This method is similar to
- * {@link inc} from the [base semver library](https://semver.org) with two differences.
- * 1) It supports a specific pre-release sequence prototype -> 'alpha' -> 'beta' -> 'rc' -> released and the 'pretype'
- *    increment will advance the prerelease ID through these stages.
- * 2) The 'prerelease' increment can only be used to advance the prerelease version number and does not function as
- *    'prepatch' on a non-prerelease version.
- * @param {string} currVer - The current version to increment.
- * @param {string} increment - The increment to use.
- * @returns {string} - The next version string.
- * @category Version operations
- */
-const nextVersion = (currVer, increment) => {
-  if (!semver.valid(currVer)) {
-    const msg = `Invalid version '${currVer}'` + (semver.validRange(currVer) ? '; range not allowed.' : '.')
-    throw createError.BadRequest(msg)
-  }
- 
-  if (increment !== undefined && !STANDARD_INCREMENTS.includes(increment)) {
-    throw createError.BadRequest(`Invalid increment '${increment}' specified.`)
-  }
-  const semverTupleREString = '(?:[0-9]|[1-9][0-9]+)'
-  const isProductionVersion = !!currVer.match(new RegExp(`^(?:${semverTupleREString}\\.){2}${semverTupleREString}$`))
-  // what are we incrementing? default is patch for production and prerelease for pre-release projects
-  increment = increment || (isProductionVersion ? 'patch' : 'prerelease')
- 
-  let nextVer
-  // determine concrete value for increment
-  // `semver.prerelease(currVer)` extracts an array of components; we just want a string
-  const currPrereleaseComponents = semver.prerelease(currVer)
-  const currPrerelease = currPrereleaseComponents === null ? null : currPrereleaseComponents.join('.')
-  // const stdPrereleaseMatch = currVer.match(/^[\d.Z]+-(?!\d\.\d+$)([0-9A-Za-z-]+)\.\d+)$/)
-  // const
-  const stdPrereleaseMatch = currPrerelease === null ? null : currPrerelease.match(/^(?!\d+\.\d+$)(?:([0-9A-Za-z-]+)\.)?\d+$/)
-  const standardPrereleaseName = stdPrereleaseMatch === null
-    ? null
-    : (stdPrereleaseMatch[1] === undefined ? '' : stdPrereleaseMatch[1])
-  const isStandardCurrPrerelease = STANDARD_PRERELEASE_NAMES.includes(standardPrereleaseName)
- 
-  // now verify the combination of inputs
-  if (increment === 'pretype' && !STANDARD_PRERELEASE_NAMES.includes(standardPrereleaseName)) {
-    throw createError.BadRequest(`Cannot increment type of unknown prerelease type '${currPrerelease}'. Can only increment '${STANDARD_PRERELEASE_NAMES.join(', -> ')}'.`)
-  }
-  if (increment === 'prerelease' && standardPrereleaseName === null) {
-    throw createError.BadRequest(`Cannot increment non-standard prerelease version '${currPrerelease}'. Use '<tag>.<number>' where tag is alphanumeric+dashes (but not all digits).`)
-  }
-  else if (isStandardCurrPrerelease === true && STANDARD_PRERELEASE_NAMES.includes(increment)) { // implies `standardPrereleaseName !== undefined`
-    const currIndex = STANDARD_PRERELEASE_NAMES.indexOf(standardPrereleaseName)
-    const incrementIndex = STANDARD_PRERELEASE_NAMES.indexOf(increment)
-    if (incrementIndex <= currIndex) {
-      throw createError.BadRequest(`Cannot move prerelease name from '${standardPrereleaseName}' to '${increment}'. Prerelease types must move forward.`)
-    }
-  }
-  else if (isProductionVersion && STANDARD_PRERELEASE_INCREMENTS.includes(increment)) {
-    throw createError.BadRequest(`Cannot use increment '${increment}' with production versions. Use 'premajor', 'preminor', or 'prepatch'.`)
-  }
-  else if (!isProductionVersion && !STANDARD_PRERELEASE_INCREMENTS.includes(increment)) {
-    throw createError.BadRequest(`Cannot use increment '${increment}' with pre-release versions. Use '${STANDARD_PRERELEASE_INCREMENTS.join(', ')}'.`)
-  }
- 
-  // alpha -> beta -> rc; valid states verified above
-  if (increment === 'pretype') {
-    if (standardPrereleaseName === 'alpha') nextVer = currVer.replace(/([0-1.Z-]+)alpha(\.\d+)?/, '$1beta.0')
-    else if (standardPrereleaseName === 'beta') nextVer = currVer.replace(/([0-1.Z-]+)beta(\.\d+)?/, '$1rc.0')
-    else if (standardPrereleaseName === 'rc') {
-      nextVer = currVer.replace(/([0-9.Z]+)-rc(?:\.\d+)?/, '$1')
-    }
- 
-    return nextVer // we're done
-  }
-  else if (STANDARD_RELEASE_NAMES.includes(increment)) {
-    if (increment === 'gold') {
-      nextVer = currVer.replace(/^([\d.]+)-(?:alpha|beta|rc)(?:\.\d+)?/, '$1')
-    }
-    else {
-      nextVer = currVer.replace(/^([\d.]+)-(?:alpha|beta|rc)(?:\.\d+)?/, `$1-${increment}.0`)
-    }
- 
-    return nextVer
-  }
-  else if (increment !== 'prerelease' && increment.startsWith('pre')) {
-    // then it's 'premajor', 'preminor', 'prepatch'
-    return semver.inc(currVer, increment, 'alpha')
-  }
-  // else, it's a standard semver increment
-  return semver.inc(currVer, increment)
-  /*
-  // if we're going 'pre', but currVer is a pre-style, then we need to specify the first stage in the pre, aka, alpha
-  nextVer = increment.startsWith('pre') && currVer.match(/^[\d.Z-]+$/)
-    ? semver.inc(currVer, increment, 'alpha')
-    : semver.inc(currVer, increment)
- 
-  return nextVer */
-}
- 
-export { nextVersion }
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/qa/coverage/src/semver-comparison-ops.mjs.html b/qa/coverage/src/semver-comparison-ops.mjs.html deleted file mode 100644 index 129782c..0000000 --- a/qa/coverage/src/semver-comparison-ops.mjs.html +++ /dev/null @@ -1,595 +0,0 @@ - - - - - - Code coverage report for src/semver-comparison-ops.mjs - - - - - - - - - -
-
-

All files / src semver-comparison-ops.mjs

-
- -
- 100% - Statements - 15/15 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 15/15 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -1711x -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -1x - 
import semver from 'semver'
- 
-/**
- * Returns `true` if `v1` is greater than `v2`, `false` otherwise.
- * @param {string} v1 - The first version to compare.
- * @param {string} v2 - The second version to compare.
- * @param {object} options - The options to pass to the semver.gt function.
- * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
- * @returns {boolean} - `true` if `v1` is greater than `v2`, `false` otherwise.
- * @category Comparison operations
- * @function
- */
-export const gt = semver.gt
- 
-/**
- * Returns `true` if `v1` is greater than or equal to `v2`, `false` otherwise.
- * @param {string} v1 - The first version to compare.
- * @param {string} v2 - The second version to compare.
- * @param {object} options - The options to pass to the semver.gte function.
- * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
- * @returns {boolean} - `true` if `v1` is greater than or equal to `v2`, `false` otherwise.
- * @category Comparison operations
- * @function
- */
-export const gte = semver.gte
- 
-/**
- * Returns `true` if `v1` is less than `v2`, `false` otherwise.
- * @param {string} v1 - The first version to compare.
- * @param {string} v2 - The second version to compare.
- * @param {object} options - The options to pass to the semver.lt function.
- * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
- * @returns {boolean} - `true` if `v1` is less than `v2`, `false` otherwise.
- * @category Comparison operations
- * @function
- */
-export const lt = semver.lt
- 
-/**
- * Returns `true` if `v1` is less than or equal to `v2`, `false` otherwise.
- * @param {string} v1 - The first version to compare.
- * @param {string} v2 - The second version to compare.
- * @param {object} options - The options to pass to the semver.lte function.
- * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
- * @returns {boolean} - `true` if `v1` is less than or equal to `v2`, `false` otherwise.
- * @category Comparison operations
- * @function
- */
-export const lte = semver.lte
- 
-/**
- * Returns `true` if `v1` is equal to `v2`, `false` otherwise.
- * @param {string} v1 - The first version to compare.
- * @param {string} v2 - The second version to compare.
- * @param {object} options - The options to pass to the semver.eq function.
- * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
- * @returns {boolean} - `true` if `v1` is equal to `v2`, `false` otherwise.
- * @category Comparison operations
- * @function
- */
-export const eq = semver.eq
- 
-/**
- * Returns `true` if `v1` is not equal to `v2`, `false` otherwise.
- * @param {string} v1 - The first version to compare.
- * @param {string} v2 - The second version to compare.
- * @param {object} options - The options to pass to the semver.neq function.
- * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
- * @returns {boolean} - `true` if `v1` is not equal to `v2`, `false` otherwise.
- * @category Comparison operations
- * @function
- */
-export const neq = semver.neq
- 
-/**
- * Returns a number indicating whether a version is greater than, equal to, or less than another version.
- * @param {string} v1 - The first version to compare.
- * @param {string} comparator - The comparator to use. May be '<', '<=', '>', '>=', '=', '==', '!=', '===', or '!=='.
- * An exception is thrown if an invalid comparator is provided.
- * @param {string} v2 - The second version to compare.
- * @param {object} options - The options to pass to the semver.cmp function.
- * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
- * @returns {number} - A number indicating whether a version is greater than, equal to, or less than another version.
- * @category Comparison operations
- * @function
- */
-export const cmp = semver.cmp
- 
-/**
- * Returns 0 if `v1 == v2`, 1 if `v1 > v2`, and -1 if `v1 < v2`. Will sort an array of versions in ascending order if
- * passed to `Array.sort()`.
- * @param {string} v1 - The first version to compare.
- * @param {string} v2 - The second version to compare.
- * @param {object} options - The options to pass to the semver.compare function.
- * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
- * @returns {number} - 0 if `v1 == v2`, 1 if `v1 > v2`, and -1 if `v1 < v2`.
- * @category Comparison operations
- * @function
- */
-export const compare = semver.compare
- 
-/**
- * Same as {@link compare} except it compares build if two versions are otherwise equal.
- * @param {string} v1 - The first version to compare.
- * @param {string} v2 - The second version to compare.
- * @param {object} options - The options to pass to the semver.compareBuild function.
- * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
- * @returns {number} - 0 if `v1 == v2`, 1 if `v1 > v2`, and -1 if `v1 < v2`.
- * @category Comparison operations
- * @function
- */
-export const compareBuild = semver.compareBuild
- 
-/**
- * Reverse of {@link compare}.
- * @param {string} v1 - The first version to compare.
- * @param {string} v2 - The second version to compare.
- * @param {object} options - The options to pass to the semver.rcompare function.
- * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
- * @returns {number} - 0 if `v1 == v2`, -1 if `v1 > v2`, and 1 if `v1 < v2`.
- * @category Comparison operations
- * @function
- */
-export const rcompare = semver.rcompare
- 
-/**
- * Short for {@link compare} with `options.loose = true`.
- * @param {string} v1 - The first version to compare.
- * @param {string} v2 - The second version to compare.
- * @returns {number} - 0 if `v1 == v2`, 1 if `v1 > v2`, and -1 if `v1 < v2`.
- * @category Comparison operations
- * @function
- */
-export const compareLoose = semver.compareLoose
- 
-/**
- * Returns the difference between two versions. I.e., the most significant version component by which `v1` and `v2`
- * differ.
- * @param {string} v1 - The first version to compare.
- * @param {string} v2 - The second version to compare.
- * @param {object} options - The options to pass to the semver.diff function.
- * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
- * @returns {string|null} - `major`, 'minor', 'patch', 'prerelease', 'premajor', 'preminor', or 'prepatch' or null if
- * the `v1` and `v2` are identical (disregarding build metadata).
- * @category Comparison operations
- * @function
- */
-export const diff = semver.diff
- 
-/**
- * Sorts an array of versions in ascending order using {@link compareBuild}.
- * @param {string[]} versions - The versions to sort.
- * @param {object} options - The options to pass to the semver.sort function.
- * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
- * @returns {string[]} - The sorted versions.
- * @category Comparison operations
- * @function
- */
-export const sort = semver.sort
- 
-/**
- * Sorts an array of versions in descending order using {@link compareBuild}.
- * @param {string[]} versions - The versions to sort.
- * @param {object} options - The options to pass to the semver.rsort function.
- * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
- * @returns {string[]} - The sorted versions.
- * @category Comparison operations
- * @function
- */
-export const rsort = semver.rsort
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/qa/coverage/src/semver-range-ops.mjs.html b/qa/coverage/src/semver-range-ops.mjs.html deleted file mode 100644 index 41e760a..0000000 --- a/qa/coverage/src/semver-range-ops.mjs.html +++ /dev/null @@ -1,436 +0,0 @@ - - - - - - Code coverage report for src/semver-range-ops.mjs - - - - - - - - - -
-
-

All files / src semver-range-ops.mjs

-
- -
- 100% - Statements - 10/10 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 10/10 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -1181x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -1x - 
import semver from 'semver'
- 
-// note:
-// - `maxSatisfying` is overriden and defined in `max-satisfying.mjs`
-// - `minVersion` is overriden and defined in `min-version.mjs`
- 
-/**
- * Returns a parsed, normalized range string or null if the range is invalid.
- * @param {string} range - The range to parse.
- * @param {object} options - The options to pass to the semver.validRange function.
- * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
- * @returns {string|null} - The parsed, normalized range string or null if the range is invalid.
- * @category Range operations
- * @function
- */
-export const validRange = semver.validRange
- 
-/**
- * Returns `true` if the version satisfies the range, `false` otherwise.
- * @param {string} version - The version to check.
- * @param {string} range - The range to check.
- * @param {object} options - The options to pass to the semver.satisfies function.
- * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
- * @returns {boolean} - `true` if the version satisfies the range, `false` otherwise.
- * @category Range operations
- * @function
- */
-export const satisfies = semver.satisfies
- 
-/**
- * Returns the lowest version in `versions` that satisfies the range, or null if no version satisfies the range.
- * @param {string[]} versions - The versions to check.
- * @param {string} range - The range to check.
- * @param {object} options - The options to pass to the semver.minSatisfying function.
- * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
- * @returns {string|null} - The lowest version that satisfies the range, or null if no version satisfies the range.
- * @category Range operations
- * @function
- */
-export const minSatisfying = semver.minSatisfying
- 
-/**
- * Returns `true` if `version` is greater than is greater than any version in `range`, `false` otherwise.
- * @param {string} version - The version to check.
- * @param {string} range - The range to check.
- * @param {object} options - The options to pass to the semver.gtr function.
- * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
- * @returns {boolean} - `true` if `version` is greater than is greater than any version in `range`, `false` otherwise.
- * @category Range operations
- * @function
- */
-export const gtr = semver.gtr
- 
-/**
- * Returns `true` if `version` is less than is less than any version in `range`, `false` otherwise.
- * @param {string} version - The version to check.
- * @param {string} range - The range to check.
- * @param {object} options - The options to pass to the semver.ltr function.
- * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
- * @returns {boolean} - `true` if `version` is less than is less than any version in `range`, `false` otherwise.
- * @category Range operations
- * @function
- */
-export const ltr = semver.ltr
- 
-/**
- * Returns `true` if `version` is outside of `range` in the indicated direction, `false` otherwise. `outside(v, r, '>)`
- * is equivalent to `gtr(v, r)`.
- * @param {string} version - The version to check.
- * @param {string} range - The range to check.
- * @param {string} direction - The direction to check. Must be '>' or '<'.
- * @param {object} options - The options to pass to the semver.outside function.
- * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
- * @returns {boolean} - `true` if `version` is outside of `range` in the indicated direction, `false` otherwise.
- * @category Range operations
- * @function
- */
-export const outside = semver.outside
- 
-/**
- * Returns `true` if any of the comparators in the range intersect with each other.
- * @param {string} range - The first version range or comparator.
- * @param {object} options - The options to pass to the semver.intersects function.
- * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
- * @returns {boolean} - `true` if any of the comparators in the range intersect with each other, `false` otherwise.
- * @category Range operations
- * @function
- */
-export const intersects = semver.intersects
- 
-/**
- * Return a "simplified" range that matches the same items in the versions list as the range specified. Note that it
- * does not guarantee that it would match the same versions in all cases, only for the set of versions provided. This
- * is useful when generating ranges by joining together multiple versions with || programmatically, to provide the user
- * with something a bit more ergonomic. If the provided range is shorter in string-length than the generated range,
- * then that is returned.
- * @param {string[]} versions - The versions to check.
- * @param {string} range - The range to simplify.
- * @param {object} options - The options to pass to the semver.simplifyRange function.
- * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
- * @returns {string} - The simplified range.
- * @category Range operations
- * @function
- */
-export const simplifyRange = semver.simplifyRange
- 
-/**
- * Returns `true` if `subRange` is a subset of `superRange`, `false` otherwise.
- * @param {string} subRange - The sub-range to check.
- * @param {string} superRange - The super-range to check.
- * @param {object} options - The options to pass to the semver.subset function.
- * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
- * @returns {boolean} - `true` if `subRange` is a subset of `superRange`, `false` otherwise.
- * @category Range operations
- * @function
- */
-export const subset = semver.subset
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/qa/coverage/src/semver-version-ops.mjs.html b/qa/coverage/src/semver-version-ops.mjs.html deleted file mode 100644 index 4252aec..0000000 --- a/qa/coverage/src/semver-version-ops.mjs.html +++ /dev/null @@ -1,412 +0,0 @@ - - - - - - Code coverage report for src/semver-version-ops.mjs - - - - - - - - - -
-
-

All files / src semver-version-ops.mjs

-
- -
- 100% - Statements - 10/10 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 10/10 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -1101x -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -1x - 
import semver from 'semver'
- 
-/**
- * Returns a parsed, normalized version string or null if the version is invalid.
- * @param {string} version - The version to parse.
- * @param {object} options - The options to pass to the semver.valid function.
- * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
- * @param {boolean} options.includePrerelease - Whether to include prerelease versions.
- * @returns {string|null} - The parsed, normalized version string or null if the version is invalid.
- * @category Version operations
- * @function
- */
-export const valid = semver.valid
- 
-/**
- * Returns a new version string incremented by the specified part.
- * @param {string} version - The version to increment.
- * @param {string} increment - The increment to use.
- * @param {object} options - The options to pass to the semver.inc function.
- * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
- * @param {boolean} options.includePrerelease - Whether to include prerelease versions.
- * @param {string} identifier - Used to specify the prerelease name for prerelease increments.
- * @param {false|0|1} identifierBase - When incrementing to a new prerelease name, specifies the base number or
- * `false` for no number.
- * @returns {string} - The new version string.
- * @category Version operations
- * @function
- */
-export const inc = semver.inc
- 
-/**
- * Returns an array of prerelease components or `null` if the version is not a prerelease. A 'component' is just a '.'
- * separated string.
- * @param {string} version - The version to parse.
- * @param {object} options - The options to pass to the semver.inc function.
- * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
- * @returns {string[]|null} - The prerelease components or `null` if the version is not a prerelease.
- * @category Version operations
- * @function
- */
-export const prerelease = semver.prerelease
- 
-/**
- * Returns the major version number.
- * @param {string} version - The version to parse.
- * @param {object} options - The options to pass to the semver.major function.
- * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
- * @returns {number} - The major version number.
- * @category Version operations
- * @function
- */
-export const major = semver.major
- 
-/**
- * Returns the minor version number.
- * @param {string} version - The version to parse.
- * @param {object} options - The options to pass to the semver.minor function.
- * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
- * @returns {number} - The minor version number.
- * @category Version operations
- * @function
- */
-export const minor = semver.minor
- 
-/**
- * Returns the patch version number.
- * @param {string} version - The version to parse.
- * @param {object} options - The options to pass to the semver.patch function.
- * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
- * @returns {number} - The patch version number.
- * @category Version operations
- * @function
- */
-export const patch = semver.patch
- 
-/**
- * Attempts to parse and normalize a string as a semver string. An aliase for {@link valid}.
- * @category Version operations
- * @function
- */
-export const parse = semver.parse
- 
-/**
- * Aggressively attempts to coerce a string into a valid semver string. Basically, starting from the left side of the
- * string, it looks for a digit and then includes anything to the right of the digit that looks like part of a semver.
- * So, 'Number 1!' -> '1.0.0', 'Upgrade 1.2 to 1.3' -> '1.2.0', etc.
- * @param {string} version - The version to coerce.
- * @param {object} options - The options to pass to the semver.coerce function.
- * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
- * @param {boolean} options.includePrerelease - Unless true, prerelease tags (and build metadata) are stripped. If
- * @param {boolean} options.rtl - Instead of searching for a digit from the left, start searching from the right.
- * true, then they are preserved.
- * @returns {string|null} - The coerced version string or null if the version is invalid.
- * @category Version operations
- * @function
- */
-export const coerce = semver.coerce
- 
-/**
- * Returns a cleaned version string removing unecessary comparators and, if `options.loose` is true, fixing space
- * issues. Only works for versions, not ranges.
- * @param {string} version - The version to clean.
- * @param {object} options - The options to pass to the semver.clean function.
- * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
- * @returns {string|null} - The cleaned version string or null if the version is invalid.
- * @category Version operations
- * @function
- */
-export const clean = semver.clean
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/qa/coverage/src/upper-bound.mjs.html b/qa/coverage/src/upper-bound.mjs.html deleted file mode 100644 index 610e047..0000000 --- a/qa/coverage/src/upper-bound.mjs.html +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - Code coverage report for src/upper-bound.mjs - - - - - - - - - -
-
-

All files / src upper-bound.mjs

-
- -
- 88.88% - Statements - 8/9 -
- - -
- 80% - Branches - 4/5 -
- - -
- 100% - Functions - 1/1 -
- - -
- 88.88% - Lines - 8/9 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -242x -  -  -  -  -  -  -  -  -  -2x -47x -47x -  -  -  -47x -47x -  -47x -2x -  -  - 
import semver from 'semver'
- 
-/**
- * Finds the ceiling of a range. For '*', the ceiling is '*'. For specific versions or any range capped by a specific
- * version, the ceiling is that version. For any open-ended range, the ceiling is defined by a '<version>-0' range
- * function where 'verision-0' least range above the given range.
- * @param {string} range - The range to find the ceiling for.
- * @returns {string} - Either '*', a specific version, or a '<version>-0'.
- * @category Range operations
- */
-const upperBound = (range, { stripOperators = false } = {}) => {
-  const normalizedRange = semver.validRange(range)
-  Iif (normalizedRange === null) {
-    return null
-  }
- 
-  const ranges = normalizedRange.split(' ')
-  const upperRange = ranges[ranges.length - 1]
- 
-  return stripOperators === true ? upperRange.replace(/^[<>=]+/, '') : upperRange.replace(/^<=/, '')
-}
- 
-export { upperBound }
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/qa/coverage/src/valid-version-or-range.mjs.html b/qa/coverage/src/valid-version-or-range.mjs.html deleted file mode 100644 index 966b04b..0000000 --- a/qa/coverage/src/valid-version-or-range.mjs.html +++ /dev/null @@ -1,268 +0,0 @@ - - - - - - Code coverage report for src/valid-version-or-range.mjs - - - - - - - - - -
-
-

All files / src valid-version-or-range.mjs

-
- -
- 77.27% - Statements - 17/22 -
- - -
- 83.33% - Branches - 25/30 -
- - -
- 50% - Functions - 1/2 -
- - -
- 80.95% - Lines - 17/21 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -622x -  -2x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -2x -  -  -  -  -  -  -15x -1x -  -14x -  -  -  -14x -  -14x -  -  -  -  -  -  -14x -2x -1x -  -1x -  -  -13x -4x -  -  -  -4x -  -  -9x -2x -  -  - 
import semver from 'semver'
- 
-import { xRangeRE } from './constants'
- 
-/**
- * Validates a string to be a valid version or range. By default, an exception is raised unless `options.disallowVersions`
- * is `true`, in which case it filters out invalid strings and returns a new array.
- * @param {string} input - The string to validate.
- * @param {object} options - The options to pass to the semver.valid function.
- * @param {boolean} options.disallowRanges - Whether to disallow ranges.
- * @param {boolean} options.disallowVersions - Whether to disallow versions and ranges which are valid versions.
- * @param {boolean} options.includePrerelease - Whether to include prerelease versions.
- * @param {boolean} options.loose - Allow non-conforming, but recognizable semver strings.
- * @param {boolean} options.onlyXRange - Whether to only allow x-ranges. Note, even if this is `true`, and a valid
- * x-range is presented, the returned string will still be normalized.
- * @param {boolean} options.throwIfInvalid - If true, throws an exception if the string is invalid.
- * @returns {string|null} - A normalized version or range string or `null` if the string is invalid (if
- * `options.throwIfInvalid` is `true`, in which case an exception is thrown).
- */
-const validVersionOrRange = (input = throw new Error("'input' is required."), {
-  disallowRanges = false,
-  disallowVersions = false,
-  onlyXRange = false,
-  throwIfInvalid = false,
-  ...options
-} = {}) => {
-  if (disallowVersions === true && disallowRanges === true) {
-    throw new Error("'disallowVersions' and 'disallowRanges' cannot both be true.")
-  }
-  Iif (disallowRanges === true && onlyXRange === true) {
-    throw new Error("'disallowRanges' and 'onlyXRange' cannot both be true.")
-  }
- 
-  let normalized = disallowRanges === true ? semver.valid(input, options) : semver.validRange(input, options)
-  // test for x-range specifically
-  Iif (normalized !== null && onlyXRange === true && input.match(xRangeRE) === null) {
-    Iif (throwIfInvalid === true) {
-      throw new Error(`'${input}' is a valid range, but an x-range is specifically expected.`)
-    }
-    normalized = null
-  }
-  // test for range exclusive of versions
-  if (disallowVersions === true && semver.valid(input, options) !== null) {
-    if (throwIfInvalid === true) {
-      throw new Error(`'${input}' is a valid version, and a non-version range is expected.`)
-    }
-    normalized = null
-  }
-  // throw an exception if the string is invalid and `options.throwIfInvalid` is `true`
-  if (normalized === null && throwIfInvalid === true) {
-    const msg = `'${input}' is not a valid `
-      + `${disallowVersions === true
-        ? 'range exclusive of versions'
-        : (disallowRanges === true ? 'version' : 'version or range')}.`
-    throw new Error(msg)
-  }
- 
-  return normalized
-}
- 
-export { validVersionOrRange }
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/qa/coverage/src/x-sort.mjs.html b/qa/coverage/src/x-sort.mjs.html deleted file mode 100644 index 8e30af4..0000000 --- a/qa/coverage/src/x-sort.mjs.html +++ /dev/null @@ -1,418 +0,0 @@ - - - - - - Code coverage report for src/x-sort.mjs - - - - - - - - - -
-
-

All files / src x-sort.mjs

-
- -
- 86.66% - Statements - 52/60 -
- - -
- 72.41% - Branches - 21/29 -
- - -
- 100% - Functions - 4/4 -
- - -
- 86.2% - Lines - 50/58 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -1121x -  -1x -1x -  -  -  -  -  -  -  -1x -  -16x -16x -  -  -47x -  -16x -47x -26x -  -  -21x -21x -21x -  -  -  -  -  -  -  -  -  -  -  -  -  -16x -  -16x -20x -20x -  -20x -  -  -20x -7x -  -13x -  -  -13x -  -  -13x -  -  -  -13x -  -  -  -16x -3x -  -13x -4x -  -  -9x -  -9x -9x -19x -9x -9x -  -  -10x -10x -8x -  -  -  -8x -8x -7x -7x -  -  -1x -  -  -2x -1x -1x -  -1x -1x -1x -  -  -  -9x -1x -  -  - 
import semver from 'semver'
- 
-import { xRangeRE } from './constants'
-import { upperBound } from './upper-bound'
- 
-/**
- * Ascend sorts a mix of semver versions and x-range specified ranges (e.g., 1.2.* or 1.2.x). The ranges are sorted according to their highest version; e.g., 1.3.34 < 1.3.*. (I believe it can accept caret ranges too, but I would need to review the spec.)
- * @param {string[]} versionsAndRanges - The versions and ranges to sort.
- * @returns {string[]} - The sorted versions and ranges.
- * @category Comparison operations
- */
-const xSort = (versionsAndRanges) => {
-  // TODO: to sort any range type, develop 'minOutOfRange' and use those to sort ranges
-  const versions = []
-  const ranges = []
- 
-  // filter out duplicates
-  versionsAndRanges = versionsAndRanges.filter((v, i, a) => i === a.indexOf(v))
- 
-  for (const versionOrRange of versionsAndRanges) {
-    if (versionOrRange.match(xRangeRE)) {
-      ranges.push(versionOrRange)
-    }
-    else {
-      const version = semver.valid(versionOrRange)
-      if (version !== null) {
-        versions.push(versionOrRange)
-      }
-      else E{
-        const range = semver.validRange(versionOrRange)
-        if (range !== null) {
-          ranges.push(versionOrRange)
-        }
-        else {
-          throw new Error(`Input '${versionOrRange}' is neither a version nor version range.`)
-        }
-      }
-    }
-  }
- 
-  const sortedVersions = versions.sort(semver.compare)
- 
-  const sortedRanges = ranges.sort((a, b) => {
-    const firstPastA = upperBound(a, { stripOperators : true })
-    const firstPastB = upperBound(b, { stripOperators : true })
- 
-    Iif (firstPastA === '*') {
-      return 1
-    }
-    else if (firstPastB === '*') {
-      return -1
-    }
-    else Iif (firstPastA === null && firstPastB === null) {
-      return 0
-    }
-    else Iif (firstPastA === null) {
-      return 1
-    }
-    else Iif (firstPastB === null) {
-      return -1
-    }
-    else {
-      return semver.compare(firstPastA, firstPastB)
-    }
-  })
- 
-  if (sortedVersions.length === 0) {
-    return sortedRanges
-  }
-  else if (sortedRanges.length === 0) {
-    return sortedVersions
-  }
- 
-  const allSorted = [...versions]
- 
-  let allRangesGreater = false
-  for (const range of sortedRanges) {
-    if (allRangesGreater === true) {
-      allSorted.push(range)
-      continue
-    }
- 
-    const lastVersion = semver.maxSatisfying(sortedVersions, range)
-    if (lastVersion !== null) {
-      const indexOfLastVersion = allSorted.indexOf(lastVersion)
-      // we may have already inserted a range, so we need to find where the possible sequence of ranges ends and the
-      // next version begins (because ranges are sorted, we want to insert our range at the end of the sequence of
-      // ranges, if any).
-      const nextVersionOffset = allSorted.slice(indexOfLastVersion + 1).findIndex((vOrR) => semver.valid(vOrR))
-      if (nextVersionOffset === -1) {
-        allSorted.push(range)
-        allRangesGreater = true
-      }
-      else {
-        allSorted.splice(indexOfLastVersion + 1 + nextVersionOffset, 0, range)
-      }
-    }
-    else if (semver.gtr(sortedVersions[0], range)) {
-      const indexOfLowestRange = allSorted.indexOf(sortedVersions[0])
-      allSorted.splice(indexOfLowestRange, 0, range)
-    }
-    else if (semver.ltr(sortedVersions[sortedVersions.length - 1], range)) {
-      allSorted.push(range)
-      allRangesGreater = true
-    }
-  }
- 
-  return allSorted
-}
- 
-export { xSort }
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/qa/lint.txt b/qa/lint.txt deleted file mode 100644 index 9b13e13..0000000 --- a/qa/lint.txt +++ /dev/null @@ -1 +0,0 @@ -Test git rev: abf8dcd30189d8392473cb78f8721ed2154a2214 diff --git a/qa/unit-test.txt b/qa/unit-test.txt deleted file mode 100644 index 951d045..0000000 --- a/qa/unit-test.txt +++ /dev/null @@ -1,34 +0,0 @@ -Test git rev: 82169d0c77780d6bd449bcfb19143c8d722fc1ef -PASS test/valid-version-or-range.test.js -PASS test/next-version.test.js -PASS test/max-satisfying.test.js -PASS test/x-sort.test.js -PASS test/min-version.test.js -PASS test/prerelease.test.js -PASS test/upper-bound.test.js ------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ------------------------------|---------|----------|---------|---------|------------------- -All files | 86.42 | 82.39 | 75 | 86.97 | - src | 92.71 | 87.96 | 90 | 93.03 | - constants.mjs | 100 | 100 | 100 | 100 | - ext-constants.mjs | 100 | 100 | 100 | 100 | - max-satisfying.mjs | 93.75 | 100 | 100 | 93.75 | 29 - min-version.mjs | 100 | 85.71 | 100 | 100 | 22 - next-version.mjs | 100 | 98.03 | 100 | 100 | 25 - semver-comparison-ops.mjs | 100 | 100 | 100 | 100 | - semver-range-ops.mjs | 100 | 100 | 100 | 100 | - semver-version-ops.mjs | 100 | 100 | 100 | 100 | - upper-bound.mjs | 88.88 | 80 | 100 | 88.88 | 14 - valid-version-or-range.mjs | 77.27 | 83.33 | 50 | 80.95 | 31,37-40 - x-sort.mjs | 86.66 | 72.41 | 100 | 86.2 | 30-35,48,54,57,60 - src/lib | 0 | 0 | 0 | 0 | - compare-helper.mjs | 0 | 0 | 0 | 0 | 1-14 - set-default-options.mjs | 0 | 0 | 0 | 0 | 1-10 ------------------------------|---------|----------|---------|---------|------------------- - -Test Suites: 7 passed, 7 total -Tests: 128 passed, 128 total -Snapshots: 0 total -Time: 0.34 s, estimated 1 s -Ran all test suites.