From 31d9a5d0fddbb7dfc92c96032a9ead3149c1619c Mon Sep 17 00:00:00 2001 From: Zane Rockenbaugh Date: Sat, 11 Oct 2025 21:15:01 -0500 Subject: [PATCH 1/7] limit `nextVersion()` to singular versions and disallow ranges; fix incorrect production version checks --- src/next-version.mjs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/next-version.mjs b/src/next-version.mjs index b648b13..4e48dc9 100644 --- a/src/next-version.mjs +++ b/src/next-version.mjs @@ -20,8 +20,13 @@ const nextVersion = ({ currVer, increment, loose = false }) => { if (increment !== undefined && !increments.includes(increment)) { throw createError.BadRequest(`Invalid increment '${increment}' specified.`) } + if (!semver.valid(currVer)) { + const msg = `Invalid version '${currVer}'` + (semver.validRange(currVer) ? '; range not allowed.' : '.') + throw createError.BadRequest(msg) + } // what are we incrementing? default is patch for released and prerelease for pre-release projects - increment = increment || (currVer.match(/^[\d.Z-]+$/) ? 'patch' : 'prerelease') + // TODO: allow 'build' /^[\d.]+(+[a-zA-Z0-9.-]+)?$/ + increment = increment || (currVer.match(/^[\d.]+$/) ? 'patch' : 'prerelease') let nextVer // determine concrete value for increment @@ -46,10 +51,10 @@ const nextVersion = ({ currVer, increment, loose = false }) => { // 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') + if (currPrerelease === 'alpha') nextVer = currVer.replace(/([0-1.]+)-alpha(\.\d+)?/, '$1-beta.0') + else if (currPrerelease === 'beta') nextVer = currVer.replace(/([0-1.]+)-beta(\.\d+)?/, '$1-rc.0') else if (currPrerelease === 'rc') { // is special in the case of timever + pretype - nextVer = currVer.replace(/([0-9.Z]+)-rc(?:\.\d+)?/, '$1') + nextVer = currVer.replace(/([0-9.]+)-rc(?:\.\d+)?/, '$1') } return nextVer // we're done @@ -64,10 +69,10 @@ const nextVersion = ({ currVer, increment, loose = false }) => { } if (increment === 'gold') { - nextVer = currVer.replace(/^([\d.Z]+)-(?:alpha|beta|rc)(?:\.\d+)?/, '$1') + nextVer = currVer.replace(/^([\d.]+)-(?:alpha|beta|rc)(?:\.\d+)?/, '$1') } else { - nextVer = currVer.replace(/^([\d.Z-]+)(?:alpha|beta|rc)(?:\.\d+)?/, `$1${increment}.0`) + nextVer = currVer.replace(/^([\d.]+)-(?:alpha|beta|rc)(?:\.\d+)?/, `$1-${increment}.0`) } return nextVer From 41db287a357ca7ce09cc6a9b5051da8f7257a94b Mon Sep 17 00:00:00 2001 From: Zane Rockenbaugh Date: Sat, 11 Oct 2025 21:15:49 -0500 Subject: [PATCH 2/7] test ranges are rejected by `nextVersion()` and remove deprecated tests --- src/test/first-past.test.mjs | 4 ++-- src/test/next-version.test.js | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/test/first-past.test.mjs b/src/test/first-past.test.mjs index 652bd3d..e142c83 100644 --- a/src/test/first-past.test.mjs +++ b/src/test/first-past.test.mjs @@ -6,8 +6,8 @@ describe('firstPast', () => { ['*', null], ['1.*', '2.0.0'], ['1.2.*', '1.3.0'], - ['1.2.3-alpha.*', '1.2.3-beta.0'], - ['1.2.3-beta.*', '1.2.3-rc.0'], + // ['1.2.3-alpha.*', '1.2.3-beta.0'], + // ['1.2.3-beta.*', '1.2.3-rc.0'], ['1.2.3-rc.*', '1.2.3'] ])('%s => %s', (input, expected) => expect(firstPast(input)).toBe(expected)) }) diff --git a/src/test/next-version.test.js b/src/test/next-version.test.js index 37d9fcc..7b59d4f 100644 --- a/src/test/next-version.test.js +++ b/src/test/next-version.test.js @@ -12,6 +12,9 @@ describe('nextVersion', () => { ['1.0.0-beta.94', undefined, '1.0.0-beta.95'], ['1.0.0-beta.94', 'prerelease', '1.0.0-beta.95'], ['1.0.0-rc.94', undefined, '1.0.0-rc.95'], + // TODO + // ['1.0.0-Z.3', undefined, '1.0.0-Z.4'], // non-standard prerelease + // ['1.0.0-0', undefined, '1.0.0-1'], // -0 pre-release ['1.0.0-rc.94', 'prerelease', '1.0.0-rc.95'], ['1.0.0', 'patch', '1.0.1'], ['1.0.0', 'minor', '1.1.0'], @@ -61,4 +64,7 @@ describe('nextVersion', () => { const currVer = `1.0.0-${currPrerelease}` expect(() => ver.version({ currVer, increment : 'prerelease' })) }) + + test.each(['1.0.x', '^1.0.0', '1.0.0 - 1.x', '~1.0.0'])('raises except on range input %s', (currVer) => + expect(() => ver.nextVersion({ currVer, increment : 'prerelease' })).toThrow(/range not allowed/i)) }) From b28fffd2111d1bdcb753c5616d669302a3ed809f Mon Sep 17 00:00:00 2001 From: Zane Rockenbaugh Date: Sat, 11 Oct 2025 21:17:15 -0500 Subject: [PATCH 3/7] Save QA files. --- qa/coverage/base.css | 224 ++++++++++ qa/coverage/block-navigation.js | 87 ++++ qa/coverage/clover.xml | 226 ++++++++++ qa/coverage/constants.mjs.html | 100 +++++ qa/coverage/coverage-final.json | 12 + 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 | 266 ++++++++++++ qa/coverage/min-version.mjs.html | 148 +++++++ qa/coverage/next-version.mjs.html | 352 ++++++++++++++++ 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/upper-bound.mjs.html | 151 +++++++ 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 | 32 ++ 23 files changed, 3131 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/upper-bound.mjs.html 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..2e94a9e --- /dev/null +++ b/qa/coverage/clover.xml @@ -0,0 +1,226 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/qa/coverage/constants.mjs.html b/qa/coverage/constants.mjs.html new file mode 100644 index 0000000..857f96c --- /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 +65x +  +  +  +5x + 
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..76546af --- /dev/null +++ b/qa/coverage/coverage-final.json @@ -0,0 +1,12 @@ +{"/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":5,"1":5},"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":44,"6":44,"7":44,"8":44,"9":8,"10":36,"11":36,"12":36,"13":15,"14":21,"15":21,"16":21,"17":17,"18":4,"19":4,"20":4,"21":0,"22":2},"f":{"0":44},"b":{"0":[8],"1":[15],"2":[17],"3":[4]}} +,"/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":57,"4":10,"5":47,"6":47,"7":47,"8":0,"9":3},"f":{"0":57},"b":{"0":[10,47],"1":[47]}} +,"/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":87,"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":23,"column":2},"end":{"line":26,"column":null}},"7":{"start":{"line":24,"column":17},"end":{"line":24,"column":108}},"8":{"start":{"line":25,"column":4},"end":{"line":25,"column":null}},"9":{"start":{"line":29,"column":2},"end":{"line":29,"column":null}},"10":{"start":{"line":33,"column":23},"end":{"line":33,"column":101}},"11":{"start":{"line":34,"column":2},"end":{"line":37,"column":null}},"12":{"start":{"line":34,"column":34},"end":{"line":34,"column":null}},"13":{"start":{"line":35,"column":7},"end":{"line":37,"column":null}},"14":{"start":{"line":36,"column":4},"end":{"line":36,"column":null}},"15":{"start":{"line":39,"column":2},"end":{"line":41,"column":null}},"16":{"start":{"line":40,"column":4},"end":{"line":40,"column":null}},"17":{"start":{"line":42,"column":2},"end":{"line":50,"column":null}},"18":{"start":{"line":43,"column":4},"end":{"line":49,"column":null}},"19":{"start":{"line":44,"column":6},"end":{"line":44,"column":null}},"20":{"start":{"line":45,"column":6},"end":{"line":45,"column":null}},"21":{"start":{"line":48,"column":6},"end":{"line":48,"column":null}},"22":{"start":{"line":53,"column":2},"end":{"line":79,"column":null}},"23":{"start":{"line":54,"column":4},"end":{"line":58,"column":null}},"24":{"start":{"line":54,"column":36},"end":{"line":54,"column":null}},"25":{"start":{"line":55,"column":9},"end":{"line":58,"column":null}},"26":{"start":{"line":55,"column":40},"end":{"line":55,"column":null}},"27":{"start":{"line":56,"column":9},"end":{"line":58,"column":null}},"28":{"start":{"line":57,"column":6},"end":{"line":57,"column":null}},"29":{"start":{"line":60,"column":4},"end":{"line":60,"column":19}},"30":{"start":{"line":62,"column":7},"end":{"line":79,"column":null}},"31":{"start":{"line":63,"column":32},"end":{"line":65,"column":44}},"32":{"start":{"line":66,"column":30},"end":{"line":66,"column":61}},"33":{"start":{"line":67,"column":4},"end":{"line":69,"column":null}},"34":{"start":{"line":68,"column":6},"end":{"line":68,"column":null}},"35":{"start":{"line":71,"column":4},"end":{"line":76,"column":null}},"36":{"start":{"line":72,"column":6},"end":{"line":72,"column":null}},"37":{"start":{"line":75,"column":6},"end":{"line":75,"column":null}},"38":{"start":{"line":78,"column":4},"end":{"line":78,"column":null}},"39":{"start":{"line":82,"column":2},"end":{"line":84,"column":null}},"40":{"start":{"line":86,"column":2},"end":{"line":86,"column":null}},"41":{"start":{"line":87,"column":1},"end":{"line":87,"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":87,"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":23,"column":2},"end":{"line":26,"column":null}},"type":"if","locations":[{"start":{"line":23,"column":2},"end":{"line":26,"column":null}}]},"4":{"loc":{"start":{"line":24,"column":50},"end":{"line":24,"column":107}},"type":"cond-expr","locations":[{"start":{"line":24,"column":79},"end":{"line":24,"column":101}},{"start":{"line":24,"column":104},"end":{"line":24,"column":107}}]},"5":{"loc":{"start":{"line":29,"column":14},"end":{"line":29,"column":79}},"type":"binary-expr","locations":[{"start":{"line":29,"column":14},"end":{"line":29,"column":23}},{"start":{"line":29,"column":28},"end":{"line":29,"column":78}}]},"6":{"loc":{"start":{"line":29,"column":28},"end":{"line":29,"column":78}},"type":"cond-expr","locations":[{"start":{"line":29,"column":56},"end":{"line":29,"column":63}},{"start":{"line":29,"column":66},"end":{"line":29,"column":78}}]},"7":{"loc":{"start":{"line":34,"column":2},"end":{"line":37,"column":null}},"type":"if","locations":[{"start":{"line":34,"column":2},"end":{"line":37,"column":null}},{"start":{"line":35,"column":7},"end":{"line":37,"column":null}}]},"8":{"loc":{"start":{"line":35,"column":7},"end":{"line":37,"column":null}},"type":"if","locations":[{"start":{"line":35,"column":7},"end":{"line":37,"column":null}}]},"9":{"loc":{"start":{"line":39,"column":2},"end":{"line":41,"column":null}},"type":"if","locations":[{"start":{"line":39,"column":2},"end":{"line":41,"column":null}}]},"10":{"loc":{"start":{"line":39,"column":6},"end":{"line":39,"column":73}},"type":"binary-expr","locations":[{"start":{"line":39,"column":6},"end":{"line":39,"column":29}},{"start":{"line":39,"column":33},"end":{"line":39,"column":73}}]},"11":{"loc":{"start":{"line":42,"column":2},"end":{"line":50,"column":null}},"type":"if","locations":[{"start":{"line":42,"column":2},"end":{"line":50,"column":null}}]},"12":{"loc":{"start":{"line":42,"column":6},"end":{"line":42,"column":74}},"type":"binary-expr","locations":[{"start":{"line":42,"column":6},"end":{"line":42,"column":29}},{"start":{"line":42,"column":33},"end":{"line":42,"column":74}}]},"13":{"loc":{"start":{"line":43,"column":4},"end":{"line":49,"column":null}},"type":"if","locations":[{"start":{"line":43,"column":4},"end":{"line":49,"column":null}},{"start":{"line":47,"column":9},"end":{"line":49,"column":null}}]},"14":{"loc":{"start":{"line":53,"column":2},"end":{"line":79,"column":null}},"type":"if","locations":[{"start":{"line":53,"column":2},"end":{"line":79,"column":null}},{"start":{"line":62,"column":7},"end":{"line":79,"column":null}}]},"15":{"loc":{"start":{"line":54,"column":4},"end":{"line":58,"column":null}},"type":"if","locations":[{"start":{"line":54,"column":4},"end":{"line":58,"column":null}},{"start":{"line":55,"column":9},"end":{"line":58,"column":null}}]},"16":{"loc":{"start":{"line":55,"column":9},"end":{"line":58,"column":null}},"type":"if","locations":[{"start":{"line":55,"column":9},"end":{"line":58,"column":null}},{"start":{"line":56,"column":9},"end":{"line":58,"column":null}}]},"17":{"loc":{"start":{"line":56,"column":9},"end":{"line":58,"column":null}},"type":"if","locations":[{"start":{"line":56,"column":9},"end":{"line":58,"column":null}}]},"18":{"loc":{"start":{"line":62,"column":7},"end":{"line":79,"column":null}},"type":"if","locations":[{"start":{"line":62,"column":7},"end":{"line":79,"column":null}}]},"19":{"loc":{"start":{"line":63,"column":32},"end":{"line":65,"column":44}},"type":"cond-expr","locations":[{"start":{"line":64,"column":8},"end":{"line":64,"column":36}},{"start":{"line":65,"column":8},"end":{"line":65,"column":44}}]},"20":{"loc":{"start":{"line":67,"column":4},"end":{"line":69,"column":null}},"type":"if","locations":[{"start":{"line":67,"column":4},"end":{"line":69,"column":null}}]},"21":{"loc":{"start":{"line":68,"column":78},"end":{"line":68,"column":103}},"type":"binary-expr","locations":[{"start":{"line":68,"column":78},"end":{"line":68,"column":92}},{"start":{"line":68,"column":96},"end":{"line":68,"column":103}}]},"22":{"loc":{"start":{"line":71,"column":4},"end":{"line":76,"column":null}},"type":"if","locations":[{"start":{"line":71,"column":4},"end":{"line":76,"column":null}},{"start":{"line":74,"column":9},"end":{"line":76,"column":null}}]},"23":{"loc":{"start":{"line":82,"column":12},"end":{"line":84,"column":36}},"type":"cond-expr","locations":[{"start":{"line":83,"column":6},"end":{"line":83,"column":45}},{"start":{"line":84,"column":6},"end":{"line":84,"column":36}}]},"24":{"loc":{"start":{"line":82,"column":12},"end":{"line":82,"column":70}},"type":"binary-expr","locations":[{"start":{"line":82,"column":12},"end":{"line":82,"column":39}},{"start":{"line":82,"column":43},"end":{"line":82,"column":70}}]}},"s":{"0":3,"1":3,"2":3,"3":3,"4":161,"5":1,"6":160,"7":4,"8":4,"9":156,"10":156,"11":156,"12":100,"13":56,"14":1,"15":155,"16":4,"17":151,"18":18,"19":12,"20":12,"21":6,"22":145,"23":8,"24":3,"25":5,"26":2,"27":3,"28":3,"29":8,"30":137,"31":23,"32":23,"33":23,"34":5,"35":18,"36":15,"37":3,"38":18,"39":114,"40":114,"41":3},"f":{"0":161},"b":{"0":[60],"1":[1],"2":[161,157],"3":[4],"4":[4,0],"5":[156,4],"6":[1,3],"7":[100,56],"8":[1],"9":[4],"10":[155,100],"11":[18],"12":[151,55],"13":[12,6],"14":[8,137],"15":[3,5],"16":[2,3],"17":[3],"18":[23],"19":[0,23],"20":[5],"21":[5,0],"22":[15,3],"23":[3,111],"24":[114,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/upper-bound.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/upper-bound.mjs","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":10,"column":20},"end":{"line":20,"column":1}},"2":{"start":{"line":11,"column":26},"end":{"line":11,"column":50}},"3":{"start":{"line":12,"column":2},"end":{"line":14,"column":null}},"4":{"start":{"line":13,"column":4},"end":{"line":13,"column":null}},"5":{"start":{"line":16,"column":17},"end":{"line":16,"column":43}},"6":{"start":{"line":17,"column":21},"end":{"line":17,"column":46}},"7":{"start":{"line":19,"column":2},"end":{"line":19,"column":null}},"8":{"start":{"line":20,"column":1},"end":{"line":20,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":10,"column":20},"end":{"line":10,"column":25}},"loc":{"start":{"line":10,"column":30},"end":{"line":20,"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":19,"column":9},"end":{"line":19,"column":71}},"type":"cond-expr","locations":[{"start":{"line":19,"column":39},"end":{"line":19,"column":58}},{"start":{"line":19,"column":61},"end":{"line":19,"column":71}}]}},"s":{"0":1,"1":1,"2":7,"3":7,"4":0,"5":7,"6":7,"7":7,"8":1},"f":{"0":7},"b":{"0":[0],"1":[1,6]}} +,"/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":54}},"3":{"start":{"line":8,"column":7},"end":{"line":8,"column":16}},"4":{"start":{"line":11,"column":2},"end":{"line":13,"column":54}},"5":{"start":{"line":13,"column":54},"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":2},"end":{"line":13,"column":54}}},"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":6},"end":{"line":13,"column":53}},"type":"binary-expr","locations":[{"start":{"line":11,"column":6},"end":{"line":11,"column":32}},{"start":{"line":11,"column":36},"end":{"line":11,"column":55}},{"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":2,"1":2,"2":2,"3":0,"4":16,"5":2},"f":{"0":16,"1":0},"b":{"0":[16],"1":[16],"2":[0],"3":[5],"4":[16,16,9,1,1,8,8]}} +,"/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..ceaec3c --- /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..8c3fa99 --- /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 +44x +  +44x +44x +44x +8x +  +  +36x +36x +36x +15x +  +  +21x +21x +21x +17x +  +  +4x +4x +4x +  +  +  +  +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..43abde2 --- /dev/null +++ b/qa/coverage/index.html @@ -0,0 +1,266 @@ + + + + + + Code coverage report for All files + + + + + + + + + +
+
+

