From d9cbd82e1cef9df1a3da3753e4d80f79eaceb713 Mon Sep 17 00:00:00 2001 From: Zane Rockenbaugh Date: Sat, 11 Oct 2025 19:14:51 -0500 Subject: [PATCH 1/4] removed timever stuff; now only semver --- src/constants.mjs | 9 -- src/index.js | 2 - src/is-time-version.mjs | 7 -- src/next-version.mjs | 80 +++--------------- src/prerelease.mjs | 15 +--- src/test/next-version.test.js | 136 ------------------------------ src/test/prerelease.test.mjs | 3 - src/test/version-compare.test.mjs | 18 +--- src/version-compare.mjs | 60 +++---------- src/version-style.mjs | 16 ---- 10 files changed, 29 insertions(+), 317 deletions(-) delete mode 100644 src/is-time-version.mjs delete mode 100644 src/version-style.mjs diff --git a/src/constants.mjs b/src/constants.mjs index 07c5753..94ff706 100644 --- a/src/constants.mjs +++ b/src/constants.mjs @@ -1,12 +1,3 @@ -export const STYLE_SEMVER = 'semver' -export const STYLE_TIMEVER = 'timever' -export const STYLE_AUTO = 'auto' -export const TIMEVER_REGEX = /(\d{8})[.-](\d{6})Z(?:-(alpha|beta|rc)\.(\d)+)?$/ -export const TIMEVER_DATE_POS = 1 -export const TIMEVER_TIME_POS = 2 -export const TIMEVER_PRETYPE_POS = 3 -export const TIMEVER_PREVER_POS = 4 - 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 diff --git a/src/index.js b/src/index.js index 0313c42..355fc0a 100644 --- a/src/index.js +++ b/src/index.js @@ -1,11 +1,9 @@ export * from './ext-constants' export * from './filter-valid-version-or-range' export * from './first-past' -export * from './is-time-version' export * from './min-version' export * from './next-version' export * from './prerelease' export * from './valid-version-or-range' export * from './version-compare' -export * from './version-style' export * from './x-sort' diff --git a/src/is-time-version.mjs b/src/is-time-version.mjs deleted file mode 100644 index 5d97d04..0000000 --- a/src/is-time-version.mjs +++ /dev/null @@ -1,7 +0,0 @@ -import { TIMEVER_REGEX } from './constants' - -const isTimeVersion = (version) => { - return !!version.match(TIMEVER_REGEX) -} - -export { isTimeVersion } diff --git a/src/next-version.mjs b/src/next-version.mjs index 74a7894..b648b13 100644 --- a/src/next-version.mjs +++ b/src/next-version.mjs @@ -1,32 +1,11 @@ import createError from 'http-errors' import semver from 'semver' -import { STYLE_AUTO, STYLE_SEMVER, STYLE_TIMEVER } from './constants' import { increments, prereleaseIncrements, releaseTypes } from './ext-constants' -import { versionStyle } from './version-style' - -const makeTS = ({ date = new Date() } = {}) => { - const timestamp = date.getUTCFullYear() - + (date.getUTCMonth() + 1 + '').padStart(2, '0') - + (date.getUTCDate() + '').padStart(2, '0') - + '.' - + (date.getUTCHours() + '').padStart(2, '0') - + (date.getUTCMinutes() + '').padStart(2, '0') - + (date.getUTCSeconds() + '').padStart(2, '0') - + 'Z' - - return timestamp -} /** - * Given a current version, increment, and optional style, generates the next version string. The version style is - * typically identified automatically but can be specified explicitly (if switching styles, for example). Supports - * 'semver' and 'timever' style. See [semver specification](https://semver.org/). Timever style consists of: - * - a major version integer (indicating compatibility series) - * - a UTC timestamp in the form of 'YYYYMMDD.HHMMSSZ' - * - the timestamp is generated during the execution of this method. - * - * For semver style, this method follows the [semver spec](https://semver.org) except that: + * 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 * @@ -37,7 +16,7 @@ const makeTS = ({ date = new Date() } = {}) => { * 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 */ -const nextVersion = ({ currVer, date, increment, loose = false, style = STYLE_AUTO }) => { +const nextVersion = ({ currVer, increment, loose = false }) => { if (increment !== undefined && !increments.includes(increment)) { throw createError.BadRequest(`Invalid increment '${increment}' specified.`) } @@ -65,21 +44,12 @@ const nextVersion = ({ currVer, date, increment, loose = false, style = STYLE_AU } } - if (style === STYLE_AUTO || style === undefined) { - style = versionStyle(currVer) - } - // alpha -> beta -> rc if (increment === 'pretype') { if (currPrerelease === 'alpha') nextVer = currVer.replace(/([0-1.Z-]+)alpha(\.\d+)?/, '$1beta.0') else if (currPrerelease === 'beta') nextVer = currVer.replace(/([0-1.Z-]+)beta(\.\d+)?/, '$1rc.0') else if (currPrerelease === 'rc') { // is special in the case of timever + pretype - if (style === STYLE_SEMVER) { - nextVer = currVer.replace(/([0-9.Z]+)-rc(?:\.\d+)?/, '$1') - } - else { - nextVer = currVer.replace(/(\d+)\.\d{8}\.\d{6}Z-rc\.\d+/, '$1.' + makeTS()) - } + nextVer = currVer.replace(/([0-9.Z]+)-rc(?:\.\d+)?/, '$1') } return nextVer // we're done @@ -94,49 +64,21 @@ const nextVersion = ({ currVer, date, increment, loose = false, style = STYLE_AU } if (increment === 'gold') { - if (style === STYLE_SEMVER) { - nextVer = currVer.replace(/^([\d.Z]+)-(?:alpha|beta|rc)(?:\.\d+)?/, '$1') - } - else { // style === STYLE_TIMEVER - nextVer = currVer.replace(/(\d+)\.\d{8}\.\d{6}Z-(?:alpha|beta|rc)\.\d+/, '$1.' + makeTS()) - } + nextVer = currVer.replace(/^([\d.Z]+)-(?:alpha|beta|rc)(?:\.\d+)?/, '$1') } - else if (style === STYLE_SEMVER) { + else { nextVer = currVer.replace(/^([\d.Z-]+)(?:alpha|beta|rc)(?:\.\d+)?/, `$1${increment}.0`) } - else { // style === STYLE_TIMEVER - nextVer = currVer.replace(/(\d+)\.\d{8}\.\d{6}Z-(?:alpha|beta|rc)\.\d+/, '$1.' + makeTS() + increment + '.0') - } return nextVer } - if (style === STYLE_SEMVER) { - // 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) - } - else { // it's 'timever' style - const timestamp = makeTS({ date }) - - const [currMajor] = currVer.split('.') - const nextMajor = increment === 'major' || increment === 'premajor' ? '' + (parseInt(currMajor) + 1) : currMajor - if (currPrerelease === null && increment.startsWith('pre')) { - nextVer = nextMajor + '.' + timestamp + '-alpha.0' - } - else if (currPrerelease !== null && increment === 'prerelease') { - const currPreReleaseString = (currVer.match(/(?:alpha|beta|rc)\.(\d+)$/) || [null, null])[1] - const currPreRelease = parseInt(currPreReleaseString) - const currBare = currVer.replace(/\d+$/, '') - nextVer = currBare + (currPreRelease + 1) - } - else { - nextVer = nextMajor + '.' + timestamp + (currPrerelease ? '-' + currPrerelease : '') - } - } + // 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 { makeTS, nextVersion, STYLE_AUTO, STYLE_TIMEVER, STYLE_SEMVER } +export { nextVersion } diff --git a/src/prerelease.mjs b/src/prerelease.mjs index d0af7c6..2f8c86d 100644 --- a/src/prerelease.mjs +++ b/src/prerelease.mjs @@ -1,20 +1,7 @@ import semver from 'semver' -import { TIMEVER_REGEX, TIMEVER_PRETYPE_POS, TIMEVER_PREVER_POS } from './constants' -import { isTimeVersion } from './is-time-version' - const prerelease = (version) => { - if (isTimeVersion(version)) { - const match = version.match(TIMEVER_REGEX) - const preType = match[TIMEVER_PRETYPE_POS] - if (preType !== undefined) { - return [preType, parseInt(match[TIMEVER_PREVER_POS])] - } - else return null - } - else { - return semver.prerelease(version) - } + return semver.prerelease(version) } export { prerelease } diff --git a/src/test/next-version.test.js b/src/test/next-version.test.js index a6181d7..4f063bb 100644 --- a/src/test/next-version.test.js +++ b/src/test/next-version.test.js @@ -2,14 +2,6 @@ import * as ver from '../next-version' -describe('makeTS', () => { - test('Jan 3, 2023 0513.25 => 20230303.051325Z', () => { - const date = new Date('2023-03-03T05:13:25.000Z') - - expect(ver.makeTS({ date })).toBe('20230303.051325Z') - }) -}) - describe('nextVersion', () => { describe('handles semver style', () => { test.each([ @@ -68,132 +60,4 @@ describe('nextVersion', () => { const currVer = `1.0.0-${currPrerelease}` expect(() => ver.version({ currVer, increment : 'prerelease' })) }) - - describe('handles timever style', () => { - let preTS, resultReleased, resultPreInit, resultPreOngoing, resultPretype, postTS - const startTimeVer = '1.20230103.051325Z' - const testReleased = [ - [startTimeVer, undefined, '1'], - [startTimeVer, 'patch', '1'], - [startTimeVer, 'minor', '1'], - [startTimeVer, 'major', '2'] - ] - const testPreInit = [ - [startTimeVer, 'prepatch', '1', '-alpha.0'], - [startTimeVer, 'preminor', '1', '-alpha.0'], - [startTimeVer, 'premajor', '2', '-alpha.0'] - ] - const testPreOngoing = [ - [startTimeVer + '-alpha.1', 'prerelease', '-alpha.2'], - [startTimeVer + '-beta.1', 'prerelease', '-beta.2'], - [startTimeVer + '-rc.1', 'prerelease', '-rc.2'] - ] - const testPretype = [ - [startTimeVer + '-alpha.1', 'pretype', startTimeVer + '-beta.0'], - [startTimeVer + '-beta.1', 'pretype', startTimeVer + '-rc.0'] - ] - beforeAll(async() => { - const start = new Date() - preTS = ver.makeTS(start) - await new Promise(resolve => setTimeout(resolve, 1000)) - resultReleased = testReleased - .map(([currVer, increment, nextMajor]) => [ver.nextVersion({ currVer, increment }), nextMajor]) - resultPreInit = testPreInit - .map(([currVer, increment, result]) => [ver.nextVersion({ currVer, increment })]) - resultPreOngoing = testPreOngoing - .map(([currVer, increment, nextPre]) => [ver.nextVersion({ currVer, increment })]) - resultPretype = testPretype - .map(([currVer, increment]) => [ver.nextVersion({ currVer, increment })]) - await new Promise(resolve => setTimeout(resolve, 1000)) - const end = new Date() - postTS = ver.makeTS(end) - }) - - // TODO: it would be nice to do these as some kind of loop, but since we do all our calculations at once (in the - // beforeAll) in order to minimize the sleep times, '.each' won't work because the values are calculated before the - // before. - describe('released increment', () => { - test(`${testReleased[0][0]} + ${testReleased[0][1]} -> ${testReleased[0][2]}.`, () => { - expect(resultReleased[0][0]).toMatch(/1\.\d{8}.\d{6}Z/) - const raw = ['1.' + preTS, resultReleased[0][0], `${testReleased[0][2]}.${postTS}`] - const sorted = [...raw].sort() - expect(raw).toEqual(sorted) - }) - - test(`${testReleased[1][0]} + ${testReleased[1][1]} -> ${testReleased[1][2]}.`, () => { - expect(resultReleased[1][0]).toMatch(/1\.\d{8}.\d{6}Z/) - const raw = ['1.' + preTS, resultReleased[1][0], `${testReleased[1][2]}.${postTS}`] - const sorted = [...raw].sort() - expect(raw).toEqual(sorted) - }) - - test(`${testReleased[2][0]} + ${testReleased[2][1]} -> ${testReleased[2][2]}.`, () => { - expect(resultReleased[2][0]).toMatch(/1\.\d{8}.\d{6}Z/) - const raw = ['1.' + preTS, resultReleased[2][0], `${testReleased[2][2]}.${postTS}`] - const sorted = [...raw].sort() - expect(raw).toEqual(sorted) - }) - - test(`${testReleased[3][0]} + ${testReleased[3][1]} -> ${testReleased[3][2]}.`, () => { - expect(resultReleased[3][0]).toMatch(/2\.\d{8}.\d{6}Z/) - const raw = ['1.' + preTS, resultReleased[3][0], `${testReleased[3][2]}.${postTS}`] - const sorted = [...raw].sort() - expect(raw).toEqual(sorted) - }) - }) - - describe('initial pre-increment', () => { - test(`${testPreInit[0][0]} + ${testPreInit[0][1]} -> 1.${testPreInit[0][3]}`, () => { - expect(resultPreInit[0][0]).toMatch(/1\.\d{8}.\d{6}Z-alpha\.0/) - const raw = ['1.' + preTS, resultPreInit[0][0], `${testPreInit[0][2]}.${postTS}`] - const sorted = [...raw].sort() - expect(raw).toEqual(sorted) - }) - - test(`${testPreInit[1][0]} + ${testPreInit[1][1]} -> ${testPreInit[1][2]}.${testPreInit[1][3]}`, () => { - expect(resultPreInit[1][0]).toMatch(/1\.\d{8}.\d{6}Z-alpha\.0/) - const raw = ['1.' + preTS, resultPreInit[1][0], `${testPreInit[1][2]}.${postTS}`] - const sorted = [...raw].sort() - expect(raw).toEqual(sorted) - }) - - test(`${testPreInit[2][0]} + ${testPreInit[2][1]} -> ${testPreInit[2][2]}.${testPreInit[2][3]}`, () => { - expect(resultPreInit[2][0]).toMatch(/2\.\d{8}.\d{6}Z-alpha\.0/) - const raw = ['1.' + preTS, resultPreInit[2][0], `${testPreInit[2][2]}.${postTS}`] - const sorted = [...raw].sort() - expect(raw).toEqual(sorted) - }) - }) - - describe('ongoing pre-increment', () => { - test(`${testPreOngoing[0][0]} + ${testPreOngoing[0][1]} -> ${testPreOngoing[0][0].slice(0, -1) + '2'}`, () => { - expect(resultPreOngoing[0][0]).toBe(testPreOngoing[0][0].slice(0, -1) + '2') - }) - - test(`${testPreOngoing[1][0]} + ${testPreOngoing[1][1]} -> ${testPreOngoing[1][0].slice(0, -1) + '2'}`, () => { - expect(resultPreOngoing[1][0]).toBe(testPreOngoing[1][0].slice(0, -1) + '2') - }) - - test(`${testPreOngoing[2][0]} + ${testPreOngoing[2][1]} -> ${testPreOngoing[2][0].slice(0, -1) + '2'}`, () => { - expect(resultPreOngoing[2][0]).toBe(testPreOngoing[2][0].slice(0, -1) + '2') - }) - }) - - describe('pretype', () => { - test(`${testPretype[0][0]} + ${testPretype[0][1]} -> ${testPretype[0][2]}`, () => - expect(resultPretype[0][0]).toBe(testPretype[0][2])) - - test(`${testPretype[1][0]} + ${testPretype[1][1]} -> ${testPretype[1][2]}`, () => - expect(resultPretype[1][0]).toBe(testPretype[1][2])) - - test(`${startTimeVer}-rc.1 + pretype -> 1.`, () => { - const currVer = startTimeVer + '-rc.1' - const newVer = ver.nextVersion({ currVer, increment : 'pretype' }) - expect(newVer).toMatch(/^\d+.\d{8}.\d{6}Z$/) - expect(newVer).not.toBe(startTimeVer) - const sorted = [startTimeVer, newVer].sort() - expect(sorted[0]).toBe(startTimeVer) - }) - }) - }) }) diff --git a/src/test/prerelease.test.mjs b/src/test/prerelease.test.mjs index 8addede..b8ed199 100644 --- a/src/test/prerelease.test.mjs +++ b/src/test/prerelease.test.mjs @@ -7,8 +7,5 @@ describe('prerelease', () => { ['1.0.0', null], ['1.0.0-beta.0', ['beta', 0]], ['1.0.0-alpha.2', ['alpha', 2]], - ['20230303.051512Z', null], - ['20230304.051512Z-beta.0', ['beta', 0]], - ['20230304.051512Z-alpha.2', ['alpha', 2]] ])('version %p yields %s', (version, expected) => expect(prerelease(version)).toEqual(expected)) }) diff --git a/src/test/version-compare.test.mjs b/src/test/version-compare.test.mjs index 428ffdf..a4d142c 100644 --- a/src/test/version-compare.test.mjs +++ b/src/test/version-compare.test.mjs @@ -10,20 +10,15 @@ describe('maxVersion', () => { [['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'], - [['20230303.051512Z', '20230304.051512Z-alpha.0'], '20230304.051512Z-alpha.0'], - [['20230304.051512Z-beta.0', '20230304.051512Z-alpha.0'], '20230304.051512Z-beta.0'], - [['20230304.051512Z-beta.0', '20230304.051512Z-rc.0'], '20230304.051512Z-rc.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', '20230501-101010Z'] })).toThrow()) + () => expect(() => maxVersion({ versions : ['1.0.0', 'not-a-valid-vesion'] })).toThrow()) test.each([ - [['1.0.0', '20230501-101010Z', 'abc'], '1.0.0'], - [['abc', '1.0.0', '20230501-101010Z'], '1.0.0'], - [['abc', '20230501-101010Z', '1.0.0'], '20230501-101010Z'] + [['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)) }) @@ -36,20 +31,15 @@ describe('minVersion', () => { [['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'], - [['20230303.051512Z', '20230304.051512Z-alpha.0'], '20230303.051512Z'], - [['20230304.051512Z-beta.0', '20230304.051512Z-alpha.0'], '20230304.051512Z-alpha.0'], - [['20230304.051512Z-beta.0', '20230304.051512Z-rc.0'], '20230304.051512Z-beta.0'] ])('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', '20230501-101010Z'] })).toThrow()) + () => expect(() => minVersion({ versions : ['1.0.0', 'not-a-valid-vesion'] })).toThrow()) test.each([ - [['1.0.0', '20230501-101010Z', 'abc'], '1.0.0'], - [['abc', '1.0.0', '20230501-101010Z'], '1.0.0'], - [['abc', '20230501-101010Z', '1.0.0'], '20230501-101010Z'] + [['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 index 2844a62..ff869b5 100644 --- a/src/version-compare.mjs +++ b/src/version-compare.mjs @@ -1,91 +1,57 @@ import semver from 'semver' -import { STYLE_AUTO, STYLE_SEMVER } from './constants' -import { isTimeVersion } from './is-time-version' -import { versionStyle } from './version-style' - -const compareHelper = ({ semverTest, style, timeverTest, versions }) => { +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 (style === STYLE_SEMVER) { - if (semverTest(currLead, testVer)) { - currLead = testVer - } - } - else { - if (timeverTest(currLead, testVer)) { - currLead = testVer - } + else if (semverTest(currLead, testVer)) { + currLead = testVer } } return currLead } -const maxVersion = ({ ignoreNonVersions, style, versions }) => { +const maxVersion = ({ ignoreNonVersions, versions }) => { if (!versions || versions.length === 0) { return null } - ([style, versions] = styleValidator({ ignoreNonVersions, style, versions })) + versions = filterValidVersions(versions,{ ignoreNonVersions }) - return compareHelper({ semverTest : semver.lt, style, timeverTest : (a, b) => a.localeCompare(b) < 0, versions }) + return compareHelper({ semverTest : semver.lt, timeverTest : (a, b) => a.localeCompare(b) < 0, versions }) } -const minVersion = ({ ignoreNonVersions, style, versions }) => { +const minVersion = ({ ignoreNonVersions, versions }) => { if (!versions || versions.length === 0) { return null } - ([style, versions] = styleValidator({ ignoreNonVersions, style, versions })) + versions = filterValidVersions(versions, { ignoreNonVersions }) - return compareHelper({ semverTest : semver.gt, style, timeverTest : (a, b) => a.localeCompare(b) > 0, versions }) + return compareHelper({ semverTest : semver.gt, timeverTest : (a, b) => a.localeCompare(b) > 0, versions }) } -const styleValidator = ({ ignoreNonVersions, style, versions }) => { - if (style === STYLE_AUTO || style === undefined) { - style = versions.reduce((res, v) => { - try { - if (res !== undefined) { - return res - } - else { - return versionStyle(v) - } - } - catch (e) { - if (ignoreNonVersions === true) { - return undefined - } - else { - throw e - } - } - }, undefined) - } - +const filterValidVersions = (versions, { ignoreNonVersions }) => { versions = versions.filter((version) => { - const valid = style === STYLE_SEMVER - ? semver.valid(version) !== null - : isTimeVersion(version) + const valid = semver.valid(version) !== null if (valid === false) { if (ignoreNonVersions === true) { return false } else { - throw new Error(`Version style mis-match; initial version of style '${style}', but '${version}' is not valid for that style.`) + throw new Error(`'${version}' is not a valid semver.`) } } return true }) - return [style, versions] + return versions } export { maxVersion, minVersion } diff --git a/src/version-style.mjs b/src/version-style.mjs deleted file mode 100644 index 64777dc..0000000 --- a/src/version-style.mjs +++ /dev/null @@ -1,16 +0,0 @@ -import semver from 'semver' - -import { STYLE_SEMVER, STYLE_TIMEVER } from './constants' -import { isTimeVersion } from './is-time-version' - -const versionStyle = (version) => { - const style = isTimeVersion(version) ? STYLE_TIMEVER : STYLE_SEMVER - - if (style === STYLE_SEMVER && !semver.valid(version)) { - throw new Error(`Could not determine version type for '${version}'.`) - } - - return style -} - -export { versionStyle } From 0b5e561d02ac5a578f60fe90ee6a1c9816cfd188 Mon Sep 17 00:00:00 2001 From: Zane Rockenbaugh Date: Sat, 11 Oct 2025 19:16:01 -0500 Subject: [PATCH 2/4] lint formatting --- src/test/next-version.test.js | 2 +- src/test/prerelease.test.mjs | 2 +- src/test/version-compare.test.mjs | 8 ++++---- src/version-compare.mjs | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/test/next-version.test.js b/src/test/next-version.test.js index 4f063bb..b41880d 100644 --- a/src/test/next-version.test.js +++ b/src/test/next-version.test.js @@ -1,4 +1,4 @@ -/* global beforeAll describe expect test */ +/* global describe expect test */ import * as ver from '../next-version' diff --git a/src/test/prerelease.test.mjs b/src/test/prerelease.test.mjs index b8ed199..c1c99cc 100644 --- a/src/test/prerelease.test.mjs +++ b/src/test/prerelease.test.mjs @@ -6,6 +6,6 @@ describe('prerelease', () => { test.each([ ['1.0.0', null], ['1.0.0-beta.0', ['beta', 0]], - ['1.0.0-alpha.2', ['alpha', 2]], + ['1.0.0-alpha.2', ['alpha', 2]] ])('version %p yields %s', (version, expected) => expect(prerelease(version)).toEqual(expected)) }) diff --git a/src/test/version-compare.test.mjs b/src/test/version-compare.test.mjs index a4d142c..d910663 100644 --- a/src/test/version-compare.test.mjs +++ b/src/test/version-compare.test.mjs @@ -9,7 +9,7 @@ describe('maxVersion', () => { [['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'], + [['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)) @@ -18,7 +18,7 @@ describe('maxVersion', () => { () => expect(() => maxVersion({ versions : ['1.0.0', 'not-a-valid-vesion'] })).toThrow()) test.each([ - [['1.0.0', 'not-a-valid-vesion', 'abc'], '1.0.0'], + [['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)) }) @@ -30,7 +30,7 @@ describe('minVersion', () => { [['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'], + [['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)) @@ -39,7 +39,7 @@ describe('minVersion', () => { () => expect(() => minVersion({ versions : ['1.0.0', 'not-a-valid-vesion'] })).toThrow()) test.each([ - [['1.0.0', 'not-a-valid-vesion', 'abc'], '1.0.0'], + [['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 index ff869b5..f60b6f8 100644 --- a/src/version-compare.mjs +++ b/src/version-compare.mjs @@ -20,7 +20,7 @@ const maxVersion = ({ ignoreNonVersions, versions }) => { return null } - versions = filterValidVersions(versions,{ ignoreNonVersions }) + versions = filterValidVersions(versions, { ignoreNonVersions }) return compareHelper({ semverTest : semver.lt, timeverTest : (a, b) => a.localeCompare(b) < 0, versions }) } From 43f8b7768d4e99821eafe371e0fb1e55418c68a4 Mon Sep 17 00:00:00 2001 From: Zane Rockenbaugh Date: Sat, 11 Oct 2025 19:17:00 -0500 Subject: [PATCH 3/4] Save QA files. --- qa/coverage/base.css | 224 ++++++++++ qa/coverage/block-navigation.js | 87 ++++ qa/coverage/clover.xml | 211 ++++++++++ qa/coverage/constants.mjs.html | 100 +++++ qa/coverage/coverage-final.json | 11 + qa/coverage/ext-constants.mjs.html | 145 +++++++ qa/coverage/favicon.png | Bin 0 -> 445 bytes .../filter-valid-version-or-range.mjs.html | 109 +++++ qa/coverage/first-past.mjs.html | 196 +++++++++ qa/coverage/index.html | 251 +++++++++++ qa/coverage/min-version.mjs.html | 148 +++++++ qa/coverage/next-version.mjs.html | 337 +++++++++++++++ qa/coverage/prerelease.mjs.html | 106 +++++ 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/valid-version-or-range.mjs.html | 130 ++++++ qa/coverage/version-compare.mjs.html | 256 ++++++++++++ qa/coverage/x-sort.mjs.html | 391 ++++++++++++++++++ qa/lint.txt | 1 + qa/unit-test.txt | 29 ++ 22 files changed, 2931 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/constants.mjs.html create mode 100644 qa/coverage/coverage-final.json create mode 100644 qa/coverage/ext-constants.mjs.html create mode 100644 qa/coverage/favicon.png create mode 100644 qa/coverage/filter-valid-version-or-range.mjs.html create mode 100644 qa/coverage/first-past.mjs.html create mode 100644 qa/coverage/index.html create mode 100644 qa/coverage/min-version.mjs.html create mode 100644 qa/coverage/next-version.mjs.html create mode 100644 qa/coverage/prerelease.mjs.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/valid-version-or-range.mjs.html create mode 100644 qa/coverage/version-compare.mjs.html create mode 100644 qa/coverage/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..fbd254f --- /dev/null +++ b/qa/coverage/clover.xml @@ -0,0 +1,211 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/qa/coverage/constants.mjs.html b/qa/coverage/constants.mjs.html new file mode 100644 index 0000000..d46d361 --- /dev/null +++ b/qa/coverage/constants.mjs.html @@ -0,0 +1,100 @@ + + + + + + Code coverage report for constants.mjs + + + + + + + + + +
+
+

All files 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
+  /^(?:[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*]$/
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/qa/coverage/coverage-final.json b/qa/coverage/coverage-final.json new file mode 100644 index 0000000..1970836 --- /dev/null +++ b/qa/coverage/coverage-final.json @@ -0,0 +1,11 @@ +{"/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":117}},"1":{"start":{"line":5,"column":31},"end":{"line":5,"column":95}}},"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":23},"end":{"line":13,"column":null}},"1":{"start":{"line":15,"column":33},"end":{"line":15,"column":92}},"2":{"start":{"line":16,"column":25},"end":{"line":16,"column":59}},"3":{"start":{"line":18,"column":0},"end":{"line":18,"column":null}},"4":{"start":{"line":19,"column":0},"end":{"line":19,"column":null}},"5":{"start":{"line":20,"column":0},"end":{"line":20,"column":null}}},"fnMap":{},"branchMap":{},"s":{"0":3,"1":3,"2":3,"3":3,"4":3,"5":3},"f":{},"b":{}} +,"/Users/zane/playground/liquid-labs/semver-plus/src/filter-valid-version-or-range.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/filter-valid-version-or-range.mjs","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":3,"column":34},"end":{"line":6,"column":73}},"2":{"start":{"line":4,"column":7},"end":{"line":4,"column":16}},"3":{"start":{"line":6,"column":6},"end":{"line":6,"column":73}},"4":{"start":{"line":6,"column":26},"end":{"line":6,"column":72}},"5":{"start":{"line":6,"column":73},"end":{"line":6,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":3,"column":34},"end":{"line":3,"column":35}},"loc":{"start":{"line":6,"column":6},"end":{"line":6,"column":73}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":4,"column":7},"end":{"line":4,"column":16}},"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":16}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":6,"column":20},"end":{"line":6,"column":21}},"loc":{"start":{"line":6,"column":26},"end":{"line":6,"column":72}}}},"branchMap":{"0":{"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":null}},"type":"default-arg","locations":[{"start":{"line":4,"column":7},"end":{"line":4,"column":null}}]}},"s":{"0":1,"1":1,"2":0,"3":1,"4":10,"5":1},"f":{"0":1,"1":0,"2":10},"b":{"0":[0]}} +,"/Users/zane/playground/liquid-labs/semver-plus/src/first-past.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/first-past.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":7,"column":19},"end":{"line":35,"column":1}},"5":{"start":{"line":8,"column":19},"end":{"line":8,"column":36}},"6":{"start":{"line":10,"column":20},"end":{"line":10,"column":90}},"7":{"start":{"line":11,"column":25},"end":{"line":11,"column":59}},"8":{"start":{"line":12,"column":2},"end":{"line":14,"column":null}},"9":{"start":{"line":13,"column":4},"end":{"line":13,"column":null}},"10":{"start":{"line":16,"column":20},"end":{"line":16,"column":90}},"11":{"start":{"line":17,"column":25},"end":{"line":17,"column":59}},"12":{"start":{"line":18,"column":2},"end":{"line":20,"column":null}},"13":{"start":{"line":19,"column":4},"end":{"line":19,"column":null}},"14":{"start":{"line":22,"column":20},"end":{"line":22,"column":90}},"15":{"start":{"line":23,"column":25},"end":{"line":23,"column":59}},"16":{"start":{"line":24,"column":2},"end":{"line":26,"column":null}},"17":{"start":{"line":25,"column":4},"end":{"line":25,"column":null}},"18":{"start":{"line":28,"column":2},"end":{"line":31,"column":null}},"19":{"start":{"line":29,"column":28},"end":{"line":29,"column":86}},"20":{"start":{"line":30,"column":4},"end":{"line":30,"column":null}},"21":{"start":{"line":34,"column":2},"end":{"line":34,"column":null}},"22":{"start":{"line":35,"column":1},"end":{"line":35,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":7,"column":19},"end":{"line":7,"column":24}},"loc":{"start":{"line":7,"column":29},"end":{"line":35,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":12,"column":2},"end":{"line":14,"column":null}},"type":"if","locations":[{"start":{"line":12,"column":2},"end":{"line":14,"column":null}}]},"1":{"loc":{"start":{"line":18,"column":2},"end":{"line":20,"column":null}},"type":"if","locations":[{"start":{"line":18,"column":2},"end":{"line":20,"column":null}}]},"2":{"loc":{"start":{"line":24,"column":2},"end":{"line":26,"column":null}},"type":"if","locations":[{"start":{"line":24,"column":2},"end":{"line":26,"column":null}}]},"3":{"loc":{"start":{"line":28,"column":2},"end":{"line":31,"column":null}},"type":"if","locations":[{"start":{"line":28,"column":2},"end":{"line":31,"column":null}}]}},"s":{"0":2,"1":2,"2":2,"3":2,"4":2,"5":46,"6":46,"7":46,"8":46,"9":8,"10":38,"11":38,"12":38,"13":15,"14":23,"15":23,"16":23,"17":17,"18":6,"19":6,"20":6,"21":0,"22":2},"f":{"0":46},"b":{"0":[8],"1":[15],"2":[17],"3":[6]}} +,"/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":5,"column":20},"end":{"line":19,"column":1}},"3":{"start":{"line":8,"column":2},"end":{"line":16,"column":null}},"4":{"start":{"line":9,"column":4},"end":{"line":9,"column":null}},"5":{"start":{"line":12,"column":24},"end":{"line":12,"column":48}},"6":{"start":{"line":13,"column":4},"end":{"line":15,"column":null}},"7":{"start":{"line":14,"column":6},"end":{"line":14,"column":null}},"8":{"start":{"line":18,"column":2},"end":{"line":18,"column":null}},"9":{"start":{"line":19,"column":1},"end":{"line":19,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":5,"column":20},"end":{"line":5,"column":25}},"loc":{"start":{"line":5,"column":30},"end":{"line":19,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":8,"column":2},"end":{"line":16,"column":null}},"type":"if","locations":[{"start":{"line":8,"column":2},"end":{"line":16,"column":null}},{"start":{"line":11,"column":7},"end":{"line":16,"column":null}}]},"1":{"loc":{"start":{"line":13,"column":4},"end":{"line":15,"column":null}},"type":"if","locations":[{"start":{"line":13,"column":4},"end":{"line":15,"column":null}}]}},"s":{"0":3,"1":3,"2":3,"3":58,"4":12,"5":46,"6":46,"7":46,"8":0,"9":3},"f":{"0":58},"b":{"0":[12,46],"1":[46]}} +,"/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":19,"column":20},"end":{"line":82,"column":1}},"4":{"start":{"line":20,"column":2},"end":{"line":22,"column":null}},"5":{"start":{"line":21,"column":4},"end":{"line":21,"column":null}},"6":{"start":{"line":24,"column":2},"end":{"line":24,"column":null}},"7":{"start":{"line":28,"column":23},"end":{"line":28,"column":101}},"8":{"start":{"line":29,"column":2},"end":{"line":32,"column":null}},"9":{"start":{"line":29,"column":34},"end":{"line":29,"column":null}},"10":{"start":{"line":30,"column":7},"end":{"line":32,"column":null}},"11":{"start":{"line":31,"column":4},"end":{"line":31,"column":null}},"12":{"start":{"line":34,"column":2},"end":{"line":36,"column":null}},"13":{"start":{"line":35,"column":4},"end":{"line":35,"column":null}},"14":{"start":{"line":37,"column":2},"end":{"line":45,"column":null}},"15":{"start":{"line":38,"column":4},"end":{"line":44,"column":null}},"16":{"start":{"line":39,"column":6},"end":{"line":39,"column":null}},"17":{"start":{"line":40,"column":6},"end":{"line":40,"column":null}},"18":{"start":{"line":43,"column":6},"end":{"line":43,"column":null}},"19":{"start":{"line":48,"column":2},"end":{"line":74,"column":null}},"20":{"start":{"line":49,"column":4},"end":{"line":53,"column":null}},"21":{"start":{"line":49,"column":36},"end":{"line":49,"column":null}},"22":{"start":{"line":50,"column":9},"end":{"line":53,"column":null}},"23":{"start":{"line":50,"column":40},"end":{"line":50,"column":null}},"24":{"start":{"line":51,"column":9},"end":{"line":53,"column":null}},"25":{"start":{"line":52,"column":6},"end":{"line":52,"column":null}},"26":{"start":{"line":55,"column":4},"end":{"line":55,"column":19}},"27":{"start":{"line":57,"column":7},"end":{"line":74,"column":null}},"28":{"start":{"line":58,"column":32},"end":{"line":60,"column":44}},"29":{"start":{"line":61,"column":30},"end":{"line":61,"column":61}},"30":{"start":{"line":62,"column":4},"end":{"line":64,"column":null}},"31":{"start":{"line":63,"column":6},"end":{"line":63,"column":null}},"32":{"start":{"line":66,"column":4},"end":{"line":71,"column":null}},"33":{"start":{"line":67,"column":6},"end":{"line":67,"column":null}},"34":{"start":{"line":70,"column":6},"end":{"line":70,"column":null}},"35":{"start":{"line":73,"column":4},"end":{"line":73,"column":null}},"36":{"start":{"line":77,"column":2},"end":{"line":79,"column":null}},"37":{"start":{"line":81,"column":2},"end":{"line":81,"column":null}},"38":{"start":{"line":82,"column":1},"end":{"line":82,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":19,"column":20},"end":{"line":19,"column":21}},"loc":{"start":{"line":19,"column":63},"end":{"line":82,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":19,"column":43},"end":{"line":19,"column":57}},"type":"default-arg","locations":[{"start":{"line":19,"column":51},"end":{"line":19,"column":57}}]},"1":{"loc":{"start":{"line":20,"column":2},"end":{"line":22,"column":null}},"type":"if","locations":[{"start":{"line":20,"column":2},"end":{"line":22,"column":null}}]},"2":{"loc":{"start":{"line":20,"column":6},"end":{"line":20,"column":64}},"type":"binary-expr","locations":[{"start":{"line":20,"column":6},"end":{"line":20,"column":29}},{"start":{"line":20,"column":33},"end":{"line":20,"column":64}}]},"3":{"loc":{"start":{"line":24,"column":14},"end":{"line":24,"column":81}},"type":"binary-expr","locations":[{"start":{"line":24,"column":14},"end":{"line":24,"column":23}},{"start":{"line":24,"column":28},"end":{"line":24,"column":80}}]},"4":{"loc":{"start":{"line":24,"column":28},"end":{"line":24,"column":80}},"type":"cond-expr","locations":[{"start":{"line":24,"column":58},"end":{"line":24,"column":65}},{"start":{"line":24,"column":68},"end":{"line":24,"column":80}}]},"5":{"loc":{"start":{"line":29,"column":2},"end":{"line":32,"column":null}},"type":"if","locations":[{"start":{"line":29,"column":2},"end":{"line":32,"column":null}},{"start":{"line":30,"column":7},"end":{"line":32,"column":null}}]},"6":{"loc":{"start":{"line":30,"column":7},"end":{"line":32,"column":null}},"type":"if","locations":[{"start":{"line":30,"column":7},"end":{"line":32,"column":null}}]},"7":{"loc":{"start":{"line":34,"column":2},"end":{"line":36,"column":null}},"type":"if","locations":[{"start":{"line":34,"column":2},"end":{"line":36,"column":null}}]},"8":{"loc":{"start":{"line":34,"column":6},"end":{"line":34,"column":73}},"type":"binary-expr","locations":[{"start":{"line":34,"column":6},"end":{"line":34,"column":29}},{"start":{"line":34,"column":33},"end":{"line":34,"column":73}}]},"9":{"loc":{"start":{"line":37,"column":2},"end":{"line":45,"column":null}},"type":"if","locations":[{"start":{"line":37,"column":2},"end":{"line":45,"column":null}}]},"10":{"loc":{"start":{"line":37,"column":6},"end":{"line":37,"column":74}},"type":"binary-expr","locations":[{"start":{"line":37,"column":6},"end":{"line":37,"column":29}},{"start":{"line":37,"column":33},"end":{"line":37,"column":74}}]},"11":{"loc":{"start":{"line":38,"column":4},"end":{"line":44,"column":null}},"type":"if","locations":[{"start":{"line":38,"column":4},"end":{"line":44,"column":null}},{"start":{"line":42,"column":9},"end":{"line":44,"column":null}}]},"12":{"loc":{"start":{"line":48,"column":2},"end":{"line":74,"column":null}},"type":"if","locations":[{"start":{"line":48,"column":2},"end":{"line":74,"column":null}},{"start":{"line":57,"column":7},"end":{"line":74,"column":null}}]},"13":{"loc":{"start":{"line":49,"column":4},"end":{"line":53,"column":null}},"type":"if","locations":[{"start":{"line":49,"column":4},"end":{"line":53,"column":null}},{"start":{"line":50,"column":9},"end":{"line":53,"column":null}}]},"14":{"loc":{"start":{"line":50,"column":9},"end":{"line":53,"column":null}},"type":"if","locations":[{"start":{"line":50,"column":9},"end":{"line":53,"column":null}},{"start":{"line":51,"column":9},"end":{"line":53,"column":null}}]},"15":{"loc":{"start":{"line":51,"column":9},"end":{"line":53,"column":null}},"type":"if","locations":[{"start":{"line":51,"column":9},"end":{"line":53,"column":null}}]},"16":{"loc":{"start":{"line":57,"column":7},"end":{"line":74,"column":null}},"type":"if","locations":[{"start":{"line":57,"column":7},"end":{"line":74,"column":null}}]},"17":{"loc":{"start":{"line":58,"column":32},"end":{"line":60,"column":44}},"type":"cond-expr","locations":[{"start":{"line":59,"column":8},"end":{"line":59,"column":36}},{"start":{"line":60,"column":8},"end":{"line":60,"column":44}}]},"18":{"loc":{"start":{"line":62,"column":4},"end":{"line":64,"column":null}},"type":"if","locations":[{"start":{"line":62,"column":4},"end":{"line":64,"column":null}}]},"19":{"loc":{"start":{"line":63,"column":78},"end":{"line":63,"column":103}},"type":"binary-expr","locations":[{"start":{"line":63,"column":78},"end":{"line":63,"column":92}},{"start":{"line":63,"column":96},"end":{"line":63,"column":103}}]},"20":{"loc":{"start":{"line":66,"column":4},"end":{"line":71,"column":null}},"type":"if","locations":[{"start":{"line":66,"column":4},"end":{"line":71,"column":null}},{"start":{"line":69,"column":9},"end":{"line":71,"column":null}}]},"21":{"loc":{"start":{"line":77,"column":12},"end":{"line":79,"column":36}},"type":"cond-expr","locations":[{"start":{"line":78,"column":6},"end":{"line":78,"column":45}},{"start":{"line":79,"column":6},"end":{"line":79,"column":36}}]},"22":{"loc":{"start":{"line":77,"column":12},"end":{"line":77,"column":70}},"type":"binary-expr","locations":[{"start":{"line":77,"column":12},"end":{"line":77,"column":39}},{"start":{"line":77,"column":43},"end":{"line":77,"column":70}}]}},"s":{"0":3,"1":3,"2":3,"3":3,"4":171,"5":1,"6":170,"7":170,"8":170,"9":100,"10":70,"11":1,"12":169,"13":4,"14":165,"15":24,"16":18,"17":18,"18":6,"19":159,"20":10,"21":4,"22":6,"23":3,"24":3,"25":3,"26":10,"27":149,"28":29,"29":29,"30":29,"31":5,"32":24,"33":21,"34":3,"35":24,"36":120,"37":120,"38":3},"f":{"0":171},"b":{"0":[64],"1":[1],"2":[171,167],"3":[170,4],"4":[1,3],"5":[100,70],"6":[1],"7":[4],"8":[169,100],"9":[24],"10":[165,69],"11":[18,6],"12":[10,149],"13":[4,6],"14":[3,3],"15":[3],"16":[29],"17":[0,29],"18":[5],"19":[5,0],"20":[21,3],"21":[3,117],"22":[120,9]}} +,"/Users/zane/playground/liquid-labs/semver-plus/src/prerelease.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/prerelease.mjs","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":3,"column":20},"end":{"line":5,"column":1}},"2":{"start":{"line":4,"column":2},"end":{"line":4,"column":null}},"3":{"start":{"line":5,"column":1},"end":{"line":5,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":3,"column":20},"end":{"line":3,"column":27}},"loc":{"start":{"line":3,"column":32},"end":{"line":5,"column":1}}}},"branchMap":{},"s":{"0":1,"1":1,"2":3,"3":1},"f":{"0":3},"b":{}} +,"/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":5,"column":28},"end":{"line":13,"column":53}},"3":{"start":{"line":8,"column":7},"end":{"line":8,"column":16}},"4":{"start":{"line":11,"column":3},"end":{"line":13,"column":53}},"5":{"start":{"line":13,"column":53},"end":{"line":13,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":5,"column":28},"end":{"line":5,"column":29}},"loc":{"start":{"line":11,"column":3},"end":{"line":13,"column":53}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":8,"column":7},"end":{"line":8,"column":16}},"loc":{"start":{"line":8,"column":7},"end":{"line":8,"column":16}}}},"branchMap":{"0":{"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":25}},"type":"default-arg","locations":[{"start":{"line":6,"column":20},"end":{"line":6,"column":25}}]},"1":{"loc":{"start":{"line":7,"column":2},"end":{"line":7,"column":27}},"type":"default-arg","locations":[{"start":{"line":7,"column":22},"end":{"line":7,"column":27}}]},"2":{"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":null}},"type":"default-arg","locations":[{"start":{"line":8,"column":7},"end":{"line":8,"column":null}}]},"3":{"loc":{"start":{"line":9,"column":2},"end":{"line":9,"column":null}},"type":"default-arg","locations":[{"start":{"line":9,"column":15},"end":{"line":9,"column":null}}]},"4":{"loc":{"start":{"line":11,"column":3},"end":{"line":13,"column":53}},"type":"binary-expr","locations":[{"start":{"line":11,"column":3},"end":{"line":11,"column":29}},{"start":{"line":11,"column":33},"end":{"line":11,"column":52}},{"start":{"line":12,"column":8},"end":{"line":12,"column":27}},{"start":{"line":12,"column":31},"end":{"line":12,"column":55}},{"start":{"line":12,"column":59},"end":{"line":12,"column":84}},{"start":{"line":13,"column":8},"end":{"line":13,"column":27}},{"start":{"line":13,"column":31},"end":{"line":13,"column":53}}]}},"s":{"0":1,"1":1,"2":1,"3":0,"4":10,"5":1},"f":{"0":10,"1":0},"b":{"0":[10],"1":[10],"2":[0],"3":[0],"4":[10,10,7,0,0,7,7]}} +,"/Users/zane/playground/liquid-labs/semver-plus/src/version-compare.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/version-compare.mjs","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":3,"column":22},"end":{"line":16,"column":1}},"2":{"start":{"line":5,"column":2},"end":{"line":13,"column":null}},"3":{"start":{"line":5,"column":15},"end":{"line":5,"column":16}},"4":{"start":{"line":6,"column":20},"end":{"line":6,"column":31}},"5":{"start":{"line":7,"column":4},"end":{"line":12,"column":null}},"6":{"start":{"line":8,"column":6},"end":{"line":8,"column":null}},"7":{"start":{"line":10,"column":9},"end":{"line":12,"column":null}},"8":{"start":{"line":11,"column":6},"end":{"line":11,"column":null}},"9":{"start":{"line":15,"column":2},"end":{"line":15,"column":null}},"10":{"start":{"line":18,"column":19},"end":{"line":26,"column":1}},"11":{"start":{"line":19,"column":2},"end":{"line":21,"column":null}},"12":{"start":{"line":20,"column":4},"end":{"line":20,"column":null}},"13":{"start":{"line":23,"column":2},"end":{"line":23,"column":null}},"14":{"start":{"line":25,"column":2},"end":{"line":25,"column":null}},"15":{"start":{"line":25,"column":73},"end":{"line":25,"column":95}},"16":{"start":{"line":26,"column":1},"end":{"line":26,"column":null}},"17":{"start":{"line":28,"column":19},"end":{"line":36,"column":1}},"18":{"start":{"line":29,"column":2},"end":{"line":31,"column":null}},"19":{"start":{"line":30,"column":4},"end":{"line":30,"column":null}},"20":{"start":{"line":33,"column":2},"end":{"line":33,"column":null}},"21":{"start":{"line":35,"column":2},"end":{"line":35,"column":null}},"22":{"start":{"line":35,"column":73},"end":{"line":35,"column":95}},"23":{"start":{"line":36,"column":1},"end":{"line":36,"column":null}},"24":{"start":{"line":38,"column":28},"end":{"line":55,"column":1}},"25":{"start":{"line":39,"column":2},"end":{"line":52,"column":null}},"26":{"start":{"line":40,"column":18},"end":{"line":40,"column":48}},"27":{"start":{"line":42,"column":4},"end":{"line":49,"column":null}},"28":{"start":{"line":43,"column":6},"end":{"line":48,"column":null}},"29":{"start":{"line":44,"column":8},"end":{"line":44,"column":null}},"30":{"start":{"line":47,"column":8},"end":{"line":47,"column":null}},"31":{"start":{"line":51,"column":4},"end":{"line":51,"column":null}},"32":{"start":{"line":54,"column":2},"end":{"line":54,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":3,"column":22},"end":{"line":3,"column":23}},"loc":{"start":{"line":3,"column":65},"end":{"line":16,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":18,"column":19},"end":{"line":18,"column":20}},"loc":{"start":{"line":18,"column":56},"end":{"line":26,"column":1}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":25,"column":63},"end":{"line":25,"column":64}},"loc":{"start":{"line":25,"column":73},"end":{"line":25,"column":95}}},"3":{"name":"(anonymous_3)","decl":{"start":{"line":28,"column":19},"end":{"line":28,"column":20}},"loc":{"start":{"line":28,"column":56},"end":{"line":36,"column":1}}},"4":{"name":"(anonymous_4)","decl":{"start":{"line":35,"column":63},"end":{"line":35,"column":64}},"loc":{"start":{"line":35,"column":73},"end":{"line":35,"column":95}}},"5":{"name":"(anonymous_5)","decl":{"start":{"line":38,"column":28},"end":{"line":38,"column":29}},"loc":{"start":{"line":38,"column":65},"end":{"line":55,"column":1}}},"6":{"name":"(anonymous_6)","decl":{"start":{"line":39,"column":30},"end":{"line":39,"column":37}},"loc":{"start":{"line":39,"column":42},"end":{"line":52,"column":3}}}},"branchMap":{"0":{"loc":{"start":{"line":7,"column":4},"end":{"line":12,"column":null}},"type":"if","locations":[{"start":{"line":7,"column":4},"end":{"line":12,"column":null}},{"start":{"line":10,"column":9},"end":{"line":12,"column":null}}]},"1":{"loc":{"start":{"line":10,"column":9},"end":{"line":12,"column":null}},"type":"if","locations":[{"start":{"line":10,"column":9},"end":{"line":12,"column":null}}]},"2":{"loc":{"start":{"line":19,"column":2},"end":{"line":21,"column":null}},"type":"if","locations":[{"start":{"line":19,"column":2},"end":{"line":21,"column":null}}]},"3":{"loc":{"start":{"line":19,"column":6},"end":{"line":19,"column":40}},"type":"binary-expr","locations":[{"start":{"line":19,"column":6},"end":{"line":19,"column":15}},{"start":{"line":19,"column":19},"end":{"line":19,"column":40}}]},"4":{"loc":{"start":{"line":29,"column":2},"end":{"line":31,"column":null}},"type":"if","locations":[{"start":{"line":29,"column":2},"end":{"line":31,"column":null}}]},"5":{"loc":{"start":{"line":29,"column":6},"end":{"line":29,"column":40}},"type":"binary-expr","locations":[{"start":{"line":29,"column":6},"end":{"line":29,"column":15}},{"start":{"line":29,"column":19},"end":{"line":29,"column":40}}]},"6":{"loc":{"start":{"line":42,"column":4},"end":{"line":49,"column":null}},"type":"if","locations":[{"start":{"line":42,"column":4},"end":{"line":49,"column":null}}]},"7":{"loc":{"start":{"line":43,"column":6},"end":{"line":48,"column":null}},"type":"if","locations":[{"start":{"line":43,"column":6},"end":{"line":48,"column":null}},{"start":{"line":46,"column":11},"end":{"line":48,"column":null}}]}},"s":{"0":1,"1":1,"2":14,"3":14,"4":30,"5":30,"6":14,"7":16,"8":8,"9":14,"10":1,"11":9,"12":1,"13":8,"14":7,"15":0,"16":1,"17":1,"18":9,"19":1,"20":8,"21":7,"22":0,"23":1,"24":1,"25":16,"26":38,"27":38,"28":6,"29":4,"30":2,"31":32,"32":14},"f":{"0":14,"1":9,"2":0,"3":9,"4":0,"5":16,"6":38},"b":{"0":[14,16],"1":[8],"2":[1],"3":[9,9],"4":[1],"5":[9,9],"6":[6],"7":[4,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":9,"column":15},"end":{"line":100,"column":1}},"4":{"start":{"line":11,"column":19},"end":{"line":11,"column":21}},"5":{"start":{"line":12,"column":17},"end":{"line":12,"column":19}},"6":{"start":{"line":15,"column":2},"end":{"line":15,"column":null}},"7":{"start":{"line":15,"column":60},"end":{"line":15,"column":78}},"8":{"start":{"line":17,"column":2},"end":{"line":36,"column":null}},"9":{"start":{"line":18,"column":4},"end":{"line":35,"column":null}},"10":{"start":{"line":19,"column":6},"end":{"line":19,"column":null}},"11":{"start":{"line":22,"column":22},"end":{"line":22,"column":50}},"12":{"start":{"line":23,"column":6},"end":{"line":34,"column":null}},"13":{"start":{"line":24,"column":8},"end":{"line":24,"column":null}},"14":{"start":{"line":27,"column":22},"end":{"line":27,"column":55}},"15":{"start":{"line":28,"column":8},"end":{"line":33,"column":null}},"16":{"start":{"line":29,"column":10},"end":{"line":29,"column":null}},"17":{"start":{"line":32,"column":10},"end":{"line":32,"column":null}},"18":{"start":{"line":38,"column":25},"end":{"line":38,"column":54}},"19":{"start":{"line":40,"column":23},"end":{"line":56,"column":4}},"20":{"start":{"line":41,"column":23},"end":{"line":41,"column":35}},"21":{"start":{"line":42,"column":23},"end":{"line":42,"column":35}},"22":{"start":{"line":44,"column":4},"end":{"line":55,"column":null}},"23":{"start":{"line":45,"column":6},"end":{"line":45,"column":null}},"24":{"start":{"line":47,"column":9},"end":{"line":55,"column":null}},"25":{"start":{"line":48,"column":6},"end":{"line":48,"column":null}},"26":{"start":{"line":50,"column":9},"end":{"line":55,"column":null}},"27":{"start":{"line":51,"column":6},"end":{"line":51,"column":null}},"28":{"start":{"line":54,"column":6},"end":{"line":54,"column":null}},"29":{"start":{"line":58,"column":2},"end":{"line":63,"column":null}},"30":{"start":{"line":59,"column":4},"end":{"line":59,"column":null}},"31":{"start":{"line":61,"column":7},"end":{"line":63,"column":null}},"32":{"start":{"line":62,"column":4},"end":{"line":62,"column":null}},"33":{"start":{"line":65,"column":20},"end":{"line":65,"column":33}},"34":{"start":{"line":67,"column":25},"end":{"line":67,"column":30}},"35":{"start":{"line":68,"column":2},"end":{"line":97,"column":null}},"36":{"start":{"line":69,"column":4},"end":{"line":72,"column":null}},"37":{"start":{"line":70,"column":6},"end":{"line":70,"column":null}},"38":{"start":{"line":71,"column":6},"end":{"line":71,"column":null}},"39":{"start":{"line":74,"column":24},"end":{"line":74,"column":67}},"40":{"start":{"line":75,"column":4},"end":{"line":96,"column":null}},"41":{"start":{"line":76,"column":33},"end":{"line":76,"column":63}},"42":{"start":{"line":80,"column":32},"end":{"line":80,"column":111}},"43":{"start":{"line":80,"column":92},"end":{"line":80,"column":110}},"44":{"start":{"line":81,"column":6},"end":{"line":87,"column":null}},"45":{"start":{"line":82,"column":8},"end":{"line":82,"column":null}},"46":{"start":{"line":83,"column":8},"end":{"line":83,"column":null}},"47":{"start":{"line":86,"column":8},"end":{"line":86,"column":null}},"48":{"start":{"line":89,"column":9},"end":{"line":96,"column":null}},"49":{"start":{"line":90,"column":33},"end":{"line":90,"column":69}},"50":{"start":{"line":91,"column":6},"end":{"line":91,"column":null}},"51":{"start":{"line":93,"column":9},"end":{"line":96,"column":null}},"52":{"start":{"line":94,"column":6},"end":{"line":94,"column":null}},"53":{"start":{"line":95,"column":6},"end":{"line":95,"column":null}},"54":{"start":{"line":99,"column":2},"end":{"line":99,"column":null}},"55":{"start":{"line":100,"column":1},"end":{"line":100,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":9,"column":15},"end":{"line":9,"column":32}},"loc":{"start":{"line":9,"column":37},"end":{"line":100,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":15,"column":47},"end":{"line":15,"column":48}},"loc":{"start":{"line":15,"column":60},"end":{"line":15,"column":78}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":40,"column":35},"end":{"line":40,"column":36}},"loc":{"start":{"line":40,"column":45},"end":{"line":56,"column":3}}},"3":{"name":"(anonymous_3)","decl":{"start":{"line":80,"column":83},"end":{"line":80,"column":87}},"loc":{"start":{"line":80,"column":92},"end":{"line":80,"column":110}}}},"branchMap":{"0":{"loc":{"start":{"line":18,"column":4},"end":{"line":35,"column":null}},"type":"if","locations":[{"start":{"line":18,"column":4},"end":{"line":35,"column":null}},{"start":{"line":21,"column":9},"end":{"line":35,"column":null}}]},"1":{"loc":{"start":{"line":23,"column":6},"end":{"line":34,"column":null}},"type":"if","locations":[{"start":{"line":23,"column":6},"end":{"line":34,"column":null}},{"start":{"line":26,"column":11},"end":{"line":34,"column":null}}]},"2":{"loc":{"start":{"line":28,"column":8},"end":{"line":33,"column":null}},"type":"if","locations":[{"start":{"line":28,"column":8},"end":{"line":33,"column":null}},{"start":{"line":31,"column":13},"end":{"line":33,"column":null}}]},"3":{"loc":{"start":{"line":44,"column":4},"end":{"line":55,"column":null}},"type":"if","locations":[{"start":{"line":44,"column":4},"end":{"line":55,"column":null}},{"start":{"line":47,"column":9},"end":{"line":55,"column":null}}]},"4":{"loc":{"start":{"line":44,"column":8},"end":{"line":44,"column":50}},"type":"binary-expr","locations":[{"start":{"line":44,"column":8},"end":{"line":44,"column":27}},{"start":{"line":44,"column":31},"end":{"line":44,"column":50}}]},"5":{"loc":{"start":{"line":47,"column":9},"end":{"line":55,"column":null}},"type":"if","locations":[{"start":{"line":47,"column":9},"end":{"line":55,"column":null}},{"start":{"line":50,"column":9},"end":{"line":55,"column":null}}]},"6":{"loc":{"start":{"line":50,"column":9},"end":{"line":55,"column":null}},"type":"if","locations":[{"start":{"line":50,"column":9},"end":{"line":55,"column":null}},{"start":{"line":53,"column":9},"end":{"line":55,"column":null}}]},"7":{"loc":{"start":{"line":58,"column":2},"end":{"line":63,"column":null}},"type":"if","locations":[{"start":{"line":58,"column":2},"end":{"line":63,"column":null}},{"start":{"line":61,"column":7},"end":{"line":63,"column":null}}]},"8":{"loc":{"start":{"line":61,"column":7},"end":{"line":63,"column":null}},"type":"if","locations":[{"start":{"line":61,"column":7},"end":{"line":63,"column":null}}]},"9":{"loc":{"start":{"line":69,"column":4},"end":{"line":72,"column":null}},"type":"if","locations":[{"start":{"line":69,"column":4},"end":{"line":72,"column":null}}]},"10":{"loc":{"start":{"line":75,"column":4},"end":{"line":96,"column":null}},"type":"if","locations":[{"start":{"line":75,"column":4},"end":{"line":96,"column":null}},{"start":{"line":89,"column":9},"end":{"line":96,"column":null}}]},"11":{"loc":{"start":{"line":81,"column":6},"end":{"line":87,"column":null}},"type":"if","locations":[{"start":{"line":81,"column":6},"end":{"line":87,"column":null}},{"start":{"line":85,"column":11},"end":{"line":87,"column":null}}]},"12":{"loc":{"start":{"line":89,"column":9},"end":{"line":96,"column":null}},"type":"if","locations":[{"start":{"line":89,"column":9},"end":{"line":96,"column":null}},{"start":{"line":93,"column":9},"end":{"line":96,"column":null}}]},"13":{"loc":{"start":{"line":93,"column":9},"end":{"line":96,"column":null}},"type":"if","locations":[{"start":{"line":93,"column":9},"end":{"line":96,"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":0,"26":20,"27":7,"28":13,"29":16,"30":3,"31":13,"32":4,"33":9,"34":9,"35":9,"36":19,"37":9,"38":9,"39":10,"40":10,"41":8,"42":8,"43":1,"44":8,"45":7,"46":7,"47":1,"48":2,"49":1,"50":1,"51":1,"52":1,"53":1,"54":9,"55":1},"f":{"0":16,"1":47,"2":20,"3":1},"b":{"0":[26,21],"1":[21,0],"2":[0,0],"3":[0,20],"4":[20,0],"5":[0,20],"6":[7,13],"7":[3,13],"8":[4],"9":[9],"10":[8,2],"11":[7,1],"12":[1,1],"13":[1]}} +} diff --git a/qa/coverage/ext-constants.mjs.html b/qa/coverage/ext-constants.mjs.html new file mode 100644 index 0000000..6b11f5f --- /dev/null +++ b/qa/coverage/ext-constants.mjs.html @@ -0,0 +1,145 @@ + + + + + + Code coverage report for ext-constants.mjs + + + + + + + + + +
+
+

All files ext-constants.mjs

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

+ 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 +213x +  +  +  +  +  +  +  +  +  +  +  +  +  +3x +3x +  +3x +3x +3x + 
export const increments = [
+  'major',
+  'minor',
+  'patch',
+  'premajor',
+  'preminor',
+  'prepatch',
+  'prerelease',
+  'pretype',
+  'alpha',
+  'beta',
+  'rc',
+  'gold'
+]
+export const prereleaseIncrements = ['prerelease', 'pretype', 'alpha', 'beta', 'rc', 'gold']
+export const releaseTypes = ['alpha', 'beta', 'rc', 'gold']
+ 
+Object.freeze(increments)
+Object.freeze(prereleaseIncrements)
+Object.freeze(releaseTypes)
+ 
+ +
+
+ + + + + + + + \ No newline at end of file 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 filter-valid-version-or-range.mjs + + + + + + + + + +
+
+

All files filter-valid-version-or-range.mjs

+
+ +
+ 83.33% + Statements + 5/6 +
+ + +
+ 0% + Branches + 0/1 +
+ + +
+ 66.66% + Functions + 2/3 +
+ + +
+ 75% + Lines + 3/4 +
+ + +
+

+ 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 +91x +  +1x +  +  +10x +  +  + 
import { validVersionOrRange } from './valid-version-or-range'
+ 
+const filterValidVersionOrRange = ({
+  input = throw new Error("'input' is required."),
+  ...options
+}) => input.filter((i) => validVersionOrRange({ input : i, ...options }))
+ 
+export { filterValidVersionOrRange }
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/qa/coverage/first-past.mjs.html b/qa/coverage/first-past.mjs.html new file mode 100644 index 0000000..899fdb2 --- /dev/null +++ b/qa/coverage/first-past.mjs.html @@ -0,0 +1,196 @@ + + + + + + Code coverage report for first-past.mjs + + + + + + + + + +
+
+

All files first-past.mjs

+
+ +
+ 95.65% + Statements + 22/23 +
+ + +
+ 100% + Branches + 4/4 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 95.65% + Lines + 22/23 +
+ + +
+

+ 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 +382x +  +2x +2x +2x +  +2x +46x +  +46x +46x +46x +8x +  +  +38x +38x +38x +15x +  +  +23x +23x +23x +17x +  +  +6x +6x +6x +  +  +  +  +2x +  +  + 
import semver from 'semver'
+ 
+import { prereleaseXRangeRE } from './constants'
+import { minVersion } from './min-version'
+import { nextVersion } from './next-version'
+ 
+const firstPast = (range) => {
+  const rangeMin = minVersion(range)
+ 
+  const nextMajor = nextVersion({ currVer : rangeMin, increment : 'major', loose : true })
+  const nextMajorValid = semver.satisfies(nextMajor, range)
+  if (nextMajorValid) {
+    return null
+  }
+ 
+  const nextMinor = nextVersion({ currVer : rangeMin, increment : 'minor', loose : true })
+  const nextMinorValid = semver.satisfies(nextMinor, range)
+  if (nextMinorValid === true) {
+    return nextMajor
+  }
+ 
+  const nextPatch = nextVersion({ currVer : rangeMin, increment : 'patch', loose : true })
+  const nextPatchValid = semver.satisfies(nextPatch, range)
+  if (nextPatchValid === true) {
+    return nextMinor
+  }
+ 
+  if (range.match(prereleaseXRangeRE)) {
+    const nextReleaseType = nextVersion({ currVer : rangeMin, increment : 'pretype' })
+    return nextReleaseType
+  }
+ 
+  // else
+  throw new Error(`Cannot determine first-past version for range: '${range}'.`)
+}
+ 
+export { firstPast }
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/qa/coverage/index.html b/qa/coverage/index.html new file mode 100644 index 0000000..b9a69f8 --- /dev/null +++ b/qa/coverage/index.html @@ -0,0 +1,251 @@ + + + + + + Code coverage report for All files + + + + + + + + + +
+
+

All files

+
+ +
+ 93.51% + Statements + 173/185 +
+ + +
+ 86.17% + Branches + 81/94 +
+ + +
+ 80% + Functions + 16/20 +
+ + +
+ 94.28% + Lines + 165/175 +
+ + +
+

+ 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%6/6100%0/0100%0/0100%6/6
filter-valid-version-or-range.mjs +
+
83.33%5/60%0/166.66%2/375%3/4
first-past.mjs +
+
95.65%22/23100%4/4100%1/195.65%22/23
min-version.mjs +
+
90%9/10100%3/3100%1/190%9/10
next-version.mjs +
+
100%39/3994.73%36/38100%1/1100%36/36
prerelease.mjs +
+
100%4/4100%0/0100%1/1100%4/4
valid-version-or-range.mjs +
+
83.33%5/663.63%7/1150%1/283.33%5/6
version-compare.mjs +
+
93.93%31/33100%12/1271.42%5/7100%30/30
x-sort.mjs +
+
89.28%50/5676%19/25100%4/488.88%48/54
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/qa/coverage/min-version.mjs.html b/qa/coverage/min-version.mjs.html new file mode 100644 index 0000000..9ca11e9 --- /dev/null +++ b/qa/coverage/min-version.mjs.html @@ -0,0 +1,148 @@ + + + + + + Code coverage report for min-version.mjs + + + + + + + + + +
+
+

All files min-version.mjs

+
+ +
+ 90% + Statements + 9/10 +
+ + +
+ 100% + Branches + 3/3 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 90% + Lines + 9/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 +223x +  +3x +  +3x +  +  +58x +12x +  +  +46x +46x +46x +  +  +  +  +3x +  +  + 
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 }
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/qa/coverage/next-version.mjs.html b/qa/coverage/next-version.mjs.html new file mode 100644 index 0000000..1cc585c --- /dev/null +++ b/qa/coverage/next-version.mjs.html @@ -0,0 +1,337 @@ + + + + + + Code coverage report for next-version.mjs + + + + + + + + + +
+
+