All files

+
+ +
+ 93.4% + Statements + 184/197 +
+ + +
+ 88% + Branches + 88/100 +
+ + +
+ 80.95% + Functions + 17/21 +
+ + +
+ 94.11% + Lines + 176/187 +
+ + +
+

+ 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%42/4292.68%38/41100%1/1100%39/39
prerelease.mjs +
+
100%4/4100%0/0100%1/1100%4/4
upper-bound.mjs +
+
88.88%8/966.66%2/3100%1/188.88%8/9
valid-version-or-range.mjs +
+
83.33%5/690.9%10/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..cc1b769 --- /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 +  +  +57x +10x +  +  +47x +47x +47x +  +  +  +  +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..75a5510 --- /dev/null +++ b/qa/coverage/next-version.mjs.html @@ -0,0 +1,352 @@ + + + + + + Code coverage report for next-version.mjs + + + + + + + + + +
+
+

All files next-version.mjs

+
+ +
+ 100% + Statements + 42/42 +
+ + +
+ 92.68% + Branches + 38/41 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 100% + Lines + 39/39 +
+ + +
+

+ 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 +903x +3x +  +3x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3x +161x +1x +  +160x +4x +4x +  +  +  +156x +  +  +  +156x +156x +56x +1x +  +  +155x +4x +  +151x +18x +12x +12x +  +  +6x +  +  +  +  +145x +8x +5x +3x +3x +  +  +8x +  +137x +23x +  +  +23x +23x +5x +  +  +18x +15x +  +  +3x +  +  +18x +  +  +  +114x +  +  +  +114x +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.`)
+  }
+  if (!semver.valid(currVer)) {
+    const msg = `Invalid version '${currVer}'` + (semver.validRange(currVer) ? '; range not allowed.' : '.')
+    throw createError.BadRequest(msg)
+  }
+  // what are we incrementing? default is patch for released and prerelease for pre-release projects
+  // TODO: allow 'build' /^[\d.]+(+[a-zA-Z0-9.-]+)?$/
+  increment = increment || (currVer.match(/^[\d.]+$/) ? '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.]+)-alpha(\.\d+)?/, '$1-beta.0')
+    else if (currPrerelease === 'beta') nextVer = currVer.replace(/([0-1.]+)-beta(\.\d+)?/, '$1-rc.0')
+    else if (currPrerelease === 'rc') { // is special in the case of timever + pretype
+      nextVer = currVer.replace(/([0-9.]+)-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.]+)-(?:alpha|beta|rc)(?:\.\d+)?/, '$1')
+    }
+    else {
+      nextVer = currVer.replace(/^([\d.]+)-(?: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..c60d0be --- /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/upper-bound.mjs.html b/qa/coverage/upper-bound.mjs.html new file mode 100644 index 0000000..a801b65 --- /dev/null +++ b/qa/coverage/upper-bound.mjs.html @@ -0,0 +1,151 @@ + + + + + + Code coverage report for upper-bound.mjs + + + + + + + + + +
+
+

All files upper-bound.mjs

+
+ +
+ 88.88% + Statements + 8/9 +
+ + +
+ 66.66% + Branches + 2/3 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 88.88% + Lines + 8/9 +
+ + +
+

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

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +231x +  +  +  +  +  +  +  +  +1x +7x +7x +  +  +  +7x +7x +  +7x +1x +  +  + 
import semver from 'semver'
+ 
+/**
+ * Finds the ceiling of a range. For '*', the ceiling is '*'. For specific versions or any range capped by a specific
+ * version, the ceiling is that version. For any open-ended range, the ceiling is defined by a '<version>-0' range
+ * function where 'verision-0' least range above the given range.
+ * @param {string} range - The range to find the ceiling for.
+ * @returns {string} - Either '*', a specific version, or a '<version>-0'.
+ */
+const upperBound = (range) => {
+  const normalizedRange = semver.validRange(range)
+  Iif (normalizedRange === null) {
+    return null
+  }
+ 
+  const ranges = normalizedRange.split(' ')
+  const upperRange = ranges[ranges.length - 1]
+ 
+  return upperRange.startsWith('<=') ? upperRange.slice(2) : upperRange
+}
+ 
+export { upperBound }
+ 
+ +
+
+ + + + + + + + \ No newline at end of file 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..32c14d3 --- /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 +
+ + +
+ 90.9% + Branches + 10/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 +162x +  +2x +  +2x +  +  +  +  +  +16x +  +2x +  +  + 
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..1f0e483 --- /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..b1b8b0a --- /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..79b9376 --- /dev/null +++ b/qa/lint.txt @@ -0,0 +1 @@ +Test git rev: 8ee192aea47c7ae4c930980057ccdd83df3708f3 diff --git a/qa/unit-test.txt b/qa/unit-test.txt new file mode 100644 index 0000000..0dfaa18 --- /dev/null +++ b/qa/unit-test.txt @@ -0,0 +1,32 @@ +Test git rev: 8ee192aea47c7ae4c930980057ccdd83df3708f3 +PASS test/first-past.test.js +PASS test/next-version.test.js +PASS test/x-sort.test.js +PASS test/version-compare.test.js +PASS test/upper-bound.test.js +PASS test/valid-version-or-range.test.js +PASS test/filter-valid-version-or-range.test.js +PASS test/min-version.test.js +PASS test/prerelease.test.js +-----------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +-----------------------------------|---------|----------|---------|---------|------------------- +All files | 93.4 | 88 | 80.95 | 94.11 | + 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 | 92.68 | 100 | 100 | 24,63,68 + prerelease.mjs | 100 | 100 | 100 | 100 | + upper-bound.mjs | 88.88 | 66.66 | 100 | 88.88 | 13 + valid-version-or-range.mjs | 83.33 | 90.9 | 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: 9 passed, 9 total +Tests: 115 passed, 115 total +Snapshots: 0 total +Time: 0.331 s, estimated 1 s +Ran all test suites. From 1e24ac54e83ae74cfa456d521e259a8fb93df9f1 Mon Sep 17 00:00:00 2001 From: Zane Rockenbaugh Date: Sat, 11 Oct 2025 21:17:15 -0500 Subject: [PATCH 4/7] removed QA files --- qa/coverage/base.css | 224 ---------- qa/coverage/block-navigation.js | 87 ---- qa/coverage/clover.xml | 226 ---------- qa/coverage/constants.mjs.html | 100 ----- qa/coverage/coverage-final.json | 12 - 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 | 266 ------------ qa/coverage/min-version.mjs.html | 148 ------- qa/coverage/next-version.mjs.html | 352 ---------------- 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/upper-bound.mjs.html | 151 ------- 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 | 32 -- 23 files changed, 3131 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/upper-bound.mjs.html 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 2e94a9e..0000000 --- a/qa/coverage/clover.xml +++ /dev/null @@ -1,226 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/qa/coverage/constants.mjs.html b/qa/coverage/constants.mjs.html deleted file mode 100644 index 857f96c..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 -65x -  -  -  -5x - 
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 76546af..0000000 --- a/qa/coverage/coverage-final.json +++ /dev/null @@ -1,12 +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":5,"1":5},"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":44,"6":44,"7":44,"8":44,"9":8,"10":36,"11":36,"12":36,"13":15,"14":21,"15":21,"16":21,"17":17,"18":4,"19":4,"20":4,"21":0,"22":2},"f":{"0":44},"b":{"0":[8],"1":[15],"2":[17],"3":[4]}} -,"/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":57,"4":10,"5":47,"6":47,"7":47,"8":0,"9":3},"f":{"0":57},"b":{"0":[10,47],"1":[47]}} -,"/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":87,"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":23,"column":2},"end":{"line":26,"column":null}},"7":{"start":{"line":24,"column":17},"end":{"line":24,"column":108}},"8":{"start":{"line":25,"column":4},"end":{"line":25,"column":null}},"9":{"start":{"line":29,"column":2},"end":{"line":29,"column":null}},"10":{"start":{"line":33,"column":23},"end":{"line":33,"column":101}},"11":{"start":{"line":34,"column":2},"end":{"line":37,"column":null}},"12":{"start":{"line":34,"column":34},"end":{"line":34,"column":null}},"13":{"start":{"line":35,"column":7},"end":{"line":37,"column":null}},"14":{"start":{"line":36,"column":4},"end":{"line":36,"column":null}},"15":{"start":{"line":39,"column":2},"end":{"line":41,"column":null}},"16":{"start":{"line":40,"column":4},"end":{"line":40,"column":null}},"17":{"start":{"line":42,"column":2},"end":{"line":50,"column":null}},"18":{"start":{"line":43,"column":4},"end":{"line":49,"column":null}},"19":{"start":{"line":44,"column":6},"end":{"line":44,"column":null}},"20":{"start":{"line":45,"column":6},"end":{"line":45,"column":null}},"21":{"start":{"line":48,"column":6},"end":{"line":48,"column":null}},"22":{"start":{"line":53,"column":2},"end":{"line":79,"column":null}},"23":{"start":{"line":54,"column":4},"end":{"line":58,"column":null}},"24":{"start":{"line":54,"column":36},"end":{"line":54,"column":null}},"25":{"start":{"line":55,"column":9},"end":{"line":58,"column":null}},"26":{"start":{"line":55,"column":40},"end":{"line":55,"column":null}},"27":{"start":{"line":56,"column":9},"end":{"line":58,"column":null}},"28":{"start":{"line":57,"column":6},"end":{"line":57,"column":null}},"29":{"start":{"line":60,"column":4},"end":{"line":60,"column":19}},"30":{"start":{"line":62,"column":7},"end":{"line":79,"column":null}},"31":{"start":{"line":63,"column":32},"end":{"line":65,"column":44}},"32":{"start":{"line":66,"column":30},"end":{"line":66,"column":61}},"33":{"start":{"line":67,"column":4},"end":{"line":69,"column":null}},"34":{"start":{"line":68,"column":6},"end":{"line":68,"column":null}},"35":{"start":{"line":71,"column":4},"end":{"line":76,"column":null}},"36":{"start":{"line":72,"column":6},"end":{"line":72,"column":null}},"37":{"start":{"line":75,"column":6},"end":{"line":75,"column":null}},"38":{"start":{"line":78,"column":4},"end":{"line":78,"column":null}},"39":{"start":{"line":82,"column":2},"end":{"line":84,"column":null}},"40":{"start":{"line":86,"column":2},"end":{"line":86,"column":null}},"41":{"start":{"line":87,"column":1},"end":{"line":87,"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":87,"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":23,"column":2},"end":{"line":26,"column":null}},"type":"if","locations":[{"start":{"line":23,"column":2},"end":{"line":26,"column":null}}]},"4":{"loc":{"start":{"line":24,"column":50},"end":{"line":24,"column":107}},"type":"cond-expr","locations":[{"start":{"line":24,"column":79},"end":{"line":24,"column":101}},{"start":{"line":24,"column":104},"end":{"line":24,"column":107}}]},"5":{"loc":{"start":{"line":29,"column":14},"end":{"line":29,"column":79}},"type":"binary-expr","locations":[{"start":{"line":29,"column":14},"end":{"line":29,"column":23}},{"start":{"line":29,"column":28},"end":{"line":29,"column":78}}]},"6":{"loc":{"start":{"line":29,"column":28},"end":{"line":29,"column":78}},"type":"cond-expr","locations":[{"start":{"line":29,"column":56},"end":{"line":29,"column":63}},{"start":{"line":29,"column":66},"end":{"line":29,"column":78}}]},"7":{"loc":{"start":{"line":34,"column":2},"end":{"line":37,"column":null}},"type":"if","locations":[{"start":{"line":34,"column":2},"end":{"line":37,"column":null}},{"start":{"line":35,"column":7},"end":{"line":37,"column":null}}]},"8":{"loc":{"start":{"line":35,"column":7},"end":{"line":37,"column":null}},"type":"if","locations":[{"start":{"line":35,"column":7},"end":{"line":37,"column":null}}]},"9":{"loc":{"start":{"line":39,"column":2},"end":{"line":41,"column":null}},"type":"if","locations":[{"start":{"line":39,"column":2},"end":{"line":41,"column":null}}]},"10":{"loc":{"start":{"line":39,"column":6},"end":{"line":39,"column":73}},"type":"binary-expr","locations":[{"start":{"line":39,"column":6},"end":{"line":39,"column":29}},{"start":{"line":39,"column":33},"end":{"line":39,"column":73}}]},"11":{"loc":{"start":{"line":42,"column":2},"end":{"line":50,"column":null}},"type":"if","locations":[{"start":{"line":42,"column":2},"end":{"line":50,"column":null}}]},"12":{"loc":{"start":{"line":42,"column":6},"end":{"line":42,"column":74}},"type":"binary-expr","locations":[{"start":{"line":42,"column":6},"end":{"line":42,"column":29}},{"start":{"line":42,"column":33},"end":{"line":42,"column":74}}]},"13":{"loc":{"start":{"line":43,"column":4},"end":{"line":49,"column":null}},"type":"if","locations":[{"start":{"line":43,"column":4},"end":{"line":49,"column":null}},{"start":{"line":47,"column":9},"end":{"line":49,"column":null}}]},"14":{"loc":{"start":{"line":53,"column":2},"end":{"line":79,"column":null}},"type":"if","locations":[{"start":{"line":53,"column":2},"end":{"line":79,"column":null}},{"start":{"line":62,"column":7},"end":{"line":79,"column":null}}]},"15":{"loc":{"start":{"line":54,"column":4},"end":{"line":58,"column":null}},"type":"if","locations":[{"start":{"line":54,"column":4},"end":{"line":58,"column":null}},{"start":{"line":55,"column":9},"end":{"line":58,"column":null}}]},"16":{"loc":{"start":{"line":55,"column":9},"end":{"line":58,"column":null}},"type":"if","locations":[{"start":{"line":55,"column":9},"end":{"line":58,"column":null}},{"start":{"line":56,"column":9},"end":{"line":58,"column":null}}]},"17":{"loc":{"start":{"line":56,"column":9},"end":{"line":58,"column":null}},"type":"if","locations":[{"start":{"line":56,"column":9},"end":{"line":58,"column":null}}]},"18":{"loc":{"start":{"line":62,"column":7},"end":{"line":79,"column":null}},"type":"if","locations":[{"start":{"line":62,"column":7},"end":{"line":79,"column":null}}]},"19":{"loc":{"start":{"line":63,"column":32},"end":{"line":65,"column":44}},"type":"cond-expr","locations":[{"start":{"line":64,"column":8},"end":{"line":64,"column":36}},{"start":{"line":65,"column":8},"end":{"line":65,"column":44}}]},"20":{"loc":{"start":{"line":67,"column":4},"end":{"line":69,"column":null}},"type":"if","locations":[{"start":{"line":67,"column":4},"end":{"line":69,"column":null}}]},"21":{"loc":{"start":{"line":68,"column":78},"end":{"line":68,"column":103}},"type":"binary-expr","locations":[{"start":{"line":68,"column":78},"end":{"line":68,"column":92}},{"start":{"line":68,"column":96},"end":{"line":68,"column":103}}]},"22":{"loc":{"start":{"line":71,"column":4},"end":{"line":76,"column":null}},"type":"if","locations":[{"start":{"line":71,"column":4},"end":{"line":76,"column":null}},{"start":{"line":74,"column":9},"end":{"line":76,"column":null}}]},"23":{"loc":{"start":{"line":82,"column":12},"end":{"line":84,"column":36}},"type":"cond-expr","locations":[{"start":{"line":83,"column":6},"end":{"line":83,"column":45}},{"start":{"line":84,"column":6},"end":{"line":84,"column":36}}]},"24":{"loc":{"start":{"line":82,"column":12},"end":{"line":82,"column":70}},"type":"binary-expr","locations":[{"start":{"line":82,"column":12},"end":{"line":82,"column":39}},{"start":{"line":82,"column":43},"end":{"line":82,"column":70}}]}},"s":{"0":3,"1":3,"2":3,"3":3,"4":161,"5":1,"6":160,"7":4,"8":4,"9":156,"10":156,"11":156,"12":100,"13":56,"14":1,"15":155,"16":4,"17":151,"18":18,"19":12,"20":12,"21":6,"22":145,"23":8,"24":3,"25":5,"26":2,"27":3,"28":3,"29":8,"30":137,"31":23,"32":23,"33":23,"34":5,"35":18,"36":15,"37":3,"38":18,"39":114,"40":114,"41":3},"f":{"0":161},"b":{"0":[60],"1":[1],"2":[161,157],"3":[4],"4":[4,0],"5":[156,4],"6":[1,3],"7":[100,56],"8":[1],"9":[4],"10":[155,100],"11":[18],"12":[151,55],"13":[12,6],"14":[8,137],"15":[3,5],"16":[2,3],"17":[3],"18":[23],"19":[0,23],"20":[5],"21":[5,0],"22":[15,3],"23":[3,111],"24":[114,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/upper-bound.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/upper-bound.mjs","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":10,"column":20},"end":{"line":20,"column":1}},"2":{"start":{"line":11,"column":26},"end":{"line":11,"column":50}},"3":{"start":{"line":12,"column":2},"end":{"line":14,"column":null}},"4":{"start":{"line":13,"column":4},"end":{"line":13,"column":null}},"5":{"start":{"line":16,"column":17},"end":{"line":16,"column":43}},"6":{"start":{"line":17,"column":21},"end":{"line":17,"column":46}},"7":{"start":{"line":19,"column":2},"end":{"line":19,"column":null}},"8":{"start":{"line":20,"column":1},"end":{"line":20,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":10,"column":20},"end":{"line":10,"column":25}},"loc":{"start":{"line":10,"column":30},"end":{"line":20,"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":19,"column":9},"end":{"line":19,"column":71}},"type":"cond-expr","locations":[{"start":{"line":19,"column":39},"end":{"line":19,"column":58}},{"start":{"line":19,"column":61},"end":{"line":19,"column":71}}]}},"s":{"0":1,"1":1,"2":7,"3":7,"4":0,"5":7,"6":7,"7":7,"8":1},"f":{"0":7},"b":{"0":[0],"1":[1,6]}} -,"/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":54}},"3":{"start":{"line":8,"column":7},"end":{"line":8,"column":16}},"4":{"start":{"line":11,"column":2},"end":{"line":13,"column":54}},"5":{"start":{"line":13,"column":54},"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":2},"end":{"line":13,"column":54}}},"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":6},"end":{"line":13,"column":53}},"type":"binary-expr","locations":[{"start":{"line":11,"column":6},"end":{"line":11,"column":32}},{"start":{"line":11,"column":36},"end":{"line":11,"column":55}},{"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":2,"1":2,"2":2,"3":0,"4":16,"5":2},"f":{"0":16,"1":0},"b":{"0":[16],"1":[16],"2":[0],"3":[5],"4":[16,16,9,1,1,8,8]}} -,"/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 ceaec3c..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 8c3fa99..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 -44x -  -44x -44x -44x -8x -  -  -36x -36x -36x -15x -  -  -21x -21x -21x -17x -  -  -4x -4x -4x -  -  -  -  -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 43abde2..0000000 --- a/qa/coverage/index.html +++ /dev/null @@ -1,266 +0,0 @@ - - - - - - Code coverage report for All files - - - - - - - - - -
-
-

All files

-
- -
- 93.4% - Statements - 184/197 -
- - -
- 88% - Branches - 88/100 -
- - -
- 80.95% - Functions - 17/21 -
- - -
- 94.11% - Lines - 176/187 -
- - -
-

- 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%42/4292.68%38/41100%1/1100%39/39
prerelease.mjs -
-
100%4/4100%0/0100%1/1100%4/4
upper-bound.mjs -
-
88.88%8/966.66%2/3100%1/188.88%8/9
valid-version-or-range.mjs -
-
83.33%5/690.9%10/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 cc1b769..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 -  -  -57x -10x -  -  -47x -47x -47x -  -  -  -  -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 75a5510..0000000 --- a/qa/coverage/next-version.mjs.html +++ /dev/null @@ -1,352 +0,0 @@ - - - - - - Code coverage report for next-version.mjs - - - - - - - - - -
-
-

All files next-version.mjs

-
- -
- 100% - Statements - 42/42 -
- - -
- 92.68% - Branches - 38/41 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 39/39 -
- - -
-

- 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 -903x -3x -  -3x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -3x -161x -1x -  -160x -4x -4x -  -  -  -156x -  -  -  -156x -156x -56x -1x -  -  -155x -4x -  -151x -18x -12x -12x -  -  -6x -  -  -  -  -145x -8x -5x -3x -3x -  -  -8x -  -137x -23x -  -  -23x -23x -5x -  -  -18x -15x -  -  -3x -  -  -18x -  -  -  -114x -  -  -  -114x -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.`)
-  }
-  if (!semver.valid(currVer)) {
-    const msg = `Invalid version '${currVer}'` + (semver.validRange(currVer) ? '; range not allowed.' : '.')
-    throw createError.BadRequest(msg)
-  }
-  // what are we incrementing? default is patch for released and prerelease for pre-release projects
-  // TODO: allow 'build' /^[\d.]+(+[a-zA-Z0-9.-]+)?$/
-  increment = increment || (currVer.match(/^[\d.]+$/) ? '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.]+)-alpha(\.\d+)?/, '$1-beta.0')
-    else if (currPrerelease === 'beta') nextVer = currVer.replace(/([0-1.]+)-beta(\.\d+)?/, '$1-rc.0')
-    else if (currPrerelease === 'rc') { // is special in the case of timever + pretype
-      nextVer = currVer.replace(/([0-9.]+)-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.]+)-(?:alpha|beta|rc)(?:\.\d+)?/, '$1')
-    }
-    else {
-      nextVer = currVer.replace(/^([\d.]+)-(?: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 c60d0be..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/upper-bound.mjs.html b/qa/coverage/upper-bound.mjs.html deleted file mode 100644 index a801b65..0000000 --- a/qa/coverage/upper-bound.mjs.html +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - Code coverage report for upper-bound.mjs - - - - - - - - - -
-
-

All files upper-bound.mjs

-
- -
- 88.88% - Statements - 8/9 -
- - -
- 66.66% - Branches - 2/3 -
- - -
- 100% - Functions - 1/1 -
- - -
- 88.88% - Lines - 8/9 -
- - -
-

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

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -231x -  -  -  -  -  -  -  -  -1x -7x -7x -  -  -  -7x -7x -  -7x -1x -  -  - 
import semver from 'semver'
- 
-/**
- * Finds the ceiling of a range. For '*', the ceiling is '*'. For specific versions or any range capped by a specific
- * version, the ceiling is that version. For any open-ended range, the ceiling is defined by a '<version>-0' range
- * function where 'verision-0' least range above the given range.
- * @param {string} range - The range to find the ceiling for.
- * @returns {string} - Either '*', a specific version, or a '<version>-0'.
- */
-const upperBound = (range) => {
-  const normalizedRange = semver.validRange(range)
-  Iif (normalizedRange === null) {
-    return null
-  }
- 
-  const ranges = normalizedRange.split(' ')
-  const upperRange = ranges[ranges.length - 1]
- 
-  return upperRange.startsWith('<=') ? upperRange.slice(2) : upperRange
-}
- 
-export { upperBound }
- 
- -
-
- - - - - - - - \ No newline at end of file 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 32c14d3..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 -
- - -
- 90.9% - Branches - 10/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 -162x -  -2x -  -2x -  -  -  -  -  -16x -  -2x -  -  - 
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 1f0e483..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 b1b8b0a..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 79b9376..0000000 --- a/qa/lint.txt +++ /dev/null @@ -1 +0,0 @@ -Test git rev: 8ee192aea47c7ae4c930980057ccdd83df3708f3 diff --git a/qa/unit-test.txt b/qa/unit-test.txt deleted file mode 100644 index 0dfaa18..0000000 --- a/qa/unit-test.txt +++ /dev/null @@ -1,32 +0,0 @@ -Test git rev: 8ee192aea47c7ae4c930980057ccdd83df3708f3 -PASS test/first-past.test.js -PASS test/next-version.test.js -PASS test/x-sort.test.js -PASS test/version-compare.test.js -PASS test/upper-bound.test.js -PASS test/valid-version-or-range.test.js -PASS test/filter-valid-version-or-range.test.js -PASS test/min-version.test.js -PASS test/prerelease.test.js ------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ------------------------------------|---------|----------|---------|---------|------------------- -All files | 93.4 | 88 | 80.95 | 94.11 | - 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 | 92.68 | 100 | 100 | 24,63,68 - prerelease.mjs | 100 | 100 | 100 | 100 | - upper-bound.mjs | 88.88 | 66.66 | 100 | 88.88 | 13 - valid-version-or-range.mjs | 83.33 | 90.9 | 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: 9 passed, 9 total -Tests: 115 passed, 115 total -Snapshots: 0 total -Time: 0.331 s, estimated 1 s -Ran all test suites. From 4af64fb9813da8e48bbc076ce16395353eec3965 Mon Sep 17 00:00:00 2001 From: Zane Rockenbaugh Date: Sun, 12 Oct 2025 01:48:20 -0500 Subject: [PATCH 5/7] lint fix --- src/next-version.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/next-version.mjs b/src/next-version.mjs index 5e83223..f49319e 100644 --- a/src/next-version.mjs +++ b/src/next-version.mjs @@ -26,7 +26,7 @@ const nextVersion = ({ currVer, increment }) => { const msg = `Invalid version '${currVer}'` + (semver.validRange(currVer) ? '; range not allowed.' : '.') throw createError.BadRequest(msg) } - + if (increment !== undefined && !STANDARD_INCREMENTS.includes(increment)) { throw createError.BadRequest(`Invalid increment '${increment}' specified.`) } From 899868afe3eede99d9bf494848c124528be2a7cf Mon Sep 17 00:00:00 2001 From: Zane Rockenbaugh Date: Sun, 12 Oct 2025 01:49:36 -0500 Subject: [PATCH 6/7] Save QA files. --- qa/coverage/base.css | 224 ++++++++++ qa/coverage/block-navigation.js | 87 ++++ qa/coverage/clover.xml | 212 +++++++++ qa/coverage/constants.mjs.html | 100 +++++ qa/coverage/coverage-final.json | 11 + qa/coverage/ext-constants.mjs.html | 154 +++++++ qa/coverage/favicon.png | Bin 0 -> 445 bytes .../filter-valid-version-or-range.mjs.html | 109 +++++ qa/coverage/index.html | 251 +++++++++++ qa/coverage/min-version.mjs.html | 148 +++++++ qa/coverage/next-version.mjs.html | 406 +++++++++++++++++ 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/upper-bound.mjs.html | 151 +++++++ qa/coverage/valid-version-or-range.mjs.html | 130 ++++++ qa/coverage/version-compare.mjs.html | 256 +++++++++++ qa/coverage/x-sort.mjs.html | 409 ++++++++++++++++++ qa/lint.txt | 1 + qa/unit-test.txt | 30 ++ 22 files changed, 2984 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/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/upper-bound.mjs.html 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..25cefdf --- /dev/null +++ b/qa/coverage/clover.xml @@ -0,0 +1,212 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/qa/coverage/constants.mjs.html b/qa/coverage/constants.mjs.html new file mode 100644 index 0000000..b74c150 --- /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..8f59e71 --- /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":32},"end":{"line":13,"column":null}},"1":{"start":{"line":16,"column":43},"end":{"line":16,"column":102}},"2":{"start":{"line":17,"column":38},"end":{"line":17,"column":64}},"3":{"start":{"line":18,"column":35},"end":{"line":18,"column":76}},"4":{"start":{"line":20,"column":0},"end":{"line":20,"column":null}},"5":{"start":{"line":21,"column":0},"end":{"line":21,"column":null}},"6":{"start":{"line":22,"column":0},"end":{"line":22,"column":null}},"7":{"start":{"line":23,"column":0},"end":{"line":23,"column":null}}},"fnMap":{},"branchMap":{},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1},"f":{},"b":{}} +,"/Users/zane/playground/liquid-labs/semver-plus/src/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/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":1,"1":1,"2":1,"3":13,"4":6,"5":7,"6":7,"7":7,"8":0,"9":1},"f":{"0":13},"b":{"0":[6,7],"1":[7]}} +,"/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":24,"column":20},"end":{"line":105,"column":1}},"4":{"start":{"line":25,"column":2},"end":{"line":28,"column":null}},"5":{"start":{"line":26,"column":17},"end":{"line":26,"column":108}},"6":{"start":{"line":27,"column":4},"end":{"line":27,"column":null}},"7":{"start":{"line":30,"column":2},"end":{"line":32,"column":null}},"8":{"start":{"line":31,"column":4},"end":{"line":31,"column":null}},"9":{"start":{"line":33,"column":30},"end":{"line":33,"column":53}},"10":{"start":{"line":34,"column":30},"end":{"line":34,"column":117}},"11":{"start":{"line":36,"column":2},"end":{"line":36,"column":null}},"12":{"start":{"line":41,"column":35},"end":{"line":41,"column":61}},"13":{"start":{"line":42,"column":25},"end":{"line":42,"column":102}},"14":{"start":{"line":45,"column":29},"end":{"line":45,"column":126}},"15":{"start":{"line":46,"column":33},"end":{"line":48,"column":72}},"16":{"start":{"line":49,"column":35},"end":{"line":49,"column":93}},"17":{"start":{"line":52,"column":2},"end":{"line":54,"column":null}},"18":{"start":{"line":53,"column":4},"end":{"line":53,"column":null}},"19":{"start":{"line":55,"column":2},"end":{"line":70,"column":null}},"20":{"start":{"line":56,"column":4},"end":{"line":56,"column":null}},"21":{"start":{"line":58,"column":7},"end":{"line":70,"column":null}},"22":{"start":{"line":59,"column":22},"end":{"line":59,"column":79}},"23":{"start":{"line":60,"column":27},"end":{"line":60,"column":71}},"24":{"start":{"line":61,"column":4},"end":{"line":63,"column":null}},"25":{"start":{"line":62,"column":6},"end":{"line":62,"column":null}},"26":{"start":{"line":65,"column":7},"end":{"line":70,"column":null}},"27":{"start":{"line":66,"column":4},"end":{"line":66,"column":null}},"28":{"start":{"line":68,"column":7},"end":{"line":70,"column":null}},"29":{"start":{"line":69,"column":4},"end":{"line":69,"column":null}},"30":{"start":{"line":73,"column":2},"end":{"line":95,"column":null}},"31":{"start":{"line":74,"column":4},"end":{"line":78,"column":null}},"32":{"start":{"line":74,"column":44},"end":{"line":74,"column":null}},"33":{"start":{"line":75,"column":9},"end":{"line":78,"column":null}},"34":{"start":{"line":75,"column":48},"end":{"line":75,"column":null}},"35":{"start":{"line":76,"column":9},"end":{"line":78,"column":null}},"36":{"start":{"line":77,"column":6},"end":{"line":77,"column":null}},"37":{"start":{"line":80,"column":4},"end":{"line":80,"column":19}},"38":{"start":{"line":82,"column":7},"end":{"line":95,"column":null}},"39":{"start":{"line":83,"column":4},"end":{"line":88,"column":null}},"40":{"start":{"line":84,"column":6},"end":{"line":84,"column":null}},"41":{"start":{"line":87,"column":6},"end":{"line":87,"column":null}},"42":{"start":{"line":90,"column":4},"end":{"line":90,"column":null}},"43":{"start":{"line":92,"column":7},"end":{"line":95,"column":null}},"44":{"start":{"line":94,"column":4},"end":{"line":94,"column":null}},"45":{"start":{"line":97,"column":2},"end":{"line":97,"column":null}},"46":{"start":{"line":105,"column":1},"end":{"line":105,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":24,"column":20},"end":{"line":24,"column":21}},"loc":{"start":{"line":24,"column":48},"end":{"line":105,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":25,"column":2},"end":{"line":28,"column":null}},"type":"if","locations":[{"start":{"line":25,"column":2},"end":{"line":28,"column":null}}]},"1":{"loc":{"start":{"line":26,"column":50},"end":{"line":26,"column":107}},"type":"cond-expr","locations":[{"start":{"line":26,"column":79},"end":{"line":26,"column":101}},{"start":{"line":26,"column":104},"end":{"line":26,"column":107}}]},"2":{"loc":{"start":{"line":30,"column":2},"end":{"line":32,"column":null}},"type":"if","locations":[{"start":{"line":30,"column":2},"end":{"line":32,"column":null}}]},"3":{"loc":{"start":{"line":30,"column":6},"end":{"line":30,"column":73}},"type":"binary-expr","locations":[{"start":{"line":30,"column":6},"end":{"line":30,"column":29}},{"start":{"line":30,"column":33},"end":{"line":30,"column":73}}]},"4":{"loc":{"start":{"line":36,"column":14},"end":{"line":36,"column":73}},"type":"binary-expr","locations":[{"start":{"line":36,"column":14},"end":{"line":36,"column":23}},{"start":{"line":36,"column":28},"end":{"line":36,"column":72}}]},"5":{"loc":{"start":{"line":36,"column":28},"end":{"line":36,"column":72}},"type":"cond-expr","locations":[{"start":{"line":36,"column":50},"end":{"line":36,"column":57}},{"start":{"line":36,"column":60},"end":{"line":36,"column":72}}]},"6":{"loc":{"start":{"line":42,"column":25},"end":{"line":42,"column":102}},"type":"cond-expr","locations":[{"start":{"line":42,"column":61},"end":{"line":42,"column":65}},{"start":{"line":42,"column":68},"end":{"line":42,"column":102}}]},"7":{"loc":{"start":{"line":45,"column":29},"end":{"line":45,"column":126}},"type":"cond-expr","locations":[{"start":{"line":45,"column":55},"end":{"line":45,"column":59}},{"start":{"line":45,"column":62},"end":{"line":45,"column":126}}]},"8":{"loc":{"start":{"line":46,"column":33},"end":{"line":48,"column":72}},"type":"cond-expr","locations":[{"start":{"line":47,"column":6},"end":{"line":47,"column":10}},{"start":{"line":48,"column":7},"end":{"line":48,"column":72}}]},"9":{"loc":{"start":{"line":48,"column":7},"end":{"line":48,"column":72}},"type":"cond-expr","locations":[{"start":{"line":48,"column":45},"end":{"line":48,"column":47}},{"start":{"line":48,"column":50},"end":{"line":48,"column":72}}]},"10":{"loc":{"start":{"line":52,"column":2},"end":{"line":54,"column":null}},"type":"if","locations":[{"start":{"line":52,"column":2},"end":{"line":54,"column":null}}]},"11":{"loc":{"start":{"line":52,"column":6},"end":{"line":52,"column":92}},"type":"binary-expr","locations":[{"start":{"line":52,"column":6},"end":{"line":52,"column":29}},{"start":{"line":52,"column":33},"end":{"line":52,"column":92}}]},"12":{"loc":{"start":{"line":55,"column":2},"end":{"line":70,"column":null}},"type":"if","locations":[{"start":{"line":55,"column":2},"end":{"line":70,"column":null}},{"start":{"line":58,"column":7},"end":{"line":70,"column":null}}]},"13":{"loc":{"start":{"line":55,"column":6},"end":{"line":55,"column":67}},"type":"binary-expr","locations":[{"start":{"line":55,"column":6},"end":{"line":55,"column":32}},{"start":{"line":55,"column":36},"end":{"line":55,"column":67}}]},"14":{"loc":{"start":{"line":58,"column":7},"end":{"line":70,"column":null}},"type":"if","locations":[{"start":{"line":58,"column":7},"end":{"line":70,"column":null}},{"start":{"line":65,"column":7},"end":{"line":70,"column":null}}]},"15":{"loc":{"start":{"line":58,"column":11},"end":{"line":58,"column":93}},"type":"binary-expr","locations":[{"start":{"line":58,"column":11},"end":{"line":58,"column":44}},{"start":{"line":58,"column":48},"end":{"line":58,"column":93}}]},"16":{"loc":{"start":{"line":61,"column":4},"end":{"line":63,"column":null}},"type":"if","locations":[{"start":{"line":61,"column":4},"end":{"line":63,"column":null}}]},"17":{"loc":{"start":{"line":65,"column":7},"end":{"line":70,"column":null}},"type":"if","locations":[{"start":{"line":65,"column":7},"end":{"line":70,"column":null}},{"start":{"line":68,"column":7},"end":{"line":70,"column":null}}]},"18":{"loc":{"start":{"line":65,"column":11},"end":{"line":65,"column":84}},"type":"binary-expr","locations":[{"start":{"line":65,"column":11},"end":{"line":65,"column":30}},{"start":{"line":65,"column":34},"end":{"line":65,"column":84}}]},"19":{"loc":{"start":{"line":68,"column":7},"end":{"line":70,"column":null}},"type":"if","locations":[{"start":{"line":68,"column":7},"end":{"line":70,"column":null}}]},"20":{"loc":{"start":{"line":68,"column":11},"end":{"line":68,"column":86}},"type":"binary-expr","locations":[{"start":{"line":68,"column":11},"end":{"line":68,"column":31}},{"start":{"line":68,"column":35},"end":{"line":68,"column":86}}]},"21":{"loc":{"start":{"line":73,"column":2},"end":{"line":95,"column":null}},"type":"if","locations":[{"start":{"line":73,"column":2},"end":{"line":95,"column":null}},{"start":{"line":82,"column":7},"end":{"line":95,"column":null}}]},"22":{"loc":{"start":{"line":74,"column":4},"end":{"line":78,"column":null}},"type":"if","locations":[{"start":{"line":74,"column":4},"end":{"line":78,"column":null}},{"start":{"line":75,"column":9},"end":{"line":78,"column":null}}]},"23":{"loc":{"start":{"line":75,"column":9},"end":{"line":78,"column":null}},"type":"if","locations":[{"start":{"line":75,"column":9},"end":{"line":78,"column":null}},{"start":{"line":76,"column":9},"end":{"line":78,"column":null}}]},"24":{"loc":{"start":{"line":76,"column":9},"end":{"line":78,"column":null}},"type":"if","locations":[{"start":{"line":76,"column":9},"end":{"line":78,"column":null}}]},"25":{"loc":{"start":{"line":82,"column":7},"end":{"line":95,"column":null}},"type":"if","locations":[{"start":{"line":82,"column":7},"end":{"line":95,"column":null}},{"start":{"line":92,"column":7},"end":{"line":95,"column":null}}]},"26":{"loc":{"start":{"line":83,"column":4},"end":{"line":88,"column":null}},"type":"if","locations":[{"start":{"line":83,"column":4},"end":{"line":88,"column":null}},{"start":{"line":86,"column":9},"end":{"line":88,"column":null}}]},"27":{"loc":{"start":{"line":92,"column":7},"end":{"line":95,"column":null}},"type":"if","locations":[{"start":{"line":92,"column":7},"end":{"line":95,"column":null}}]},"28":{"loc":{"start":{"line":92,"column":11},"end":{"line":92,"column":68}},"type":"binary-expr","locations":[{"start":{"line":92,"column":11},"end":{"line":92,"column":37}},{"start":{"line":92,"column":41},"end":{"line":92,"column":68}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":47,"5":4,"6":4,"7":43,"8":1,"9":42,"10":42,"11":42,"12":42,"13":42,"14":42,"15":42,"16":42,"17":42,"18":1,"19":41,"20":2,"21":39,"22":8,"23":8,"24":8,"25":5,"26":31,"27":3,"28":28,"29":6,"30":25,"31":4,"32":1,"33":3,"34":1,"35":2,"36":2,"37":4,"38":21,"39":6,"40":3,"41":3,"42":6,"43":15,"44":3,"45":12,"46":1},"f":{"0":47},"b":{"0":[4],"1":[4,0],"2":[1],"3":[43,37],"4":[42,6],"5":[1,5],"6":[11,31],"7":[11,31],"8":[12,30],"9":[1,29],"10":[1],"11":[42,5],"12":[2,39],"13":[41,10],"14":[8,31],"15":[39,27],"16":[5],"17":[3,28],"18":[31,10],"19":[6],"20":[28,21],"21":[4,21],"22":[1,3],"23":[1,2],"24":[2],"25":[6,15],"26":[3,3],"27":[3],"28":[15,7]}} +,"/Users/zane/playground/liquid-labs/semver-plus/src/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/upper-bound.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/upper-bound.mjs","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":10,"column":19},"end":{"line":20,"column":1}},"2":{"start":{"line":11,"column":26},"end":{"line":11,"column":50}},"3":{"start":{"line":12,"column":2},"end":{"line":14,"column":null}},"4":{"start":{"line":13,"column":4},"end":{"line":13,"column":null}},"5":{"start":{"line":16,"column":17},"end":{"line":16,"column":43}},"6":{"start":{"line":17,"column":21},"end":{"line":17,"column":46}},"7":{"start":{"line":19,"column":2},"end":{"line":19,"column":null}},"8":{"start":{"line":20,"column":1},"end":{"line":20,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":10,"column":19},"end":{"line":10,"column":20}},"loc":{"start":{"line":10,"column":63},"end":{"line":20,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":10,"column":27},"end":{"line":10,"column":58}},"type":"default-arg","locations":[{"start":{"line":10,"column":56},"end":{"line":10,"column":58}}]},"1":{"loc":{"start":{"line":10,"column":29},"end":{"line":10,"column":52}},"type":"default-arg","locations":[{"start":{"line":10,"column":46},"end":{"line":10,"column":52}}]},"2":{"loc":{"start":{"line":12,"column":2},"end":{"line":14,"column":null}},"type":"if","locations":[{"start":{"line":12,"column":2},"end":{"line":14,"column":null}}]},"3":{"loc":{"start":{"line":19,"column":9},"end":{"line":19,"column":100}},"type":"cond-expr","locations":[{"start":{"line":19,"column":35},"end":{"line":19,"column":68}},{"start":{"line":19,"column":71},"end":{"line":19,"column":100}}]}},"s":{"0":2,"1":2,"2":47,"3":47,"4":0,"5":47,"6":47,"7":47,"8":2},"f":{"0":47},"b":{"0":[7],"1":[7],"2":[0],"3":[40,7]}} +,"/Users/zane/playground/liquid-labs/semver-plus/src/valid-version-or-range.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/valid-version-or-range.mjs","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":null}},"2":{"start":{"line":5,"column":28},"end":{"line":13,"column":54}},"3":{"start":{"line":8,"column":7},"end":{"line":8,"column":16}},"4":{"start":{"line":11,"column":2},"end":{"line":13,"column":54}},"5":{"start":{"line":13,"column":54},"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":2},"end":{"line":13,"column":54}}},"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":6},"end":{"line":13,"column":53}},"type":"binary-expr","locations":[{"start":{"line":11,"column":6},"end":{"line":11,"column":32}},{"start":{"line":11,"column":36},"end":{"line":11,"column":55}},{"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":2,"1":2,"2":2,"3":0,"4":16,"5":2},"f":{"0":16,"1":0},"b":{"0":[16],"1":[16],"2":[0],"3":[5],"4":[16,16,9,1,1,8,8]}} +,"/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":106,"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":62,"column":4}},"20":{"start":{"line":41,"column":23},"end":{"line":41,"column":63}},"21":{"start":{"line":42,"column":23},"end":{"line":42,"column":63}},"22":{"start":{"line":44,"column":4},"end":{"line":61,"column":null}},"23":{"start":{"line":45,"column":6},"end":{"line":45,"column":null}},"24":{"start":{"line":47,"column":9},"end":{"line":61,"column":null}},"25":{"start":{"line":48,"column":6},"end":{"line":48,"column":null}},"26":{"start":{"line":50,"column":9},"end":{"line":61,"column":null}},"27":{"start":{"line":51,"column":6},"end":{"line":51,"column":null}},"28":{"start":{"line":53,"column":9},"end":{"line":61,"column":null}},"29":{"start":{"line":54,"column":6},"end":{"line":54,"column":null}},"30":{"start":{"line":56,"column":9},"end":{"line":61,"column":null}},"31":{"start":{"line":57,"column":6},"end":{"line":57,"column":null}},"32":{"start":{"line":60,"column":6},"end":{"line":60,"column":null}},"33":{"start":{"line":64,"column":2},"end":{"line":69,"column":null}},"34":{"start":{"line":65,"column":4},"end":{"line":65,"column":null}},"35":{"start":{"line":67,"column":7},"end":{"line":69,"column":null}},"36":{"start":{"line":68,"column":4},"end":{"line":68,"column":null}},"37":{"start":{"line":71,"column":20},"end":{"line":71,"column":33}},"38":{"start":{"line":73,"column":25},"end":{"line":73,"column":30}},"39":{"start":{"line":74,"column":2},"end":{"line":103,"column":null}},"40":{"start":{"line":75,"column":4},"end":{"line":78,"column":null}},"41":{"start":{"line":76,"column":6},"end":{"line":76,"column":null}},"42":{"start":{"line":77,"column":6},"end":{"line":77,"column":null}},"43":{"start":{"line":80,"column":24},"end":{"line":80,"column":67}},"44":{"start":{"line":81,"column":4},"end":{"line":102,"column":null}},"45":{"start":{"line":82,"column":33},"end":{"line":82,"column":63}},"46":{"start":{"line":86,"column":32},"end":{"line":86,"column":111}},"47":{"start":{"line":86,"column":92},"end":{"line":86,"column":110}},"48":{"start":{"line":87,"column":6},"end":{"line":93,"column":null}},"49":{"start":{"line":88,"column":8},"end":{"line":88,"column":null}},"50":{"start":{"line":89,"column":8},"end":{"line":89,"column":null}},"51":{"start":{"line":92,"column":8},"end":{"line":92,"column":null}},"52":{"start":{"line":95,"column":9},"end":{"line":102,"column":null}},"53":{"start":{"line":96,"column":33},"end":{"line":96,"column":69}},"54":{"start":{"line":97,"column":6},"end":{"line":97,"column":null}},"55":{"start":{"line":99,"column":9},"end":{"line":102,"column":null}},"56":{"start":{"line":100,"column":6},"end":{"line":100,"column":null}},"57":{"start":{"line":101,"column":6},"end":{"line":101,"column":null}},"58":{"start":{"line":105,"column":2},"end":{"line":105,"column":null}},"59":{"start":{"line":106,"column":1},"end":{"line":106,"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":106,"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":62,"column":3}}},"3":{"name":"(anonymous_3)","decl":{"start":{"line":86,"column":83},"end":{"line":86,"column":87}},"loc":{"start":{"line":86,"column":92},"end":{"line":86,"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":61,"column":null}},"type":"if","locations":[{"start":{"line":44,"column":4},"end":{"line":61,"column":null}},{"start":{"line":47,"column":9},"end":{"line":61,"column":null}}]},"4":{"loc":{"start":{"line":47,"column":9},"end":{"line":61,"column":null}},"type":"if","locations":[{"start":{"line":47,"column":9},"end":{"line":61,"column":null}},{"start":{"line":50,"column":9},"end":{"line":61,"column":null}}]},"5":{"loc":{"start":{"line":50,"column":9},"end":{"line":61,"column":null}},"type":"if","locations":[{"start":{"line":50,"column":9},"end":{"line":61,"column":null}},{"start":{"line":53,"column":9},"end":{"line":61,"column":null}}]},"6":{"loc":{"start":{"line":50,"column":13},"end":{"line":50,"column":55}},"type":"binary-expr","locations":[{"start":{"line":50,"column":13},"end":{"line":50,"column":32}},{"start":{"line":50,"column":36},"end":{"line":50,"column":55}}]},"7":{"loc":{"start":{"line":53,"column":9},"end":{"line":61,"column":null}},"type":"if","locations":[{"start":{"line":53,"column":9},"end":{"line":61,"column":null}},{"start":{"line":56,"column":9},"end":{"line":61,"column":null}}]},"8":{"loc":{"start":{"line":56,"column":9},"end":{"line":61,"column":null}},"type":"if","locations":[{"start":{"line":56,"column":9},"end":{"line":61,"column":null}},{"start":{"line":59,"column":9},"end":{"line":61,"column":null}}]},"9":{"loc":{"start":{"line":64,"column":2},"end":{"line":69,"column":null}},"type":"if","locations":[{"start":{"line":64,"column":2},"end":{"line":69,"column":null}},{"start":{"line":67,"column":7},"end":{"line":69,"column":null}}]},"10":{"loc":{"start":{"line":67,"column":7},"end":{"line":69,"column":null}},"type":"if","locations":[{"start":{"line":67,"column":7},"end":{"line":69,"column":null}}]},"11":{"loc":{"start":{"line":75,"column":4},"end":{"line":78,"column":null}},"type":"if","locations":[{"start":{"line":75,"column":4},"end":{"line":78,"column":null}}]},"12":{"loc":{"start":{"line":81,"column":4},"end":{"line":102,"column":null}},"type":"if","locations":[{"start":{"line":81,"column":4},"end":{"line":102,"column":null}},{"start":{"line":95,"column":9},"end":{"line":102,"column":null}}]},"13":{"loc":{"start":{"line":87,"column":6},"end":{"line":93,"column":null}},"type":"if","locations":[{"start":{"line":87,"column":6},"end":{"line":93,"column":null}},{"start":{"line":91,"column":11},"end":{"line":93,"column":null}}]},"14":{"loc":{"start":{"line":95,"column":9},"end":{"line":102,"column":null}},"type":"if","locations":[{"start":{"line":95,"column":9},"end":{"line":102,"column":null}},{"start":{"line":99,"column":9},"end":{"line":102,"column":null}}]},"15":{"loc":{"start":{"line":99,"column":9},"end":{"line":102,"column":null}},"type":"if","locations":[{"start":{"line":99,"column":9},"end":{"line":102,"column":null}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":16,"5":16,"6":16,"7":47,"8":16,"9":47,"10":26,"11":21,"12":21,"13":21,"14":0,"15":0,"16":0,"17":0,"18":16,"19":16,"20":20,"21":20,"22":20,"23":0,"24":20,"25":7,"26":13,"27":0,"28":13,"29":0,"30":13,"31":0,"32":13,"33":16,"34":3,"35":13,"36":4,"37":9,"38":9,"39":9,"40":19,"41":9,"42":9,"43":10,"44":10,"45":8,"46":8,"47":1,"48":8,"49":7,"50":7,"51":1,"52":2,"53":1,"54":1,"55":1,"56":1,"57":1,"58":9,"59":1},"f":{"0":16,"1":47,"2":20,"3":1},"b":{"0":[26,21],"1":[21,0],"2":[0,0],"3":[0,20],"4":[7,13],"5":[0,13],"6":[13,0],"7":[0,13],"8":[0,13],"9":[3,13],"10":[4],"11":[9],"12":[8,2],"13":[7,1],"14":[1,1],"15":[1]}} +} diff --git a/qa/coverage/ext-constants.mjs.html b/qa/coverage/ext-constants.mjs.html new file mode 100644 index 0000000..b87c04a --- /dev/null +++ b/qa/coverage/ext-constants.mjs.html @@ -0,0 +1,154 @@ + + + + + + Code coverage report for ext-constants.mjs + + + + + + + + + +
+
+

All files ext-constants.mjs

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

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

+ +
+
+

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

All files

+
+ +
+ 92.43% + Statements + 171/185 +
+ + +
+ 89.28% + Branches + 100/112 +
+ + +
+ 80% + Functions + 16/20 +
+ + +
+ 93.18% + Lines + 164/176 +
+ + +
+

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

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
constants.mjs +
+
100%2/2100%0/0100%0/0100%2/2
ext-constants.mjs +
+
100%8/8100%0/0100%0/0100%8/8
filter-valid-version-or-range.mjs +
+
83.33%5/60%0/166.66%2/375%3/4
min-version.mjs +
+
90%9/10100%3/3100%1/190%9/10
next-version.mjs +
+
100%47/4798.03%50/51100%1/1100%45/45
prerelease.mjs +
+
100%4/4100%0/0100%1/1100%4/4
upper-bound.mjs +
+
88.88%8/980%4/5100%1/188.88%8/9
valid-version-or-range.mjs +
+
83.33%5/690.9%10/1150%1/283.33%5/6
version-compare.mjs +
+
93.93%31/33100%12/1271.42%5/7100%30/30
x-sort.mjs +
+
86.66%52/6072.41%21/29100%4/486.2%50/58
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/qa/coverage/min-version.mjs.html b/qa/coverage/min-version.mjs.html new file mode 100644 index 0000000..4229d4a --- /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 +221x +  +1x +  +1x +  +  +13x +6x +  +  +7x +7x +7x +  +  +  +  +1x +  +  + 
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..4a9bfe4 --- /dev/null +++ b/qa/coverage/next-version.mjs.html @@ -0,0 +1,406 @@ + + + + + + Code coverage report for next-version.mjs + + + + + + + + + +
+
+

All files next-version.mjs

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

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

+ +
+
+

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

All files upper-bound.mjs

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

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

+ +
+
+

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

All files x-sort.mjs

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

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

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +1091x +  +1x +1x +  +  +  +  +1x +  +16x +16x +  +  +47x +  +16x +47x +26x +  +  +21x +21x +21x +  +  +  +  +  +  +  +  +  +  +  +  +  +16x +  +16x +20x +20x +  +20x +  +  +20x +7x +  +13x +  +  +13x +  +  +13x +  +  +  +13x +  +  +  +16x +3x +  +13x +4x +  +  +9x +  +9x +9x +19x +9x +9x +  +  +10x +10x +8x +  +  +  +8x +8x +7x +7x +  +  +1x +  +  +2x +1x +1x +  +1x +1x +1x +  +  +  +9x +1x +  +  + 
import semver from 'semver'
+ 
+import { xRangeRE } from './constants'
+import { upperBound } from './upper-bound'
+ 
+/**
+ * Ascend sorts a mix of semver versions and x-range specified ranges (e.g., 1.2.* or 1.2.x). The ranges are sorted according to their highest version; e.g., 1.3.34 < 1.3.*. (I believe it can accept caret ranges too, but I would need to review the spec.)
+ */
+const xSort = (versionsAndRanges) => {
+  // TODO: to sort any range type, develop 'minOutOfRange' and use those to sort ranges
+  const versions = []
+  const ranges = []
+ 
+  // filter out duplicates
+  versionsAndRanges = versionsAndRanges.filter((v, i, a) => i === a.indexOf(v))
+ 
+  for (const versionOrRange of versionsAndRanges) {
+    if (versionOrRange.match(xRangeRE)) {
+      ranges.push(versionOrRange)
+    }
+    else {
+      const version = semver.valid(versionOrRange)
+      if (version !== null) {
+        versions.push(versionOrRange)
+      }
+      else E{
+        const range = semver.validRange(versionOrRange)
+        if (range !== null) {
+          ranges.push(versionOrRange)
+        }
+        else {
+          throw new Error(`Input '${versionOrRange}' is neither a version nor version range.`)
+        }
+      }
+    }
+  }
+ 
+  const sortedVersions = versions.sort(semver.compare)
+ 
+  const sortedRanges = ranges.sort((a, b) => {
+    const firstPastA = upperBound(a, { stripOperators : true })
+    const firstPastB = upperBound(b, { stripOperators : true })
+ 
+    Iif (firstPastA === '*') {
+      return 1
+    }
+    else if (firstPastB === '*') {
+      return -1
+    }
+    else Iif (firstPastA === null && firstPastB === null) {
+      return 0
+    }
+    else Iif (firstPastA === null) {
+      return 1
+    }
+    else Iif (firstPastB === null) {
+      return -1
+    }
+    else {
+      return semver.compare(firstPastA, firstPastB)
+    }
+  })
+ 
+  if (sortedVersions.length === 0) {
+    return sortedRanges
+  }
+  else if (sortedRanges.length === 0) {
+    return sortedVersions
+  }
+ 
+  const allSorted = [...versions]
+ 
+  let allRangesGreater = false
+  for (const range of sortedRanges) {
+    if (allRangesGreater === true) {
+      allSorted.push(range)
+      continue
+    }
+ 
+    const lastVersion = semver.maxSatisfying(sortedVersions, range)
+    if (lastVersion !== null) {
+      const indexOfLastVersion = allSorted.indexOf(lastVersion)
+      // we may have already inserted a range, so we need to find where the possible sequence of ranges ends and the
+      // next version begins (because ranges are sorted, we want to insert our range at the end of the sequence of
+      // ranges, if any).
+      const nextVersionOffset = allSorted.slice(indexOfLastVersion + 1).findIndex((vOrR) => semver.valid(vOrR))
+      if (nextVersionOffset === -1) {
+        allSorted.push(range)
+        allRangesGreater = true
+      }
+      else {
+        allSorted.splice(indexOfLastVersion + 1 + nextVersionOffset, 0, range)
+      }
+    }
+    else if (semver.gtr(sortedVersions[0], range)) {
+      const indexOfLowestRange = allSorted.indexOf(sortedVersions[0])
+      allSorted.splice(indexOfLowestRange, 0, range)
+    }
+    else if (semver.ltr(sortedVersions[sortedVersions.length - 1], range)) {
+      allSorted.push(range)
+      allRangesGreater = true
+    }
+  }
+ 
+  return allSorted
+}
+ 
+export { xSort }
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/qa/lint.txt b/qa/lint.txt new file mode 100644 index 0000000..a68a9f0 --- /dev/null +++ b/qa/lint.txt @@ -0,0 +1 @@ +Test git rev: 4af64fb9813da8e48bbc076ce16395353eec3965 diff --git a/qa/unit-test.txt b/qa/unit-test.txt new file mode 100644 index 0000000..4723274 --- /dev/null +++ b/qa/unit-test.txt @@ -0,0 +1,30 @@ +Test git rev: 4af64fb9813da8e48bbc076ce16395353eec3965 +PASS test/next-version.test.js +PASS test/x-sort.test.js +PASS test/version-compare.test.js +PASS test/valid-version-or-range.test.js +PASS test/upper-bound.test.js +PASS test/min-version.test.js +PASS test/filter-valid-version-or-range.test.js +PASS test/prerelease.test.js +-----------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +-----------------------------------|---------|----------|---------|---------|------------------- +All files | 92.43 | 89.28 | 80 | 93.18 | + 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 + min-version.mjs | 90 | 100 | 100 | 90 | 18 + next-version.mjs | 100 | 98.03 | 100 | 100 | 26 + prerelease.mjs | 100 | 100 | 100 | 100 | + upper-bound.mjs | 88.88 | 80 | 100 | 88.88 | 13 + valid-version-or-range.mjs | 83.33 | 90.9 | 50 | 83.33 | 8 + version-compare.mjs | 93.93 | 100 | 71.42 | 100 | + x-sort.mjs | 86.66 | 72.41 | 100 | 86.2 | 27-32,45,51,54,57 +-----------------------------------|---------|----------|---------|---------|------------------- + +Test Suites: 8 passed, 8 total +Tests: 114 passed, 114 total +Snapshots: 0 total +Time: 0.345 s, estimated 1 s +Ran all test suites. From 86ffda66bacc4d0b302e82f70084f4e2de722797 Mon Sep 17 00:00:00 2001 From: Zane Rockenbaugh Date: Sun, 12 Oct 2025 01:49:36 -0500 Subject: [PATCH 7/7] removed QA files --- qa/coverage/base.css | 224 ---------- qa/coverage/block-navigation.js | 87 ---- qa/coverage/clover.xml | 212 --------- qa/coverage/constants.mjs.html | 100 ----- qa/coverage/coverage-final.json | 11 - qa/coverage/ext-constants.mjs.html | 154 ------- qa/coverage/favicon.png | Bin 445 -> 0 bytes .../filter-valid-version-or-range.mjs.html | 109 ----- qa/coverage/index.html | 251 ----------- qa/coverage/min-version.mjs.html | 148 ------- qa/coverage/next-version.mjs.html | 406 ----------------- 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/upper-bound.mjs.html | 151 ------- qa/coverage/valid-version-or-range.mjs.html | 130 ------ qa/coverage/version-compare.mjs.html | 256 ----------- qa/coverage/x-sort.mjs.html | 409 ------------------ qa/lint.txt | 1 - qa/unit-test.txt | 30 -- 22 files changed, 2984 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/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/upper-bound.mjs.html 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 25cefdf..0000000 --- a/qa/coverage/clover.xml +++ /dev/null @@ -1,212 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/qa/coverage/constants.mjs.html b/qa/coverage/constants.mjs.html deleted file mode 100644 index b74c150..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 8f59e71..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":32},"end":{"line":13,"column":null}},"1":{"start":{"line":16,"column":43},"end":{"line":16,"column":102}},"2":{"start":{"line":17,"column":38},"end":{"line":17,"column":64}},"3":{"start":{"line":18,"column":35},"end":{"line":18,"column":76}},"4":{"start":{"line":20,"column":0},"end":{"line":20,"column":null}},"5":{"start":{"line":21,"column":0},"end":{"line":21,"column":null}},"6":{"start":{"line":22,"column":0},"end":{"line":22,"column":null}},"7":{"start":{"line":23,"column":0},"end":{"line":23,"column":null}}},"fnMap":{},"branchMap":{},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1},"f":{},"b":{}} -,"/Users/zane/playground/liquid-labs/semver-plus/src/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/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":1,"1":1,"2":1,"3":13,"4":6,"5":7,"6":7,"7":7,"8":0,"9":1},"f":{"0":13},"b":{"0":[6,7],"1":[7]}} -,"/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":24,"column":20},"end":{"line":105,"column":1}},"4":{"start":{"line":25,"column":2},"end":{"line":28,"column":null}},"5":{"start":{"line":26,"column":17},"end":{"line":26,"column":108}},"6":{"start":{"line":27,"column":4},"end":{"line":27,"column":null}},"7":{"start":{"line":30,"column":2},"end":{"line":32,"column":null}},"8":{"start":{"line":31,"column":4},"end":{"line":31,"column":null}},"9":{"start":{"line":33,"column":30},"end":{"line":33,"column":53}},"10":{"start":{"line":34,"column":30},"end":{"line":34,"column":117}},"11":{"start":{"line":36,"column":2},"end":{"line":36,"column":null}},"12":{"start":{"line":41,"column":35},"end":{"line":41,"column":61}},"13":{"start":{"line":42,"column":25},"end":{"line":42,"column":102}},"14":{"start":{"line":45,"column":29},"end":{"line":45,"column":126}},"15":{"start":{"line":46,"column":33},"end":{"line":48,"column":72}},"16":{"start":{"line":49,"column":35},"end":{"line":49,"column":93}},"17":{"start":{"line":52,"column":2},"end":{"line":54,"column":null}},"18":{"start":{"line":53,"column":4},"end":{"line":53,"column":null}},"19":{"start":{"line":55,"column":2},"end":{"line":70,"column":null}},"20":{"start":{"line":56,"column":4},"end":{"line":56,"column":null}},"21":{"start":{"line":58,"column":7},"end":{"line":70,"column":null}},"22":{"start":{"line":59,"column":22},"end":{"line":59,"column":79}},"23":{"start":{"line":60,"column":27},"end":{"line":60,"column":71}},"24":{"start":{"line":61,"column":4},"end":{"line":63,"column":null}},"25":{"start":{"line":62,"column":6},"end":{"line":62,"column":null}},"26":{"start":{"line":65,"column":7},"end":{"line":70,"column":null}},"27":{"start":{"line":66,"column":4},"end":{"line":66,"column":null}},"28":{"start":{"line":68,"column":7},"end":{"line":70,"column":null}},"29":{"start":{"line":69,"column":4},"end":{"line":69,"column":null}},"30":{"start":{"line":73,"column":2},"end":{"line":95,"column":null}},"31":{"start":{"line":74,"column":4},"end":{"line":78,"column":null}},"32":{"start":{"line":74,"column":44},"end":{"line":74,"column":null}},"33":{"start":{"line":75,"column":9},"end":{"line":78,"column":null}},"34":{"start":{"line":75,"column":48},"end":{"line":75,"column":null}},"35":{"start":{"line":76,"column":9},"end":{"line":78,"column":null}},"36":{"start":{"line":77,"column":6},"end":{"line":77,"column":null}},"37":{"start":{"line":80,"column":4},"end":{"line":80,"column":19}},"38":{"start":{"line":82,"column":7},"end":{"line":95,"column":null}},"39":{"start":{"line":83,"column":4},"end":{"line":88,"column":null}},"40":{"start":{"line":84,"column":6},"end":{"line":84,"column":null}},"41":{"start":{"line":87,"column":6},"end":{"line":87,"column":null}},"42":{"start":{"line":90,"column":4},"end":{"line":90,"column":null}},"43":{"start":{"line":92,"column":7},"end":{"line":95,"column":null}},"44":{"start":{"line":94,"column":4},"end":{"line":94,"column":null}},"45":{"start":{"line":97,"column":2},"end":{"line":97,"column":null}},"46":{"start":{"line":105,"column":1},"end":{"line":105,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":24,"column":20},"end":{"line":24,"column":21}},"loc":{"start":{"line":24,"column":48},"end":{"line":105,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":25,"column":2},"end":{"line":28,"column":null}},"type":"if","locations":[{"start":{"line":25,"column":2},"end":{"line":28,"column":null}}]},"1":{"loc":{"start":{"line":26,"column":50},"end":{"line":26,"column":107}},"type":"cond-expr","locations":[{"start":{"line":26,"column":79},"end":{"line":26,"column":101}},{"start":{"line":26,"column":104},"end":{"line":26,"column":107}}]},"2":{"loc":{"start":{"line":30,"column":2},"end":{"line":32,"column":null}},"type":"if","locations":[{"start":{"line":30,"column":2},"end":{"line":32,"column":null}}]},"3":{"loc":{"start":{"line":30,"column":6},"end":{"line":30,"column":73}},"type":"binary-expr","locations":[{"start":{"line":30,"column":6},"end":{"line":30,"column":29}},{"start":{"line":30,"column":33},"end":{"line":30,"column":73}}]},"4":{"loc":{"start":{"line":36,"column":14},"end":{"line":36,"column":73}},"type":"binary-expr","locations":[{"start":{"line":36,"column":14},"end":{"line":36,"column":23}},{"start":{"line":36,"column":28},"end":{"line":36,"column":72}}]},"5":{"loc":{"start":{"line":36,"column":28},"end":{"line":36,"column":72}},"type":"cond-expr","locations":[{"start":{"line":36,"column":50},"end":{"line":36,"column":57}},{"start":{"line":36,"column":60},"end":{"line":36,"column":72}}]},"6":{"loc":{"start":{"line":42,"column":25},"end":{"line":42,"column":102}},"type":"cond-expr","locations":[{"start":{"line":42,"column":61},"end":{"line":42,"column":65}},{"start":{"line":42,"column":68},"end":{"line":42,"column":102}}]},"7":{"loc":{"start":{"line":45,"column":29},"end":{"line":45,"column":126}},"type":"cond-expr","locations":[{"start":{"line":45,"column":55},"end":{"line":45,"column":59}},{"start":{"line":45,"column":62},"end":{"line":45,"column":126}}]},"8":{"loc":{"start":{"line":46,"column":33},"end":{"line":48,"column":72}},"type":"cond-expr","locations":[{"start":{"line":47,"column":6},"end":{"line":47,"column":10}},{"start":{"line":48,"column":7},"end":{"line":48,"column":72}}]},"9":{"loc":{"start":{"line":48,"column":7},"end":{"line":48,"column":72}},"type":"cond-expr","locations":[{"start":{"line":48,"column":45},"end":{"line":48,"column":47}},{"start":{"line":48,"column":50},"end":{"line":48,"column":72}}]},"10":{"loc":{"start":{"line":52,"column":2},"end":{"line":54,"column":null}},"type":"if","locations":[{"start":{"line":52,"column":2},"end":{"line":54,"column":null}}]},"11":{"loc":{"start":{"line":52,"column":6},"end":{"line":52,"column":92}},"type":"binary-expr","locations":[{"start":{"line":52,"column":6},"end":{"line":52,"column":29}},{"start":{"line":52,"column":33},"end":{"line":52,"column":92}}]},"12":{"loc":{"start":{"line":55,"column":2},"end":{"line":70,"column":null}},"type":"if","locations":[{"start":{"line":55,"column":2},"end":{"line":70,"column":null}},{"start":{"line":58,"column":7},"end":{"line":70,"column":null}}]},"13":{"loc":{"start":{"line":55,"column":6},"end":{"line":55,"column":67}},"type":"binary-expr","locations":[{"start":{"line":55,"column":6},"end":{"line":55,"column":32}},{"start":{"line":55,"column":36},"end":{"line":55,"column":67}}]},"14":{"loc":{"start":{"line":58,"column":7},"end":{"line":70,"column":null}},"type":"if","locations":[{"start":{"line":58,"column":7},"end":{"line":70,"column":null}},{"start":{"line":65,"column":7},"end":{"line":70,"column":null}}]},"15":{"loc":{"start":{"line":58,"column":11},"end":{"line":58,"column":93}},"type":"binary-expr","locations":[{"start":{"line":58,"column":11},"end":{"line":58,"column":44}},{"start":{"line":58,"column":48},"end":{"line":58,"column":93}}]},"16":{"loc":{"start":{"line":61,"column":4},"end":{"line":63,"column":null}},"type":"if","locations":[{"start":{"line":61,"column":4},"end":{"line":63,"column":null}}]},"17":{"loc":{"start":{"line":65,"column":7},"end":{"line":70,"column":null}},"type":"if","locations":[{"start":{"line":65,"column":7},"end":{"line":70,"column":null}},{"start":{"line":68,"column":7},"end":{"line":70,"column":null}}]},"18":{"loc":{"start":{"line":65,"column":11},"end":{"line":65,"column":84}},"type":"binary-expr","locations":[{"start":{"line":65,"column":11},"end":{"line":65,"column":30}},{"start":{"line":65,"column":34},"end":{"line":65,"column":84}}]},"19":{"loc":{"start":{"line":68,"column":7},"end":{"line":70,"column":null}},"type":"if","locations":[{"start":{"line":68,"column":7},"end":{"line":70,"column":null}}]},"20":{"loc":{"start":{"line":68,"column":11},"end":{"line":68,"column":86}},"type":"binary-expr","locations":[{"start":{"line":68,"column":11},"end":{"line":68,"column":31}},{"start":{"line":68,"column":35},"end":{"line":68,"column":86}}]},"21":{"loc":{"start":{"line":73,"column":2},"end":{"line":95,"column":null}},"type":"if","locations":[{"start":{"line":73,"column":2},"end":{"line":95,"column":null}},{"start":{"line":82,"column":7},"end":{"line":95,"column":null}}]},"22":{"loc":{"start":{"line":74,"column":4},"end":{"line":78,"column":null}},"type":"if","locations":[{"start":{"line":74,"column":4},"end":{"line":78,"column":null}},{"start":{"line":75,"column":9},"end":{"line":78,"column":null}}]},"23":{"loc":{"start":{"line":75,"column":9},"end":{"line":78,"column":null}},"type":"if","locations":[{"start":{"line":75,"column":9},"end":{"line":78,"column":null}},{"start":{"line":76,"column":9},"end":{"line":78,"column":null}}]},"24":{"loc":{"start":{"line":76,"column":9},"end":{"line":78,"column":null}},"type":"if","locations":[{"start":{"line":76,"column":9},"end":{"line":78,"column":null}}]},"25":{"loc":{"start":{"line":82,"column":7},"end":{"line":95,"column":null}},"type":"if","locations":[{"start":{"line":82,"column":7},"end":{"line":95,"column":null}},{"start":{"line":92,"column":7},"end":{"line":95,"column":null}}]},"26":{"loc":{"start":{"line":83,"column":4},"end":{"line":88,"column":null}},"type":"if","locations":[{"start":{"line":83,"column":4},"end":{"line":88,"column":null}},{"start":{"line":86,"column":9},"end":{"line":88,"column":null}}]},"27":{"loc":{"start":{"line":92,"column":7},"end":{"line":95,"column":null}},"type":"if","locations":[{"start":{"line":92,"column":7},"end":{"line":95,"column":null}}]},"28":{"loc":{"start":{"line":92,"column":11},"end":{"line":92,"column":68}},"type":"binary-expr","locations":[{"start":{"line":92,"column":11},"end":{"line":92,"column":37}},{"start":{"line":92,"column":41},"end":{"line":92,"column":68}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":47,"5":4,"6":4,"7":43,"8":1,"9":42,"10":42,"11":42,"12":42,"13":42,"14":42,"15":42,"16":42,"17":42,"18":1,"19":41,"20":2,"21":39,"22":8,"23":8,"24":8,"25":5,"26":31,"27":3,"28":28,"29":6,"30":25,"31":4,"32":1,"33":3,"34":1,"35":2,"36":2,"37":4,"38":21,"39":6,"40":3,"41":3,"42":6,"43":15,"44":3,"45":12,"46":1},"f":{"0":47},"b":{"0":[4],"1":[4,0],"2":[1],"3":[43,37],"4":[42,6],"5":[1,5],"6":[11,31],"7":[11,31],"8":[12,30],"9":[1,29],"10":[1],"11":[42,5],"12":[2,39],"13":[41,10],"14":[8,31],"15":[39,27],"16":[5],"17":[3,28],"18":[31,10],"19":[6],"20":[28,21],"21":[4,21],"22":[1,3],"23":[1,2],"24":[2],"25":[6,15],"26":[3,3],"27":[3],"28":[15,7]}} -,"/Users/zane/playground/liquid-labs/semver-plus/src/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/upper-bound.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/upper-bound.mjs","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":10,"column":19},"end":{"line":20,"column":1}},"2":{"start":{"line":11,"column":26},"end":{"line":11,"column":50}},"3":{"start":{"line":12,"column":2},"end":{"line":14,"column":null}},"4":{"start":{"line":13,"column":4},"end":{"line":13,"column":null}},"5":{"start":{"line":16,"column":17},"end":{"line":16,"column":43}},"6":{"start":{"line":17,"column":21},"end":{"line":17,"column":46}},"7":{"start":{"line":19,"column":2},"end":{"line":19,"column":null}},"8":{"start":{"line":20,"column":1},"end":{"line":20,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":10,"column":19},"end":{"line":10,"column":20}},"loc":{"start":{"line":10,"column":63},"end":{"line":20,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":10,"column":27},"end":{"line":10,"column":58}},"type":"default-arg","locations":[{"start":{"line":10,"column":56},"end":{"line":10,"column":58}}]},"1":{"loc":{"start":{"line":10,"column":29},"end":{"line":10,"column":52}},"type":"default-arg","locations":[{"start":{"line":10,"column":46},"end":{"line":10,"column":52}}]},"2":{"loc":{"start":{"line":12,"column":2},"end":{"line":14,"column":null}},"type":"if","locations":[{"start":{"line":12,"column":2},"end":{"line":14,"column":null}}]},"3":{"loc":{"start":{"line":19,"column":9},"end":{"line":19,"column":100}},"type":"cond-expr","locations":[{"start":{"line":19,"column":35},"end":{"line":19,"column":68}},{"start":{"line":19,"column":71},"end":{"line":19,"column":100}}]}},"s":{"0":2,"1":2,"2":47,"3":47,"4":0,"5":47,"6":47,"7":47,"8":2},"f":{"0":47},"b":{"0":[7],"1":[7],"2":[0],"3":[40,7]}} -,"/Users/zane/playground/liquid-labs/semver-plus/src/valid-version-or-range.mjs": {"path":"/Users/zane/playground/liquid-labs/semver-plus/src/valid-version-or-range.mjs","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":null}},"2":{"start":{"line":5,"column":28},"end":{"line":13,"column":54}},"3":{"start":{"line":8,"column":7},"end":{"line":8,"column":16}},"4":{"start":{"line":11,"column":2},"end":{"line":13,"column":54}},"5":{"start":{"line":13,"column":54},"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":2},"end":{"line":13,"column":54}}},"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":6},"end":{"line":13,"column":53}},"type":"binary-expr","locations":[{"start":{"line":11,"column":6},"end":{"line":11,"column":32}},{"start":{"line":11,"column":36},"end":{"line":11,"column":55}},{"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":2,"1":2,"2":2,"3":0,"4":16,"5":2},"f":{"0":16,"1":0},"b":{"0":[16],"1":[16],"2":[0],"3":[5],"4":[16,16,9,1,1,8,8]}} -,"/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":106,"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":62,"column":4}},"20":{"start":{"line":41,"column":23},"end":{"line":41,"column":63}},"21":{"start":{"line":42,"column":23},"end":{"line":42,"column":63}},"22":{"start":{"line":44,"column":4},"end":{"line":61,"column":null}},"23":{"start":{"line":45,"column":6},"end":{"line":45,"column":null}},"24":{"start":{"line":47,"column":9},"end":{"line":61,"column":null}},"25":{"start":{"line":48,"column":6},"end":{"line":48,"column":null}},"26":{"start":{"line":50,"column":9},"end":{"line":61,"column":null}},"27":{"start":{"line":51,"column":6},"end":{"line":51,"column":null}},"28":{"start":{"line":53,"column":9},"end":{"line":61,"column":null}},"29":{"start":{"line":54,"column":6},"end":{"line":54,"column":null}},"30":{"start":{"line":56,"column":9},"end":{"line":61,"column":null}},"31":{"start":{"line":57,"column":6},"end":{"line":57,"column":null}},"32":{"start":{"line":60,"column":6},"end":{"line":60,"column":null}},"33":{"start":{"line":64,"column":2},"end":{"line":69,"column":null}},"34":{"start":{"line":65,"column":4},"end":{"line":65,"column":null}},"35":{"start":{"line":67,"column":7},"end":{"line":69,"column":null}},"36":{"start":{"line":68,"column":4},"end":{"line":68,"column":null}},"37":{"start":{"line":71,"column":20},"end":{"line":71,"column":33}},"38":{"start":{"line":73,"column":25},"end":{"line":73,"column":30}},"39":{"start":{"line":74,"column":2},"end":{"line":103,"column":null}},"40":{"start":{"line":75,"column":4},"end":{"line":78,"column":null}},"41":{"start":{"line":76,"column":6},"end":{"line":76,"column":null}},"42":{"start":{"line":77,"column":6},"end":{"line":77,"column":null}},"43":{"start":{"line":80,"column":24},"end":{"line":80,"column":67}},"44":{"start":{"line":81,"column":4},"end":{"line":102,"column":null}},"45":{"start":{"line":82,"column":33},"end":{"line":82,"column":63}},"46":{"start":{"line":86,"column":32},"end":{"line":86,"column":111}},"47":{"start":{"line":86,"column":92},"end":{"line":86,"column":110}},"48":{"start":{"line":87,"column":6},"end":{"line":93,"column":null}},"49":{"start":{"line":88,"column":8},"end":{"line":88,"column":null}},"50":{"start":{"line":89,"column":8},"end":{"line":89,"column":null}},"51":{"start":{"line":92,"column":8},"end":{"line":92,"column":null}},"52":{"start":{"line":95,"column":9},"end":{"line":102,"column":null}},"53":{"start":{"line":96,"column":33},"end":{"line":96,"column":69}},"54":{"start":{"line":97,"column":6},"end":{"line":97,"column":null}},"55":{"start":{"line":99,"column":9},"end":{"line":102,"column":null}},"56":{"start":{"line":100,"column":6},"end":{"line":100,"column":null}},"57":{"start":{"line":101,"column":6},"end":{"line":101,"column":null}},"58":{"start":{"line":105,"column":2},"end":{"line":105,"column":null}},"59":{"start":{"line":106,"column":1},"end":{"line":106,"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":106,"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":62,"column":3}}},"3":{"name":"(anonymous_3)","decl":{"start":{"line":86,"column":83},"end":{"line":86,"column":87}},"loc":{"start":{"line":86,"column":92},"end":{"line":86,"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":61,"column":null}},"type":"if","locations":[{"start":{"line":44,"column":4},"end":{"line":61,"column":null}},{"start":{"line":47,"column":9},"end":{"line":61,"column":null}}]},"4":{"loc":{"start":{"line":47,"column":9},"end":{"line":61,"column":null}},"type":"if","locations":[{"start":{"line":47,"column":9},"end":{"line":61,"column":null}},{"start":{"line":50,"column":9},"end":{"line":61,"column":null}}]},"5":{"loc":{"start":{"line":50,"column":9},"end":{"line":61,"column":null}},"type":"if","locations":[{"start":{"line":50,"column":9},"end":{"line":61,"column":null}},{"start":{"line":53,"column":9},"end":{"line":61,"column":null}}]},"6":{"loc":{"start":{"line":50,"column":13},"end":{"line":50,"column":55}},"type":"binary-expr","locations":[{"start":{"line":50,"column":13},"end":{"line":50,"column":32}},{"start":{"line":50,"column":36},"end":{"line":50,"column":55}}]},"7":{"loc":{"start":{"line":53,"column":9},"end":{"line":61,"column":null}},"type":"if","locations":[{"start":{"line":53,"column":9},"end":{"line":61,"column":null}},{"start":{"line":56,"column":9},"end":{"line":61,"column":null}}]},"8":{"loc":{"start":{"line":56,"column":9},"end":{"line":61,"column":null}},"type":"if","locations":[{"start":{"line":56,"column":9},"end":{"line":61,"column":null}},{"start":{"line":59,"column":9},"end":{"line":61,"column":null}}]},"9":{"loc":{"start":{"line":64,"column":2},"end":{"line":69,"column":null}},"type":"if","locations":[{"start":{"line":64,"column":2},"end":{"line":69,"column":null}},{"start":{"line":67,"column":7},"end":{"line":69,"column":null}}]},"10":{"loc":{"start":{"line":67,"column":7},"end":{"line":69,"column":null}},"type":"if","locations":[{"start":{"line":67,"column":7},"end":{"line":69,"column":null}}]},"11":{"loc":{"start":{"line":75,"column":4},"end":{"line":78,"column":null}},"type":"if","locations":[{"start":{"line":75,"column":4},"end":{"line":78,"column":null}}]},"12":{"loc":{"start":{"line":81,"column":4},"end":{"line":102,"column":null}},"type":"if","locations":[{"start":{"line":81,"column":4},"end":{"line":102,"column":null}},{"start":{"line":95,"column":9},"end":{"line":102,"column":null}}]},"13":{"loc":{"start":{"line":87,"column":6},"end":{"line":93,"column":null}},"type":"if","locations":[{"start":{"line":87,"column":6},"end":{"line":93,"column":null}},{"start":{"line":91,"column":11},"end":{"line":93,"column":null}}]},"14":{"loc":{"start":{"line":95,"column":9},"end":{"line":102,"column":null}},"type":"if","locations":[{"start":{"line":95,"column":9},"end":{"line":102,"column":null}},{"start":{"line":99,"column":9},"end":{"line":102,"column":null}}]},"15":{"loc":{"start":{"line":99,"column":9},"end":{"line":102,"column":null}},"type":"if","locations":[{"start":{"line":99,"column":9},"end":{"line":102,"column":null}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":16,"5":16,"6":16,"7":47,"8":16,"9":47,"10":26,"11":21,"12":21,"13":21,"14":0,"15":0,"16":0,"17":0,"18":16,"19":16,"20":20,"21":20,"22":20,"23":0,"24":20,"25":7,"26":13,"27":0,"28":13,"29":0,"30":13,"31":0,"32":13,"33":16,"34":3,"35":13,"36":4,"37":9,"38":9,"39":9,"40":19,"41":9,"42":9,"43":10,"44":10,"45":8,"46":8,"47":1,"48":8,"49":7,"50":7,"51":1,"52":2,"53":1,"54":1,"55":1,"56":1,"57":1,"58":9,"59":1},"f":{"0":16,"1":47,"2":20,"3":1},"b":{"0":[26,21],"1":[21,0],"2":[0,0],"3":[0,20],"4":[7,13],"5":[0,13],"6":[13,0],"7":[0,13],"8":[0,13],"9":[3,13],"10":[4],"11":[9],"12":[8,2],"13":[7,1],"14":[1,1],"15":[1]}} -} diff --git a/qa/coverage/ext-constants.mjs.html b/qa/coverage/ext-constants.mjs.html deleted file mode 100644 index b87c04a..0000000 --- a/qa/coverage/ext-constants.mjs.html +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - Code coverage report for ext-constants.mjs - - - - - - - - - -
-
-

All files ext-constants.mjs

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

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

- -
-
-

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

All files

-
- -
- 92.43% - Statements - 171/185 -
- - -
- 89.28% - Branches - 100/112 -
- - -
- 80% - Functions - 16/20 -
- - -
- 93.18% - Lines - 164/176 -
- - -
-

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

- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
constants.mjs -
-
100%2/2100%0/0100%0/0100%2/2
ext-constants.mjs -
-
100%8/8100%0/0100%0/0100%8/8
filter-valid-version-or-range.mjs -
-
83.33%5/60%0/166.66%2/375%3/4
min-version.mjs -
-
90%9/10100%3/3100%1/190%9/10
next-version.mjs -
-
100%47/4798.03%50/51100%1/1100%45/45
prerelease.mjs -
-
100%4/4100%0/0100%1/1100%4/4
upper-bound.mjs -
-
88.88%8/980%4/5100%1/188.88%8/9
valid-version-or-range.mjs -
-
83.33%5/690.9%10/1150%1/283.33%5/6
version-compare.mjs -
-
93.93%31/33100%12/1271.42%5/7100%30/30
x-sort.mjs -
-
86.66%52/6072.41%21/29100%4/486.2%50/58
-
-
-
- - - - - - - - \ No newline at end of file diff --git a/qa/coverage/min-version.mjs.html b/qa/coverage/min-version.mjs.html deleted file mode 100644 index 4229d4a..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 -221x -  -1x -  -1x -  -  -13x -6x -  -  -7x -7x -7x -  -  -  -  -1x -  -  - 
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 4a9bfe4..0000000 --- a/qa/coverage/next-version.mjs.html +++ /dev/null @@ -1,406 +0,0 @@ - - - - - - Code coverage report for next-version.mjs - - - - - - - - - -
-
-

All files next-version.mjs

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

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

- -
-
-

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

All files upper-bound.mjs

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

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

- -
-
-

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

All files x-sort.mjs

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

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

- -
-
-

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