All files next-version.mjs

+
+ +
+ 100% + Statements + 39/39 +
+ + +
+ 94.73% + Branches + 36/38 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 100% + Lines + 36/36 +
+ + +
+

+ 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 +853x +3x +  +3x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3x +171x +1x +  +  +170x +  +  +  +170x +170x +70x +1x +  +  +169x +4x +  +165x +24x +18x +18x +  +  +6x +  +  +  +  +159x +10x +6x +3x +3x +  +  +10x +  +149x +29x +  +  +29x +29x +5x +  +  +24x +21x +  +  +3x +  +  +24x +  +  +  +120x +  +  +  +120x +3x +  +  + 
import createError from 'http-errors'
+import semver from 'semver'
+ 
+import { increments, prereleaseIncrements, releaseTypes } 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
+ */
+const nextVersion = ({ currVer, increment, loose = false }) => {
+  if (increment !== undefined && !increments.includes(increment)) {
+    throw createError.BadRequest(`Invalid increment '${increment}' specified.`)
+  }
+  // what are we incrementing? default is patch for released and prerelease for pre-release projects
+  increment = increment || (currVer.match(/^[\d.Z-]+$/) ? 'patch' : 'prerelease')
+ 
+  let nextVer
+  // determine concrete value for increment
+  let currPrerelease = currVer.replace(/^[\d.Z]+-([0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*?)(?:\.\d+)?/, '$1')
+  if (currPrerelease === currVer) currPrerelease = null
+  else if (!releaseTypes.includes(currPrerelease)) {
+    throw createError.BadRequest(`Cannot handle unsupported pre-release '${currPrerelease}'. Prerelease ID must be one of 'alpha', 'beta', or 'rc'.`)
+  }
+ 
+  if (currPrerelease === null && prereleaseIncrements.includes(increment)) {
+    throw createError.BadRequest(`Cannot increment ${increment} for non-prerelease versions.`)
+  }
+  if (currPrerelease !== null && !prereleaseIncrements.includes(increment)) {
+    if (loose === true) {
+      currVer = nextVersion(({ currVer, increment : 'gold' }))
+      currPrerelease = undefined
+    }
+    else {
+      throw createError.BadRequest(`Prerelease version ${currVer} can only be incremented by 'prerelease' or 'pretype'.`)
+    }
+  }
+ 
+  // alpha -> beta -> rc
+  if (increment === 'pretype') {
+    if (currPrerelease === 'alpha') nextVer = currVer.replace(/([0-1.Z-]+)alpha(\.\d+)?/, '$1beta.0')
+    else if (currPrerelease === 'beta') nextVer = currVer.replace(/([0-1.Z-]+)beta(\.\d+)?/, '$1rc.0')
+    else if (currPrerelease === 'rc') { // is special in the case of timever + pretype
+      nextVer = currVer.replace(/([0-9.Z]+)-rc(?:\.\d+)?/, '$1')
+    }
+ 
+    return nextVer // we're done
+  }
+  else if (releaseTypes.includes(increment)) {
+    const currReleasePosition = currPrerelease === null
+      ? releaseTypes.indexOf('gold')
+      : releaseTypes.indexOf(currPrerelease)
+    const incrementPosition = releaseTypes.indexOf(increment)
+    if (incrementPosition <= currReleasePosition) {
+      throw createError.BadRequest(`Cannot move release type backwards from ${currPrerelease || 'gold'} to ${increment}.`)
+    }
+ 
+    if (increment === 'gold') {
+      nextVer = currVer.replace(/^([\d.Z]+)-(?:alpha|beta|rc)(?:\.\d+)?/, '$1')
+    }
+    else {
+      nextVer = currVer.replace(/^([\d.Z-]+)(?:alpha|beta|rc)(?:\.\d+)?/, `$1${increment}.0`)
+    }
+ 
+    return nextVer
+  }
+ 
+  // 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/prerelease.mjs.html b/qa/coverage/prerelease.mjs.html new file mode 100644 index 0000000..c91ba0c --- /dev/null +++ b/qa/coverage/prerelease.mjs.html @@ -0,0 +1,106 @@ + + + + + + Code coverage report for prerelease.mjs + + + + + + + + + +
+
+

All files prerelease.mjs

+
+ +
+ 100% + Statements + 4/4 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 100% + Lines + 4/4 +
+ + +
+

+ 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 +81x +  +1x +3x +1x +  +  + 
import semver from 'semver'
+ 
+const prerelease = (version) => {
+  return semver.prerelease(version)
+}
+ 
+export { prerelease }
+ 
+ +
+
+ + + + + + + + \ 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/valid-version-or-range.mjs.html b/qa/coverage/valid-version-or-range.mjs.html new file mode 100644 index 0000000..0579861 --- /dev/null +++ b/qa/coverage/valid-version-or-range.mjs.html @@ -0,0 +1,130 @@ + + + + + + Code coverage report for valid-version-or-range.mjs + + + + + + + + + +
+
+

All files valid-version-or-range.mjs

+
+ +
+ 83.33% + Statements + 5/6 +
+ + +
+ 63.63% + Branches + 7/11 +
+ + +
+ 50% + Functions + 1/2 +
+ + +
+ 83.33% + Lines + 5/6 +
+ + +
+

+ 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 +161x +  +1x +  +1x +  +  +  +  +  +10x +  +1x +  +  + 
import semver from 'semver'
+ 
+import { xRangeRE } from './constants'
+ 
+const validVersionOrRange = ({
+  dissallowRanges = false,
+  dissallowVersions = false,
+  input = throw new Error("'input' is required."),
+  onlyXRange = false
+}) =>
+  (dissallowVersions !== true && semver.valid(input))
+    || (onlyXRange !== true && dissallowRanges !== true && semver.validRange(input))
+    || (onlyXRange === true && input.match(xRangeRE))
+ 
+export { validVersionOrRange }
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/qa/coverage/version-compare.mjs.html b/qa/coverage/version-compare.mjs.html new file mode 100644 index 0000000..65514b2 --- /dev/null +++ b/qa/coverage/version-compare.mjs.html @@ -0,0 +1,256 @@ + + + + + + Code coverage report for version-compare.mjs + + + + + + + + + +
+
+

All files version-compare.mjs

+
+ +
+ 93.93% + Statements + 31/33 +
+ + +
+ 100% + Branches + 12/12 +
+ + +
+ 71.42% + Functions + 5/7 +
+ + +
+ 100% + Lines + 30/30 +
+ + +
+

+ 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 +581x +  +1x +  +14x +30x +30x +14x +  +16x +8x +  +  +  +14x +  +  +1x +9x +1x +  +  +8x +  +7x +1x +  +1x +9x +1x +  +  +8x +  +7x +1x +  +1x +16x +38x +  +38x +6x +4x +  +  +2x +  +  +  +32x +  +  +14x +  +  +  + 
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 }
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/qa/coverage/x-sort.mjs.html b/qa/coverage/x-sort.mjs.html new file mode 100644 index 0000000..d564870 --- /dev/null +++ b/qa/coverage/x-sort.mjs.html @@ -0,0 +1,391 @@ + + + + + + Code coverage report for x-sort.mjs + + + + + + + + + +
+
+

All files x-sort.mjs

+
+ +
+ 89.28% + Statements + 50/56 +
+ + +
+ 76% + Branches + 19/25 +
+ + +
+ 100% + Functions + 4/4 +
+ + +
+ 88.88% + Lines + 48/54 +
+ + +
+

+ 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 +1031x +  +1x +1x +  +  +  +  +1x +  +16x +16x +  +  +47x +  +16x +47x +26x +  +  +21x +21x +21x +  +  +  +  +  +  +  +  +  +  +  +  +  +16x +  +16x +20x +20x +  +20x +  +  +20x +  +  +20x +7x +  +  +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 { firstPast } from './first-past'
+ 
+/**
+ * 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.)
+ */
+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 = firstPast(a)
+    const firstPastB = firstPast(b)
+ 
+    Iif (firstPastA === null && firstPastB === null) {
+      return 0
+    }
+    else Iif (firstPastA === null) {
+      return 1
+    }
+    else if (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..a2ca597 --- /dev/null +++ b/qa/lint.txt @@ -0,0 +1 @@ +Test git rev: 0b5e561d02ac5a578f60fe90ee6a1c9816cfd188 diff --git a/qa/unit-test.txt b/qa/unit-test.txt new file mode 100644 index 0000000..4e05e8f --- /dev/null +++ b/qa/unit-test.txt @@ -0,0 +1,29 @@ +Test git rev: 0b5e561d02ac5a578f60fe90ee6a1c9816cfd188 +PASS test/version-compare.test.js +PASS test/next-version.test.js +PASS test/x-sort.test.js +PASS test/prerelease.test.js +PASS test/min-version.test.js +PASS test/filter-valid-version-or-range.test.js +PASS test/first-past.test.js +-----------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +-----------------------------------|---------|----------|---------|---------|------------------- +All files | 93.51 | 86.17 | 80 | 94.28 | + constants.mjs | 100 | 100 | 100 | 100 | + ext-constants.mjs | 100 | 100 | 100 | 100 | + filter-valid-version-or-range.mjs | 83.33 | 0 | 66.66 | 75 | 4 + first-past.mjs | 95.65 | 100 | 100 | 95.65 | 34 + min-version.mjs | 90 | 100 | 100 | 90 | 18 + next-version.mjs | 100 | 94.73 | 100 | 100 | 58,63 + prerelease.mjs | 100 | 100 | 100 | 100 | + valid-version-or-range.mjs | 83.33 | 63.63 | 50 | 83.33 | 8 + version-compare.mjs | 93.93 | 100 | 71.42 | 100 | + x-sort.mjs | 89.28 | 76 | 100 | 88.88 | 27-32,45,48 +-----------------------------------|---------|----------|---------|---------|------------------- + +Test Suites: 7 passed, 7 total +Tests: 99 passed, 99 total +Snapshots: 0 total +Time: 0.368 s, estimated 1 s +Ran all test suites. From f3e3888ac3ffb77e9a08a294a0d5551dfc7bc00f Mon Sep 17 00:00:00 2001 From: Zane Rockenbaugh Date: Sat, 11 Oct 2025 19:17:00 -0500 Subject: [PATCH 4/4] removed QA files --- qa/coverage/base.css | 224 ---------- qa/coverage/block-navigation.js | 87 ---- qa/coverage/clover.xml | 211 ---------- qa/coverage/constants.mjs.html | 100 ----- qa/coverage/coverage-final.json | 11 - qa/coverage/ext-constants.mjs.html | 145 ------- qa/coverage/favicon.png | Bin 445 -> 0 bytes .../filter-valid-version-or-range.mjs.html | 109 ----- qa/coverage/first-past.mjs.html | 196 --------- qa/coverage/index.html | 251 ----------- qa/coverage/min-version.mjs.html | 148 ------- qa/coverage/next-version.mjs.html | 337 --------------- qa/coverage/prerelease.mjs.html | 106 ----- 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/valid-version-or-range.mjs.html | 130 ------ qa/coverage/version-compare.mjs.html | 256 ------------ qa/coverage/x-sort.mjs.html | 391 ------------------ qa/lint.txt | 1 - qa/unit-test.txt | 29 -- 22 files changed, 2931 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/constants.mjs.html delete mode 100644 qa/coverage/coverage-final.json delete mode 100644 qa/coverage/ext-constants.mjs.html delete mode 100644 qa/coverage/favicon.png delete mode 100644 qa/coverage/filter-valid-version-or-range.mjs.html delete mode 100644 qa/coverage/first-past.mjs.html delete mode 100644 qa/coverage/index.html delete mode 100644 qa/coverage/min-version.mjs.html delete mode 100644 qa/coverage/next-version.mjs.html delete mode 100644 qa/coverage/prerelease.mjs.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/valid-version-or-range.mjs.html delete mode 100644 qa/coverage/version-compare.mjs.html delete mode 100644 qa/coverage/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 fbd254f..0000000 --- a/qa/coverage/clover.xml +++ /dev/null @@ -1,211 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/qa/coverage/constants.mjs.html b/qa/coverage/constants.mjs.html deleted file mode 100644 index d46d361..0000000 --- a/qa/coverage/constants.mjs.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - Code coverage report for constants.mjs - - - - - - - - - -
-
-

All files 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
-  /^(?:[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*]$/
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/qa/coverage/coverage-final.json b/qa/coverage/coverage-final.json deleted file mode 100644 index 1970836..0000000 --- a/qa/coverage/coverage-final.json +++ /dev/null @@ -1,11 +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":117}},"1":{"start":{"line":5,"column":31},"end":{"line":5,"column":95}}},"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":23},"end":{"line":13,"column":null}},"1":{"start":{"line":15,"column":33},"end":{"line":15,"column":92}},"2":{"start":{"line":16,"column":25},"end":{"line":16,"column":59}},"3":{"start":{"line":18,"column":0},"end":{"line":18,"column":null}},"4":{"start":{"line":19,"column":0},"end":{"line":19,"column":null}},"5":{"start":{"line":20,"column":0},"end":{"line":20,"column":null}}},"fnMap":{},"branchMap":{},"s":{"0":3,"1":3,"2":3,"3":3,"4":3,"5":3},"f":{},"b":{}} -,"/Users/zane/playground/liquid-labs/semver-plus/src/filter-valid-version-or-range.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/filter-valid-version-or-range.mjs","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":3,"column":34},"end":{"line":6,"column":73}},"2":{"start":{"line":4,"column":7},"end":{"line":4,"column":16}},"3":{"start":{"line":6,"column":6},"end":{"line":6,"column":73}},"4":{"start":{"line":6,"column":26},"end":{"line":6,"column":72}},"5":{"start":{"line":6,"column":73},"end":{"line":6,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":3,"column":34},"end":{"line":3,"column":35}},"loc":{"start":{"line":6,"column":6},"end":{"line":6,"column":73}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":4,"column":7},"end":{"line":4,"column":16}},"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":16}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":6,"column":20},"end":{"line":6,"column":21}},"loc":{"start":{"line":6,"column":26},"end":{"line":6,"column":72}}}},"branchMap":{"0":{"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":null}},"type":"default-arg","locations":[{"start":{"line":4,"column":7},"end":{"line":4,"column":null}}]}},"s":{"0":1,"1":1,"2":0,"3":1,"4":10,"5":1},"f":{"0":1,"1":0,"2":10},"b":{"0":[0]}} -,"/Users/zane/playground/liquid-labs/semver-plus/src/first-past.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/first-past.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":7,"column":19},"end":{"line":35,"column":1}},"5":{"start":{"line":8,"column":19},"end":{"line":8,"column":36}},"6":{"start":{"line":10,"column":20},"end":{"line":10,"column":90}},"7":{"start":{"line":11,"column":25},"end":{"line":11,"column":59}},"8":{"start":{"line":12,"column":2},"end":{"line":14,"column":null}},"9":{"start":{"line":13,"column":4},"end":{"line":13,"column":null}},"10":{"start":{"line":16,"column":20},"end":{"line":16,"column":90}},"11":{"start":{"line":17,"column":25},"end":{"line":17,"column":59}},"12":{"start":{"line":18,"column":2},"end":{"line":20,"column":null}},"13":{"start":{"line":19,"column":4},"end":{"line":19,"column":null}},"14":{"start":{"line":22,"column":20},"end":{"line":22,"column":90}},"15":{"start":{"line":23,"column":25},"end":{"line":23,"column":59}},"16":{"start":{"line":24,"column":2},"end":{"line":26,"column":null}},"17":{"start":{"line":25,"column":4},"end":{"line":25,"column":null}},"18":{"start":{"line":28,"column":2},"end":{"line":31,"column":null}},"19":{"start":{"line":29,"column":28},"end":{"line":29,"column":86}},"20":{"start":{"line":30,"column":4},"end":{"line":30,"column":null}},"21":{"start":{"line":34,"column":2},"end":{"line":34,"column":null}},"22":{"start":{"line":35,"column":1},"end":{"line":35,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":7,"column":19},"end":{"line":7,"column":24}},"loc":{"start":{"line":7,"column":29},"end":{"line":35,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":12,"column":2},"end":{"line":14,"column":null}},"type":"if","locations":[{"start":{"line":12,"column":2},"end":{"line":14,"column":null}}]},"1":{"loc":{"start":{"line":18,"column":2},"end":{"line":20,"column":null}},"type":"if","locations":[{"start":{"line":18,"column":2},"end":{"line":20,"column":null}}]},"2":{"loc":{"start":{"line":24,"column":2},"end":{"line":26,"column":null}},"type":"if","locations":[{"start":{"line":24,"column":2},"end":{"line":26,"column":null}}]},"3":{"loc":{"start":{"line":28,"column":2},"end":{"line":31,"column":null}},"type":"if","locations":[{"start":{"line":28,"column":2},"end":{"line":31,"column":null}}]}},"s":{"0":2,"1":2,"2":2,"3":2,"4":2,"5":46,"6":46,"7":46,"8":46,"9":8,"10":38,"11":38,"12":38,"13":15,"14":23,"15":23,"16":23,"17":17,"18":6,"19":6,"20":6,"21":0,"22":2},"f":{"0":46},"b":{"0":[8],"1":[15],"2":[17],"3":[6]}} -,"/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":5,"column":20},"end":{"line":19,"column":1}},"3":{"start":{"line":8,"column":2},"end":{"line":16,"column":null}},"4":{"start":{"line":9,"column":4},"end":{"line":9,"column":null}},"5":{"start":{"line":12,"column":24},"end":{"line":12,"column":48}},"6":{"start":{"line":13,"column":4},"end":{"line":15,"column":null}},"7":{"start":{"line":14,"column":6},"end":{"line":14,"column":null}},"8":{"start":{"line":18,"column":2},"end":{"line":18,"column":null}},"9":{"start":{"line":19,"column":1},"end":{"line":19,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":5,"column":20},"end":{"line":5,"column":25}},"loc":{"start":{"line":5,"column":30},"end":{"line":19,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":8,"column":2},"end":{"line":16,"column":null}},"type":"if","locations":[{"start":{"line":8,"column":2},"end":{"line":16,"column":null}},{"start":{"line":11,"column":7},"end":{"line":16,"column":null}}]},"1":{"loc":{"start":{"line":13,"column":4},"end":{"line":15,"column":null}},"type":"if","locations":[{"start":{"line":13,"column":4},"end":{"line":15,"column":null}}]}},"s":{"0":3,"1":3,"2":3,"3":58,"4":12,"5":46,"6":46,"7":46,"8":0,"9":3},"f":{"0":58},"b":{"0":[12,46],"1":[46]}} -,"/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":19,"column":20},"end":{"line":82,"column":1}},"4":{"start":{"line":20,"column":2},"end":{"line":22,"column":null}},"5":{"start":{"line":21,"column":4},"end":{"line":21,"column":null}},"6":{"start":{"line":24,"column":2},"end":{"line":24,"column":null}},"7":{"start":{"line":28,"column":23},"end":{"line":28,"column":101}},"8":{"start":{"line":29,"column":2},"end":{"line":32,"column":null}},"9":{"start":{"line":29,"column":34},"end":{"line":29,"column":null}},"10":{"start":{"line":30,"column":7},"end":{"line":32,"column":null}},"11":{"start":{"line":31,"column":4},"end":{"line":31,"column":null}},"12":{"start":{"line":34,"column":2},"end":{"line":36,"column":null}},"13":{"start":{"line":35,"column":4},"end":{"line":35,"column":null}},"14":{"start":{"line":37,"column":2},"end":{"line":45,"column":null}},"15":{"start":{"line":38,"column":4},"end":{"line":44,"column":null}},"16":{"start":{"line":39,"column":6},"end":{"line":39,"column":null}},"17":{"start":{"line":40,"column":6},"end":{"line":40,"column":null}},"18":{"start":{"line":43,"column":6},"end":{"line":43,"column":null}},"19":{"start":{"line":48,"column":2},"end":{"line":74,"column":null}},"20":{"start":{"line":49,"column":4},"end":{"line":53,"column":null}},"21":{"start":{"line":49,"column":36},"end":{"line":49,"column":null}},"22":{"start":{"line":50,"column":9},"end":{"line":53,"column":null}},"23":{"start":{"line":50,"column":40},"end":{"line":50,"column":null}},"24":{"start":{"line":51,"column":9},"end":{"line":53,"column":null}},"25":{"start":{"line":52,"column":6},"end":{"line":52,"column":null}},"26":{"start":{"line":55,"column":4},"end":{"line":55,"column":19}},"27":{"start":{"line":57,"column":7},"end":{"line":74,"column":null}},"28":{"start":{"line":58,"column":32},"end":{"line":60,"column":44}},"29":{"start":{"line":61,"column":30},"end":{"line":61,"column":61}},"30":{"start":{"line":62,"column":4},"end":{"line":64,"column":null}},"31":{"start":{"line":63,"column":6},"end":{"line":63,"column":null}},"32":{"start":{"line":66,"column":4},"end":{"line":71,"column":null}},"33":{"start":{"line":67,"column":6},"end":{"line":67,"column":null}},"34":{"start":{"line":70,"column":6},"end":{"line":70,"column":null}},"35":{"start":{"line":73,"column":4},"end":{"line":73,"column":null}},"36":{"start":{"line":77,"column":2},"end":{"line":79,"column":null}},"37":{"start":{"line":81,"column":2},"end":{"line":81,"column":null}},"38":{"start":{"line":82,"column":1},"end":{"line":82,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":19,"column":20},"end":{"line":19,"column":21}},"loc":{"start":{"line":19,"column":63},"end":{"line":82,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":19,"column":43},"end":{"line":19,"column":57}},"type":"default-arg","locations":[{"start":{"line":19,"column":51},"end":{"line":19,"column":57}}]},"1":{"loc":{"start":{"line":20,"column":2},"end":{"line":22,"column":null}},"type":"if","locations":[{"start":{"line":20,"column":2},"end":{"line":22,"column":null}}]},"2":{"loc":{"start":{"line":20,"column":6},"end":{"line":20,"column":64}},"type":"binary-expr","locations":[{"start":{"line":20,"column":6},"end":{"line":20,"column":29}},{"start":{"line":20,"column":33},"end":{"line":20,"column":64}}]},"3":{"loc":{"start":{"line":24,"column":14},"end":{"line":24,"column":81}},"type":"binary-expr","locations":[{"start":{"line":24,"column":14},"end":{"line":24,"column":23}},{"start":{"line":24,"column":28},"end":{"line":24,"column":80}}]},"4":{"loc":{"start":{"line":24,"column":28},"end":{"line":24,"column":80}},"type":"cond-expr","locations":[{"start":{"line":24,"column":58},"end":{"line":24,"column":65}},{"start":{"line":24,"column":68},"end":{"line":24,"column":80}}]},"5":{"loc":{"start":{"line":29,"column":2},"end":{"line":32,"column":null}},"type":"if","locations":[{"start":{"line":29,"column":2},"end":{"line":32,"column":null}},{"start":{"line":30,"column":7},"end":{"line":32,"column":null}}]},"6":{"loc":{"start":{"line":30,"column":7},"end":{"line":32,"column":null}},"type":"if","locations":[{"start":{"line":30,"column":7},"end":{"line":32,"column":null}}]},"7":{"loc":{"start":{"line":34,"column":2},"end":{"line":36,"column":null}},"type":"if","locations":[{"start":{"line":34,"column":2},"end":{"line":36,"column":null}}]},"8":{"loc":{"start":{"line":34,"column":6},"end":{"line":34,"column":73}},"type":"binary-expr","locations":[{"start":{"line":34,"column":6},"end":{"line":34,"column":29}},{"start":{"line":34,"column":33},"end":{"line":34,"column":73}}]},"9":{"loc":{"start":{"line":37,"column":2},"end":{"line":45,"column":null}},"type":"if","locations":[{"start":{"line":37,"column":2},"end":{"line":45,"column":null}}]},"10":{"loc":{"start":{"line":37,"column":6},"end":{"line":37,"column":74}},"type":"binary-expr","locations":[{"start":{"line":37,"column":6},"end":{"line":37,"column":29}},{"start":{"line":37,"column":33},"end":{"line":37,"column":74}}]},"11":{"loc":{"start":{"line":38,"column":4},"end":{"line":44,"column":null}},"type":"if","locations":[{"start":{"line":38,"column":4},"end":{"line":44,"column":null}},{"start":{"line":42,"column":9},"end":{"line":44,"column":null}}]},"12":{"loc":{"start":{"line":48,"column":2},"end":{"line":74,"column":null}},"type":"if","locations":[{"start":{"line":48,"column":2},"end":{"line":74,"column":null}},{"start":{"line":57,"column":7},"end":{"line":74,"column":null}}]},"13":{"loc":{"start":{"line":49,"column":4},"end":{"line":53,"column":null}},"type":"if","locations":[{"start":{"line":49,"column":4},"end":{"line":53,"column":null}},{"start":{"line":50,"column":9},"end":{"line":53,"column":null}}]},"14":{"loc":{"start":{"line":50,"column":9},"end":{"line":53,"column":null}},"type":"if","locations":[{"start":{"line":50,"column":9},"end":{"line":53,"column":null}},{"start":{"line":51,"column":9},"end":{"line":53,"column":null}}]},"15":{"loc":{"start":{"line":51,"column":9},"end":{"line":53,"column":null}},"type":"if","locations":[{"start":{"line":51,"column":9},"end":{"line":53,"column":null}}]},"16":{"loc":{"start":{"line":57,"column":7},"end":{"line":74,"column":null}},"type":"if","locations":[{"start":{"line":57,"column":7},"end":{"line":74,"column":null}}]},"17":{"loc":{"start":{"line":58,"column":32},"end":{"line":60,"column":44}},"type":"cond-expr","locations":[{"start":{"line":59,"column":8},"end":{"line":59,"column":36}},{"start":{"line":60,"column":8},"end":{"line":60,"column":44}}]},"18":{"loc":{"start":{"line":62,"column":4},"end":{"line":64,"column":null}},"type":"if","locations":[{"start":{"line":62,"column":4},"end":{"line":64,"column":null}}]},"19":{"loc":{"start":{"line":63,"column":78},"end":{"line":63,"column":103}},"type":"binary-expr","locations":[{"start":{"line":63,"column":78},"end":{"line":63,"column":92}},{"start":{"line":63,"column":96},"end":{"line":63,"column":103}}]},"20":{"loc":{"start":{"line":66,"column":4},"end":{"line":71,"column":null}},"type":"if","locations":[{"start":{"line":66,"column":4},"end":{"line":71,"column":null}},{"start":{"line":69,"column":9},"end":{"line":71,"column":null}}]},"21":{"loc":{"start":{"line":77,"column":12},"end":{"line":79,"column":36}},"type":"cond-expr","locations":[{"start":{"line":78,"column":6},"end":{"line":78,"column":45}},{"start":{"line":79,"column":6},"end":{"line":79,"column":36}}]},"22":{"loc":{"start":{"line":77,"column":12},"end":{"line":77,"column":70}},"type":"binary-expr","locations":[{"start":{"line":77,"column":12},"end":{"line":77,"column":39}},{"start":{"line":77,"column":43},"end":{"line":77,"column":70}}]}},"s":{"0":3,"1":3,"2":3,"3":3,"4":171,"5":1,"6":170,"7":170,"8":170,"9":100,"10":70,"11":1,"12":169,"13":4,"14":165,"15":24,"16":18,"17":18,"18":6,"19":159,"20":10,"21":4,"22":6,"23":3,"24":3,"25":3,"26":10,"27":149,"28":29,"29":29,"30":29,"31":5,"32":24,"33":21,"34":3,"35":24,"36":120,"37":120,"38":3},"f":{"0":171},"b":{"0":[64],"1":[1],"2":[171,167],"3":[170,4],"4":[1,3],"5":[100,70],"6":[1],"7":[4],"8":[169,100],"9":[24],"10":[165,69],"11":[18,6],"12":[10,149],"13":[4,6],"14":[3,3],"15":[3],"16":[29],"17":[0,29],"18":[5],"19":[5,0],"20":[21,3],"21":[3,117],"22":[120,9]}} -,"/Users/zane/playground/liquid-labs/semver-plus/src/prerelease.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/prerelease.mjs","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":3,"column":20},"end":{"line":5,"column":1}},"2":{"start":{"line":4,"column":2},"end":{"line":4,"column":null}},"3":{"start":{"line":5,"column":1},"end":{"line":5,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":3,"column":20},"end":{"line":3,"column":27}},"loc":{"start":{"line":3,"column":32},"end":{"line":5,"column":1}}}},"branchMap":{},"s":{"0":1,"1":1,"2":3,"3":1},"f":{"0":3},"b":{}} -,"/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":5,"column":28},"end":{"line":13,"column":53}},"3":{"start":{"line":8,"column":7},"end":{"line":8,"column":16}},"4":{"start":{"line":11,"column":3},"end":{"line":13,"column":53}},"5":{"start":{"line":13,"column":53},"end":{"line":13,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":5,"column":28},"end":{"line":5,"column":29}},"loc":{"start":{"line":11,"column":3},"end":{"line":13,"column":53}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":8,"column":7},"end":{"line":8,"column":16}},"loc":{"start":{"line":8,"column":7},"end":{"line":8,"column":16}}}},"branchMap":{"0":{"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":25}},"type":"default-arg","locations":[{"start":{"line":6,"column":20},"end":{"line":6,"column":25}}]},"1":{"loc":{"start":{"line":7,"column":2},"end":{"line":7,"column":27}},"type":"default-arg","locations":[{"start":{"line":7,"column":22},"end":{"line":7,"column":27}}]},"2":{"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":null}},"type":"default-arg","locations":[{"start":{"line":8,"column":7},"end":{"line":8,"column":null}}]},"3":{"loc":{"start":{"line":9,"column":2},"end":{"line":9,"column":null}},"type":"default-arg","locations":[{"start":{"line":9,"column":15},"end":{"line":9,"column":null}}]},"4":{"loc":{"start":{"line":11,"column":3},"end":{"line":13,"column":53}},"type":"binary-expr","locations":[{"start":{"line":11,"column":3},"end":{"line":11,"column":29}},{"start":{"line":11,"column":33},"end":{"line":11,"column":52}},{"start":{"line":12,"column":8},"end":{"line":12,"column":27}},{"start":{"line":12,"column":31},"end":{"line":12,"column":55}},{"start":{"line":12,"column":59},"end":{"line":12,"column":84}},{"start":{"line":13,"column":8},"end":{"line":13,"column":27}},{"start":{"line":13,"column":31},"end":{"line":13,"column":53}}]}},"s":{"0":1,"1":1,"2":1,"3":0,"4":10,"5":1},"f":{"0":10,"1":0},"b":{"0":[10],"1":[10],"2":[0],"3":[0],"4":[10,10,7,0,0,7,7]}} -,"/Users/zane/playground/liquid-labs/semver-plus/src/version-compare.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/version-compare.mjs","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":3,"column":22},"end":{"line":16,"column":1}},"2":{"start":{"line":5,"column":2},"end":{"line":13,"column":null}},"3":{"start":{"line":5,"column":15},"end":{"line":5,"column":16}},"4":{"start":{"line":6,"column":20},"end":{"line":6,"column":31}},"5":{"start":{"line":7,"column":4},"end":{"line":12,"column":null}},"6":{"start":{"line":8,"column":6},"end":{"line":8,"column":null}},"7":{"start":{"line":10,"column":9},"end":{"line":12,"column":null}},"8":{"start":{"line":11,"column":6},"end":{"line":11,"column":null}},"9":{"start":{"line":15,"column":2},"end":{"line":15,"column":null}},"10":{"start":{"line":18,"column":19},"end":{"line":26,"column":1}},"11":{"start":{"line":19,"column":2},"end":{"line":21,"column":null}},"12":{"start":{"line":20,"column":4},"end":{"line":20,"column":null}},"13":{"start":{"line":23,"column":2},"end":{"line":23,"column":null}},"14":{"start":{"line":25,"column":2},"end":{"line":25,"column":null}},"15":{"start":{"line":25,"column":73},"end":{"line":25,"column":95}},"16":{"start":{"line":26,"column":1},"end":{"line":26,"column":null}},"17":{"start":{"line":28,"column":19},"end":{"line":36,"column":1}},"18":{"start":{"line":29,"column":2},"end":{"line":31,"column":null}},"19":{"start":{"line":30,"column":4},"end":{"line":30,"column":null}},"20":{"start":{"line":33,"column":2},"end":{"line":33,"column":null}},"21":{"start":{"line":35,"column":2},"end":{"line":35,"column":null}},"22":{"start":{"line":35,"column":73},"end":{"line":35,"column":95}},"23":{"start":{"line":36,"column":1},"end":{"line":36,"column":null}},"24":{"start":{"line":38,"column":28},"end":{"line":55,"column":1}},"25":{"start":{"line":39,"column":2},"end":{"line":52,"column":null}},"26":{"start":{"line":40,"column":18},"end":{"line":40,"column":48}},"27":{"start":{"line":42,"column":4},"end":{"line":49,"column":null}},"28":{"start":{"line":43,"column":6},"end":{"line":48,"column":null}},"29":{"start":{"line":44,"column":8},"end":{"line":44,"column":null}},"30":{"start":{"line":47,"column":8},"end":{"line":47,"column":null}},"31":{"start":{"line":51,"column":4},"end":{"line":51,"column":null}},"32":{"start":{"line":54,"column":2},"end":{"line":54,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":3,"column":22},"end":{"line":3,"column":23}},"loc":{"start":{"line":3,"column":65},"end":{"line":16,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":18,"column":19},"end":{"line":18,"column":20}},"loc":{"start":{"line":18,"column":56},"end":{"line":26,"column":1}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":25,"column":63},"end":{"line":25,"column":64}},"loc":{"start":{"line":25,"column":73},"end":{"line":25,"column":95}}},"3":{"name":"(anonymous_3)","decl":{"start":{"line":28,"column":19},"end":{"line":28,"column":20}},"loc":{"start":{"line":28,"column":56},"end":{"line":36,"column":1}}},"4":{"name":"(anonymous_4)","decl":{"start":{"line":35,"column":63},"end":{"line":35,"column":64}},"loc":{"start":{"line":35,"column":73},"end":{"line":35,"column":95}}},"5":{"name":"(anonymous_5)","decl":{"start":{"line":38,"column":28},"end":{"line":38,"column":29}},"loc":{"start":{"line":38,"column":65},"end":{"line":55,"column":1}}},"6":{"name":"(anonymous_6)","decl":{"start":{"line":39,"column":30},"end":{"line":39,"column":37}},"loc":{"start":{"line":39,"column":42},"end":{"line":52,"column":3}}}},"branchMap":{"0":{"loc":{"start":{"line":7,"column":4},"end":{"line":12,"column":null}},"type":"if","locations":[{"start":{"line":7,"column":4},"end":{"line":12,"column":null}},{"start":{"line":10,"column":9},"end":{"line":12,"column":null}}]},"1":{"loc":{"start":{"line":10,"column":9},"end":{"line":12,"column":null}},"type":"if","locations":[{"start":{"line":10,"column":9},"end":{"line":12,"column":null}}]},"2":{"loc":{"start":{"line":19,"column":2},"end":{"line":21,"column":null}},"type":"if","locations":[{"start":{"line":19,"column":2},"end":{"line":21,"column":null}}]},"3":{"loc":{"start":{"line":19,"column":6},"end":{"line":19,"column":40}},"type":"binary-expr","locations":[{"start":{"line":19,"column":6},"end":{"line":19,"column":15}},{"start":{"line":19,"column":19},"end":{"line":19,"column":40}}]},"4":{"loc":{"start":{"line":29,"column":2},"end":{"line":31,"column":null}},"type":"if","locations":[{"start":{"line":29,"column":2},"end":{"line":31,"column":null}}]},"5":{"loc":{"start":{"line":29,"column":6},"end":{"line":29,"column":40}},"type":"binary-expr","locations":[{"start":{"line":29,"column":6},"end":{"line":29,"column":15}},{"start":{"line":29,"column":19},"end":{"line":29,"column":40}}]},"6":{"loc":{"start":{"line":42,"column":4},"end":{"line":49,"column":null}},"type":"if","locations":[{"start":{"line":42,"column":4},"end":{"line":49,"column":null}}]},"7":{"loc":{"start":{"line":43,"column":6},"end":{"line":48,"column":null}},"type":"if","locations":[{"start":{"line":43,"column":6},"end":{"line":48,"column":null}},{"start":{"line":46,"column":11},"end":{"line":48,"column":null}}]}},"s":{"0":1,"1":1,"2":14,"3":14,"4":30,"5":30,"6":14,"7":16,"8":8,"9":14,"10":1,"11":9,"12":1,"13":8,"14":7,"15":0,"16":1,"17":1,"18":9,"19":1,"20":8,"21":7,"22":0,"23":1,"24":1,"25":16,"26":38,"27":38,"28":6,"29":4,"30":2,"31":32,"32":14},"f":{"0":14,"1":9,"2":0,"3":9,"4":0,"5":16,"6":38},"b":{"0":[14,16],"1":[8],"2":[1],"3":[9,9],"4":[1],"5":[9,9],"6":[6],"7":[4,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":9,"column":15},"end":{"line":100,"column":1}},"4":{"start":{"line":11,"column":19},"end":{"line":11,"column":21}},"5":{"start":{"line":12,"column":17},"end":{"line":12,"column":19}},"6":{"start":{"line":15,"column":2},"end":{"line":15,"column":null}},"7":{"start":{"line":15,"column":60},"end":{"line":15,"column":78}},"8":{"start":{"line":17,"column":2},"end":{"line":36,"column":null}},"9":{"start":{"line":18,"column":4},"end":{"line":35,"column":null}},"10":{"start":{"line":19,"column":6},"end":{"line":19,"column":null}},"11":{"start":{"line":22,"column":22},"end":{"line":22,"column":50}},"12":{"start":{"line":23,"column":6},"end":{"line":34,"column":null}},"13":{"start":{"line":24,"column":8},"end":{"line":24,"column":null}},"14":{"start":{"line":27,"column":22},"end":{"line":27,"column":55}},"15":{"start":{"line":28,"column":8},"end":{"line":33,"column":null}},"16":{"start":{"line":29,"column":10},"end":{"line":29,"column":null}},"17":{"start":{"line":32,"column":10},"end":{"line":32,"column":null}},"18":{"start":{"line":38,"column":25},"end":{"line":38,"column":54}},"19":{"start":{"line":40,"column":23},"end":{"line":56,"column":4}},"20":{"start":{"line":41,"column":23},"end":{"line":41,"column":35}},"21":{"start":{"line":42,"column":23},"end":{"line":42,"column":35}},"22":{"start":{"line":44,"column":4},"end":{"line":55,"column":null}},"23":{"start":{"line":45,"column":6},"end":{"line":45,"column":null}},"24":{"start":{"line":47,"column":9},"end":{"line":55,"column":null}},"25":{"start":{"line":48,"column":6},"end":{"line":48,"column":null}},"26":{"start":{"line":50,"column":9},"end":{"line":55,"column":null}},"27":{"start":{"line":51,"column":6},"end":{"line":51,"column":null}},"28":{"start":{"line":54,"column":6},"end":{"line":54,"column":null}},"29":{"start":{"line":58,"column":2},"end":{"line":63,"column":null}},"30":{"start":{"line":59,"column":4},"end":{"line":59,"column":null}},"31":{"start":{"line":61,"column":7},"end":{"line":63,"column":null}},"32":{"start":{"line":62,"column":4},"end":{"line":62,"column":null}},"33":{"start":{"line":65,"column":20},"end":{"line":65,"column":33}},"34":{"start":{"line":67,"column":25},"end":{"line":67,"column":30}},"35":{"start":{"line":68,"column":2},"end":{"line":97,"column":null}},"36":{"start":{"line":69,"column":4},"end":{"line":72,"column":null}},"37":{"start":{"line":70,"column":6},"end":{"line":70,"column":null}},"38":{"start":{"line":71,"column":6},"end":{"line":71,"column":null}},"39":{"start":{"line":74,"column":24},"end":{"line":74,"column":67}},"40":{"start":{"line":75,"column":4},"end":{"line":96,"column":null}},"41":{"start":{"line":76,"column":33},"end":{"line":76,"column":63}},"42":{"start":{"line":80,"column":32},"end":{"line":80,"column":111}},"43":{"start":{"line":80,"column":92},"end":{"line":80,"column":110}},"44":{"start":{"line":81,"column":6},"end":{"line":87,"column":null}},"45":{"start":{"line":82,"column":8},"end":{"line":82,"column":null}},"46":{"start":{"line":83,"column":8},"end":{"line":83,"column":null}},"47":{"start":{"line":86,"column":8},"end":{"line":86,"column":null}},"48":{"start":{"line":89,"column":9},"end":{"line":96,"column":null}},"49":{"start":{"line":90,"column":33},"end":{"line":90,"column":69}},"50":{"start":{"line":91,"column":6},"end":{"line":91,"column":null}},"51":{"start":{"line":93,"column":9},"end":{"line":96,"column":null}},"52":{"start":{"line":94,"column":6},"end":{"line":94,"column":null}},"53":{"start":{"line":95,"column":6},"end":{"line":95,"column":null}},"54":{"start":{"line":99,"column":2},"end":{"line":99,"column":null}},"55":{"start":{"line":100,"column":1},"end":{"line":100,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":9,"column":15},"end":{"line":9,"column":32}},"loc":{"start":{"line":9,"column":37},"end":{"line":100,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":15,"column":47},"end":{"line":15,"column":48}},"loc":{"start":{"line":15,"column":60},"end":{"line":15,"column":78}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":40,"column":35},"end":{"line":40,"column":36}},"loc":{"start":{"line":40,"column":45},"end":{"line":56,"column":3}}},"3":{"name":"(anonymous_3)","decl":{"start":{"line":80,"column":83},"end":{"line":80,"column":87}},"loc":{"start":{"line":80,"column":92},"end":{"line":80,"column":110}}}},"branchMap":{"0":{"loc":{"start":{"line":18,"column":4},"end":{"line":35,"column":null}},"type":"if","locations":[{"start":{"line":18,"column":4},"end":{"line":35,"column":null}},{"start":{"line":21,"column":9},"end":{"line":35,"column":null}}]},"1":{"loc":{"start":{"line":23,"column":6},"end":{"line":34,"column":null}},"type":"if","locations":[{"start":{"line":23,"column":6},"end":{"line":34,"column":null}},{"start":{"line":26,"column":11},"end":{"line":34,"column":null}}]},"2":{"loc":{"start":{"line":28,"column":8},"end":{"line":33,"column":null}},"type":"if","locations":[{"start":{"line":28,"column":8},"end":{"line":33,"column":null}},{"start":{"line":31,"column":13},"end":{"line":33,"column":null}}]},"3":{"loc":{"start":{"line":44,"column":4},"end":{"line":55,"column":null}},"type":"if","locations":[{"start":{"line":44,"column":4},"end":{"line":55,"column":null}},{"start":{"line":47,"column":9},"end":{"line":55,"column":null}}]},"4":{"loc":{"start":{"line":44,"column":8},"end":{"line":44,"column":50}},"type":"binary-expr","locations":[{"start":{"line":44,"column":8},"end":{"line":44,"column":27}},{"start":{"line":44,"column":31},"end":{"line":44,"column":50}}]},"5":{"loc":{"start":{"line":47,"column":9},"end":{"line":55,"column":null}},"type":"if","locations":[{"start":{"line":47,"column":9},"end":{"line":55,"column":null}},{"start":{"line":50,"column":9},"end":{"line":55,"column":null}}]},"6":{"loc":{"start":{"line":50,"column":9},"end":{"line":55,"column":null}},"type":"if","locations":[{"start":{"line":50,"column":9},"end":{"line":55,"column":null}},{"start":{"line":53,"column":9},"end":{"line":55,"column":null}}]},"7":{"loc":{"start":{"line":58,"column":2},"end":{"line":63,"column":null}},"type":"if","locations":[{"start":{"line":58,"column":2},"end":{"line":63,"column":null}},{"start":{"line":61,"column":7},"end":{"line":63,"column":null}}]},"8":{"loc":{"start":{"line":61,"column":7},"end":{"line":63,"column":null}},"type":"if","locations":[{"start":{"line":61,"column":7},"end":{"line":63,"column":null}}]},"9":{"loc":{"start":{"line":69,"column":4},"end":{"line":72,"column":null}},"type":"if","locations":[{"start":{"line":69,"column":4},"end":{"line":72,"column":null}}]},"10":{"loc":{"start":{"line":75,"column":4},"end":{"line":96,"column":null}},"type":"if","locations":[{"start":{"line":75,"column":4},"end":{"line":96,"column":null}},{"start":{"line":89,"column":9},"end":{"line":96,"column":null}}]},"11":{"loc":{"start":{"line":81,"column":6},"end":{"line":87,"column":null}},"type":"if","locations":[{"start":{"line":81,"column":6},"end":{"line":87,"column":null}},{"start":{"line":85,"column":11},"end":{"line":87,"column":null}}]},"12":{"loc":{"start":{"line":89,"column":9},"end":{"line":96,"column":null}},"type":"if","locations":[{"start":{"line":89,"column":9},"end":{"line":96,"column":null}},{"start":{"line":93,"column":9},"end":{"line":96,"column":null}}]},"13":{"loc":{"start":{"line":93,"column":9},"end":{"line":96,"column":null}},"type":"if","locations":[{"start":{"line":93,"column":9},"end":{"line":96,"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":0,"26":20,"27":7,"28":13,"29":16,"30":3,"31":13,"32":4,"33":9,"34":9,"35":9,"36":19,"37":9,"38":9,"39":10,"40":10,"41":8,"42":8,"43":1,"44":8,"45":7,"46":7,"47":1,"48":2,"49":1,"50":1,"51":1,"52":1,"53":1,"54":9,"55":1},"f":{"0":16,"1":47,"2":20,"3":1},"b":{"0":[26,21],"1":[21,0],"2":[0,0],"3":[0,20],"4":[20,0],"5":[0,20],"6":[7,13],"7":[3,13],"8":[4],"9":[9],"10":[8,2],"11":[7,1],"12":[1,1],"13":[1]}} -} diff --git a/qa/coverage/ext-constants.mjs.html b/qa/coverage/ext-constants.mjs.html deleted file mode 100644 index 6b11f5f..0000000 --- a/qa/coverage/ext-constants.mjs.html +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - Code coverage report for ext-constants.mjs - - - - - - - - - -
-
-

All files ext-constants.mjs

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

- 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 -213x -  -  -  -  -  -  -  -  -  -  -  -  -  -3x -3x -  -3x -3x -3x - 
export const increments = [
-  'major',
-  'minor',
-  'patch',
-  'premajor',
-  'preminor',
-  'prepatch',
-  'prerelease',
-  'pretype',
-  'alpha',
-  'beta',
-  'rc',
-  'gold'
-]
-export const prereleaseIncrements = ['prerelease', 'pretype', 'alpha', 'beta', 'rc', 'gold']
-export const releaseTypes = ['alpha', 'beta', 'rc', 'gold']
- 
-Object.freeze(increments)
-Object.freeze(prereleaseIncrements)
-Object.freeze(releaseTypes)
- 
- -
-
- - - - - - - - \ No newline at end of file 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 filter-valid-version-or-range.mjs - - - - - - - - - -
-
-

All files filter-valid-version-or-range.mjs

-
- -
- 83.33% - Statements - 5/6 -
- - -
- 0% - Branches - 0/1 -
- - -
- 66.66% - Functions - 2/3 -
- - -
- 75% - Lines - 3/4 -
- - -
-

- 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 -91x -  -1x -  -  -10x -  -  - 
import { validVersionOrRange } from './valid-version-or-range'
- 
-const filterValidVersionOrRange = ({
-  input = throw new Error("'input' is required."),
-  ...options
-}) => input.filter((i) => validVersionOrRange({ input : i, ...options }))
- 
-export { filterValidVersionOrRange }
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/qa/coverage/first-past.mjs.html b/qa/coverage/first-past.mjs.html deleted file mode 100644 index 899fdb2..0000000 --- a/qa/coverage/first-past.mjs.html +++ /dev/null @@ -1,196 +0,0 @@ - - - - - - Code coverage report for first-past.mjs - - - - - - - - - -
-
-

All files first-past.mjs

-
- -
- 95.65% - Statements - 22/23 -
- - -
- 100% - Branches - 4/4 -
- - -
- 100% - Functions - 1/1 -
- - -
- 95.65% - Lines - 22/23 -
- - -
-

- 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 -382x -  -2x -2x -2x -  -2x -46x -  -46x -46x -46x -8x -  -  -38x -38x -38x -15x -  -  -23x -23x -23x -17x -  -  -6x -6x -6x -  -  -  -  -2x -  -  - 
import semver from 'semver'
- 
-import { prereleaseXRangeRE } from './constants'
-import { minVersion } from './min-version'
-import { nextVersion } from './next-version'
- 
-const firstPast = (range) => {
-  const rangeMin = minVersion(range)
- 
-  const nextMajor = nextVersion({ currVer : rangeMin, increment : 'major', loose : true })
-  const nextMajorValid = semver.satisfies(nextMajor, range)
-  if (nextMajorValid) {
-    return null
-  }
- 
-  const nextMinor = nextVersion({ currVer : rangeMin, increment : 'minor', loose : true })
-  const nextMinorValid = semver.satisfies(nextMinor, range)
-  if (nextMinorValid === true) {
-    return nextMajor
-  }
- 
-  const nextPatch = nextVersion({ currVer : rangeMin, increment : 'patch', loose : true })
-  const nextPatchValid = semver.satisfies(nextPatch, range)
-  if (nextPatchValid === true) {
-    return nextMinor
-  }
- 
-  if (range.match(prereleaseXRangeRE)) {
-    const nextReleaseType = nextVersion({ currVer : rangeMin, increment : 'pretype' })
-    return nextReleaseType
-  }
- 
-  // else
-  throw new Error(`Cannot determine first-past version for range: '${range}'.`)
-}
- 
-export { firstPast }
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/qa/coverage/index.html b/qa/coverage/index.html deleted file mode 100644 index b9a69f8..0000000 --- a/qa/coverage/index.html +++ /dev/null @@ -1,251 +0,0 @@ - - - - - - Code coverage report for All files - - - - - - - - - -
-
-

All files

-
- -
- 93.51% - Statements - 173/185 -
- - -
- 86.17% - Branches - 81/94 -
- - -
- 80% - Functions - 16/20 -
- - -
- 94.28% - Lines - 165/175 -
- - -
-

- 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%6/6100%0/0100%0/0100%6/6
filter-valid-version-or-range.mjs -
-
83.33%5/60%0/166.66%2/375%3/4
first-past.mjs -
-
95.65%22/23100%4/4100%1/195.65%22/23
min-version.mjs -
-
90%9/10100%3/3100%1/190%9/10
next-version.mjs -
-
100%39/3994.73%36/38100%1/1100%36/36
prerelease.mjs -
-
100%4/4100%0/0100%1/1100%4/4
valid-version-or-range.mjs -
-
83.33%5/663.63%7/1150%1/283.33%5/6
version-compare.mjs -
-
93.93%31/33100%12/1271.42%5/7100%30/30
x-sort.mjs -
-
89.28%50/5676%19/25100%4/488.88%48/54
-
-
-
- - - - - - - - \ No newline at end of file diff --git a/qa/coverage/min-version.mjs.html b/qa/coverage/min-version.mjs.html deleted file mode 100644 index 9ca11e9..0000000 --- a/qa/coverage/min-version.mjs.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - Code coverage report for min-version.mjs - - - - - - - - - -
-
-

All files min-version.mjs

-
- -
- 90% - Statements - 9/10 -
- - -
- 100% - Branches - 3/3 -
- - -
- 100% - Functions - 1/1 -
- - -
- 90% - Lines - 9/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 -223x -  -3x -  -3x -  -  -58x -12x -  -  -46x -46x -46x -  -  -  -  -3x -  -  - 
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 }
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/qa/coverage/next-version.mjs.html b/qa/coverage/next-version.mjs.html deleted file mode 100644 index 1cc585c..0000000 --- a/qa/coverage/next-version.mjs.html +++ /dev/null @@ -1,337 +0,0 @@ - - - - - - Code coverage report for next-version.mjs - - - - - - - - - -
-
-

All files next-version.mjs

-
- -
- 100% - Statements - 39/39 -
- - -
- 94.73% - Branches - 36/38 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 36/36 -
- - -
-

- 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 -853x -3x -  -3x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -3x -171x -1x -  -  -170x -  -  -  -170x -170x -70x -1x -  -  -169x -4x -  -165x -24x -18x -18x -  -  -6x -  -  -  -  -159x -10x -6x -3x -3x -  -  -10x -  -149x -29x -  -  -29x -29x -5x -  -  -24x -21x -  -  -3x -  -  -24x -  -  -  -120x -  -  -  -120x -3x -  -  - 
import createError from 'http-errors'
-import semver from 'semver'
- 
-import { increments, prereleaseIncrements, releaseTypes } 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
- */
-const nextVersion = ({ currVer, increment, loose = false }) => {
-  if (increment !== undefined && !increments.includes(increment)) {
-    throw createError.BadRequest(`Invalid increment '${increment}' specified.`)
-  }
-  // what are we incrementing? default is patch for released and prerelease for pre-release projects
-  increment = increment || (currVer.match(/^[\d.Z-]+$/) ? 'patch' : 'prerelease')
- 
-  let nextVer
-  // determine concrete value for increment
-  let currPrerelease = currVer.replace(/^[\d.Z]+-([0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*?)(?:\.\d+)?/, '$1')
-  if (currPrerelease === currVer) currPrerelease = null
-  else if (!releaseTypes.includes(currPrerelease)) {
-    throw createError.BadRequest(`Cannot handle unsupported pre-release '${currPrerelease}'. Prerelease ID must be one of 'alpha', 'beta', or 'rc'.`)
-  }
- 
-  if (currPrerelease === null && prereleaseIncrements.includes(increment)) {
-    throw createError.BadRequest(`Cannot increment ${increment} for non-prerelease versions.`)
-  }
-  if (currPrerelease !== null && !prereleaseIncrements.includes(increment)) {
-    if (loose === true) {
-      currVer = nextVersion(({ currVer, increment : 'gold' }))
-      currPrerelease = undefined
-    }
-    else {
-      throw createError.BadRequest(`Prerelease version ${currVer} can only be incremented by 'prerelease' or 'pretype'.`)
-    }
-  }
- 
-  // alpha -> beta -> rc
-  if (increment === 'pretype') {
-    if (currPrerelease === 'alpha') nextVer = currVer.replace(/([0-1.Z-]+)alpha(\.\d+)?/, '$1beta.0')
-    else if (currPrerelease === 'beta') nextVer = currVer.replace(/([0-1.Z-]+)beta(\.\d+)?/, '$1rc.0')
-    else if (currPrerelease === 'rc') { // is special in the case of timever + pretype
-      nextVer = currVer.replace(/([0-9.Z]+)-rc(?:\.\d+)?/, '$1')
-    }
- 
-    return nextVer // we're done
-  }
-  else if (releaseTypes.includes(increment)) {
-    const currReleasePosition = currPrerelease === null
-      ? releaseTypes.indexOf('gold')
-      : releaseTypes.indexOf(currPrerelease)
-    const incrementPosition = releaseTypes.indexOf(increment)
-    if (incrementPosition <= currReleasePosition) {
-      throw createError.BadRequest(`Cannot move release type backwards from ${currPrerelease || 'gold'} to ${increment}.`)
-    }
- 
-    if (increment === 'gold') {
-      nextVer = currVer.replace(/^([\d.Z]+)-(?:alpha|beta|rc)(?:\.\d+)?/, '$1')
-    }
-    else {
-      nextVer = currVer.replace(/^([\d.Z-]+)(?:alpha|beta|rc)(?:\.\d+)?/, `$1${increment}.0`)
-    }
- 
-    return nextVer
-  }
- 
-  // 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/prerelease.mjs.html b/qa/coverage/prerelease.mjs.html deleted file mode 100644 index c91ba0c..0000000 --- a/qa/coverage/prerelease.mjs.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - Code coverage report for prerelease.mjs - - - - - - - - - -
-
-

All files prerelease.mjs

-
- -
- 100% - Statements - 4/4 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 4/4 -
- - -
-

- 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 -81x -  -1x -3x -1x -  -  - 
import semver from 'semver'
- 
-const prerelease = (version) => {
-  return semver.prerelease(version)
-}
- 
-export { prerelease }
- 
- -
-
- - - - - - - - \ 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/valid-version-or-range.mjs.html b/qa/coverage/valid-version-or-range.mjs.html deleted file mode 100644 index 0579861..0000000 --- a/qa/coverage/valid-version-or-range.mjs.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - Code coverage report for valid-version-or-range.mjs - - - - - - - - - -
-
-

All files valid-version-or-range.mjs

-
- -
- 83.33% - Statements - 5/6 -
- - -
- 63.63% - Branches - 7/11 -
- - -
- 50% - Functions - 1/2 -
- - -
- 83.33% - Lines - 5/6 -
- - -
-

- 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 -161x -  -1x -  -1x -  -  -  -  -  -10x -  -1x -  -  - 
import semver from 'semver'
- 
-import { xRangeRE } from './constants'
- 
-const validVersionOrRange = ({
-  dissallowRanges = false,
-  dissallowVersions = false,
-  input = throw new Error("'input' is required."),
-  onlyXRange = false
-}) =>
-  (dissallowVersions !== true && semver.valid(input))
-    || (onlyXRange !== true && dissallowRanges !== true && semver.validRange(input))
-    || (onlyXRange === true && input.match(xRangeRE))
- 
-export { validVersionOrRange }
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/qa/coverage/version-compare.mjs.html b/qa/coverage/version-compare.mjs.html deleted file mode 100644 index 65514b2..0000000 --- a/qa/coverage/version-compare.mjs.html +++ /dev/null @@ -1,256 +0,0 @@ - - - - - - Code coverage report for version-compare.mjs - - - - - - - - - -
-
-

All files version-compare.mjs

-
- -
- 93.93% - Statements - 31/33 -
- - -
- 100% - Branches - 12/12 -
- - -
- 71.42% - Functions - 5/7 -
- - -
- 100% - Lines - 30/30 -
- - -
-

- 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 -581x -  -1x -  -14x -30x -30x -14x -  -16x -8x -  -  -  -14x -  -  -1x -9x -1x -  -  -8x -  -7x -1x -  -1x -9x -1x -  -  -8x -  -7x -1x -  -1x -16x -38x -  -38x -6x -4x -  -  -2x -  -  -  -32x -  -  -14x -  -  -  - 
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 }
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/qa/coverage/x-sort.mjs.html b/qa/coverage/x-sort.mjs.html deleted file mode 100644 index d564870..0000000 --- a/qa/coverage/x-sort.mjs.html +++ /dev/null @@ -1,391 +0,0 @@ - - - - - - Code coverage report for x-sort.mjs - - - - - - - - - -
-
-

All files x-sort.mjs

-
- -
- 89.28% - Statements - 50/56 -
- - -
- 76% - Branches - 19/25 -
- - -
- 100% - Functions - 4/4 -
- - -
- 88.88% - Lines - 48/54 -
- - -
-

- 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 -1031x -  -1x -1x -  -  -  -  -1x -  -16x -16x -  -  -47x -  -16x -47x -26x -  -  -21x -21x -21x -  -  -  -  -  -  -  -  -  -  -  -  -  -16x -  -16x -20x -20x -  -20x -  -  -20x -  -  -20x -7x -  -  -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 { firstPast } from './first-past'
- 
-/**
- * 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.)
- */
-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 = firstPast(a)
-    const firstPastB = firstPast(b)
- 
-    Iif (firstPastA === null && firstPastB === null) {
-      return 0
-    }
-    else Iif (firstPastA === null) {
-      return 1
-    }
-    else if (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 a2ca597..0000000 --- a/qa/lint.txt +++ /dev/null @@ -1 +0,0 @@ -Test git rev: 0b5e561d02ac5a578f60fe90ee6a1c9816cfd188 diff --git a/qa/unit-test.txt b/qa/unit-test.txt deleted file mode 100644 index 4e05e8f..0000000 --- a/qa/unit-test.txt +++ /dev/null @@ -1,29 +0,0 @@ -Test git rev: 0b5e561d02ac5a578f60fe90ee6a1c9816cfd188 -PASS test/version-compare.test.js -PASS test/next-version.test.js -PASS test/x-sort.test.js -PASS test/prerelease.test.js -PASS test/min-version.test.js -PASS test/filter-valid-version-or-range.test.js -PASS test/first-past.test.js ------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ------------------------------------|---------|----------|---------|---------|------------------- -All files | 93.51 | 86.17 | 80 | 94.28 | - constants.mjs | 100 | 100 | 100 | 100 | - ext-constants.mjs | 100 | 100 | 100 | 100 | - filter-valid-version-or-range.mjs | 83.33 | 0 | 66.66 | 75 | 4 - first-past.mjs | 95.65 | 100 | 100 | 95.65 | 34 - min-version.mjs | 90 | 100 | 100 | 90 | 18 - next-version.mjs | 100 | 94.73 | 100 | 100 | 58,63 - prerelease.mjs | 100 | 100 | 100 | 100 | - valid-version-or-range.mjs | 83.33 | 63.63 | 50 | 83.33 | 8 - version-compare.mjs | 93.93 | 100 | 71.42 | 100 | - x-sort.mjs | 89.28 | 76 | 100 | 88.88 | 27-32,45,48 ------------------------------------|---------|----------|---------|---------|------------------- - -Test Suites: 7 passed, 7 total -Tests: 99 passed, 99 total -Snapshots: 0 total -Time: 0.368 s, estimated 1 s -Ran all test suites.