headlamp 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{cli.js → cli.cjs} +128 -127
- package/dist/cli.cjs.map +7 -0
- package/dist/index.js +172 -2421
- package/dist/index.js.map +4 -4
- package/package.json +2 -2
- package/dist/cli.js.map +0 -7
package/dist/index.js
CHANGED
|
@@ -4,16 +4,10 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
8
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
9
|
-
}) : x)(function(x) {
|
|
10
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
11
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
12
|
-
});
|
|
13
7
|
var __esm = (fn, res) => function __init() {
|
|
14
8
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
15
9
|
};
|
|
16
|
-
var __commonJS = (cb, mod) => function
|
|
10
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
17
11
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
18
12
|
};
|
|
19
13
|
var __export = (target, all) => {
|
|
@@ -1760,2453 +1754,206 @@ var require_stringify = __commonJS({
|
|
|
1760
1754
|
}
|
|
1761
1755
|
if (item !== void 0 && propertyList.indexOf(item) < 0) {
|
|
1762
1756
|
propertyList.push(item);
|
|
1763
|
-
}
|
|
1764
|
-
}
|
|
1765
|
-
}
|
|
1766
|
-
if (space instanceof Number) {
|
|
1767
|
-
space = Number(space);
|
|
1768
|
-
} else if (space instanceof String) {
|
|
1769
|
-
space = String(space);
|
|
1770
|
-
}
|
|
1771
|
-
if (typeof space === "number") {
|
|
1772
|
-
if (space > 0) {
|
|
1773
|
-
space = Math.min(10, Math.floor(space));
|
|
1774
|
-
gap = " ".substr(0, space);
|
|
1775
|
-
}
|
|
1776
|
-
} else if (typeof space === "string") {
|
|
1777
|
-
gap = space.substr(0, 10);
|
|
1778
|
-
}
|
|
1779
|
-
return serializeProperty("", { "": value });
|
|
1780
|
-
function serializeProperty(key, holder) {
|
|
1781
|
-
let value2 = holder[key];
|
|
1782
|
-
if (value2 != null) {
|
|
1783
|
-
if (typeof value2.toJSON5 === "function") {
|
|
1784
|
-
value2 = value2.toJSON5(key);
|
|
1785
|
-
} else if (typeof value2.toJSON === "function") {
|
|
1786
|
-
value2 = value2.toJSON(key);
|
|
1787
|
-
}
|
|
1788
|
-
}
|
|
1789
|
-
if (replacerFunc) {
|
|
1790
|
-
value2 = replacerFunc.call(holder, key, value2);
|
|
1791
|
-
}
|
|
1792
|
-
if (value2 instanceof Number) {
|
|
1793
|
-
value2 = Number(value2);
|
|
1794
|
-
} else if (value2 instanceof String) {
|
|
1795
|
-
value2 = String(value2);
|
|
1796
|
-
} else if (value2 instanceof Boolean) {
|
|
1797
|
-
value2 = value2.valueOf();
|
|
1798
|
-
}
|
|
1799
|
-
switch (value2) {
|
|
1800
|
-
case null:
|
|
1801
|
-
return "null";
|
|
1802
|
-
case true:
|
|
1803
|
-
return "true";
|
|
1804
|
-
case false:
|
|
1805
|
-
return "false";
|
|
1806
|
-
}
|
|
1807
|
-
if (typeof value2 === "string") {
|
|
1808
|
-
return quoteString(value2, false);
|
|
1809
|
-
}
|
|
1810
|
-
if (typeof value2 === "number") {
|
|
1811
|
-
return String(value2);
|
|
1812
|
-
}
|
|
1813
|
-
if (typeof value2 === "object") {
|
|
1814
|
-
return Array.isArray(value2) ? serializeArray(value2) : serializeObject(value2);
|
|
1815
|
-
}
|
|
1816
|
-
return void 0;
|
|
1817
|
-
}
|
|
1818
|
-
function quoteString(value2) {
|
|
1819
|
-
const quotes = {
|
|
1820
|
-
"'": 0.1,
|
|
1821
|
-
'"': 0.2
|
|
1822
|
-
};
|
|
1823
|
-
const replacements = {
|
|
1824
|
-
"'": "\\'",
|
|
1825
|
-
'"': '\\"',
|
|
1826
|
-
"\\": "\\\\",
|
|
1827
|
-
"\b": "\\b",
|
|
1828
|
-
"\f": "\\f",
|
|
1829
|
-
"\n": "\\n",
|
|
1830
|
-
"\r": "\\r",
|
|
1831
|
-
" ": "\\t",
|
|
1832
|
-
"\v": "\\v",
|
|
1833
|
-
"\0": "\\0",
|
|
1834
|
-
"\u2028": "\\u2028",
|
|
1835
|
-
"\u2029": "\\u2029"
|
|
1836
|
-
};
|
|
1837
|
-
let product = "";
|
|
1838
|
-
for (let i = 0; i < value2.length; i++) {
|
|
1839
|
-
const c = value2[i];
|
|
1840
|
-
switch (c) {
|
|
1841
|
-
case "'":
|
|
1842
|
-
case '"':
|
|
1843
|
-
quotes[c]++;
|
|
1844
|
-
product += c;
|
|
1845
|
-
continue;
|
|
1846
|
-
case "\0":
|
|
1847
|
-
if (util2.isDigit(value2[i + 1])) {
|
|
1848
|
-
product += "\\x00";
|
|
1849
|
-
continue;
|
|
1850
|
-
}
|
|
1851
|
-
}
|
|
1852
|
-
if (replacements[c]) {
|
|
1853
|
-
product += replacements[c];
|
|
1854
|
-
continue;
|
|
1855
|
-
}
|
|
1856
|
-
if (c < " ") {
|
|
1857
|
-
let hexString = c.charCodeAt(0).toString(16);
|
|
1858
|
-
product += "\\x" + ("00" + hexString).substring(hexString.length);
|
|
1859
|
-
continue;
|
|
1860
|
-
}
|
|
1861
|
-
product += c;
|
|
1862
|
-
}
|
|
1863
|
-
const quoteChar = quote || Object.keys(quotes).reduce((a, b) => quotes[a] < quotes[b] ? a : b);
|
|
1864
|
-
product = product.replace(new RegExp(quoteChar, "g"), replacements[quoteChar]);
|
|
1865
|
-
return quoteChar + product + quoteChar;
|
|
1866
|
-
}
|
|
1867
|
-
function serializeObject(value2) {
|
|
1868
|
-
if (stack.indexOf(value2) >= 0) {
|
|
1869
|
-
throw TypeError("Converting circular structure to JSON5");
|
|
1870
|
-
}
|
|
1871
|
-
stack.push(value2);
|
|
1872
|
-
let stepback = indent;
|
|
1873
|
-
indent = indent + gap;
|
|
1874
|
-
let keys = propertyList || Object.keys(value2);
|
|
1875
|
-
let partial = [];
|
|
1876
|
-
for (const key of keys) {
|
|
1877
|
-
const propertyString = serializeProperty(key, value2);
|
|
1878
|
-
if (propertyString !== void 0) {
|
|
1879
|
-
let member = serializeKey(key) + ":";
|
|
1880
|
-
if (gap !== "") {
|
|
1881
|
-
member += " ";
|
|
1882
|
-
}
|
|
1883
|
-
member += propertyString;
|
|
1884
|
-
partial.push(member);
|
|
1885
|
-
}
|
|
1886
|
-
}
|
|
1887
|
-
let final;
|
|
1888
|
-
if (partial.length === 0) {
|
|
1889
|
-
final = "{}";
|
|
1890
|
-
} else {
|
|
1891
|
-
let properties;
|
|
1892
|
-
if (gap === "") {
|
|
1893
|
-
properties = partial.join(",");
|
|
1894
|
-
final = "{" + properties + "}";
|
|
1895
|
-
} else {
|
|
1896
|
-
let separator = ",\n" + indent;
|
|
1897
|
-
properties = partial.join(separator);
|
|
1898
|
-
final = "{\n" + indent + properties + ",\n" + stepback + "}";
|
|
1899
|
-
}
|
|
1900
|
-
}
|
|
1901
|
-
stack.pop();
|
|
1902
|
-
indent = stepback;
|
|
1903
|
-
return final;
|
|
1904
|
-
}
|
|
1905
|
-
function serializeKey(key) {
|
|
1906
|
-
if (key.length === 0) {
|
|
1907
|
-
return quoteString(key, true);
|
|
1908
|
-
}
|
|
1909
|
-
const firstChar = String.fromCodePoint(key.codePointAt(0));
|
|
1910
|
-
if (!util2.isIdStartChar(firstChar)) {
|
|
1911
|
-
return quoteString(key, true);
|
|
1912
|
-
}
|
|
1913
|
-
for (let i = firstChar.length; i < key.length; i++) {
|
|
1914
|
-
if (!util2.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) {
|
|
1915
|
-
return quoteString(key, true);
|
|
1916
|
-
}
|
|
1917
|
-
}
|
|
1918
|
-
return key;
|
|
1919
|
-
}
|
|
1920
|
-
function serializeArray(value2) {
|
|
1921
|
-
if (stack.indexOf(value2) >= 0) {
|
|
1922
|
-
throw TypeError("Converting circular structure to JSON5");
|
|
1923
|
-
}
|
|
1924
|
-
stack.push(value2);
|
|
1925
|
-
let stepback = indent;
|
|
1926
|
-
indent = indent + gap;
|
|
1927
|
-
let partial = [];
|
|
1928
|
-
for (let i = 0; i < value2.length; i++) {
|
|
1929
|
-
const propertyString = serializeProperty(String(i), value2);
|
|
1930
|
-
partial.push(propertyString !== void 0 ? propertyString : "null");
|
|
1931
|
-
}
|
|
1932
|
-
let final;
|
|
1933
|
-
if (partial.length === 0) {
|
|
1934
|
-
final = "[]";
|
|
1935
|
-
} else {
|
|
1936
|
-
if (gap === "") {
|
|
1937
|
-
let properties = partial.join(",");
|
|
1938
|
-
final = "[" + properties + "]";
|
|
1939
|
-
} else {
|
|
1940
|
-
let separator = ",\n" + indent;
|
|
1941
|
-
let properties = partial.join(separator);
|
|
1942
|
-
final = "[\n" + indent + properties + ",\n" + stepback + "]";
|
|
1943
|
-
}
|
|
1944
|
-
}
|
|
1945
|
-
stack.pop();
|
|
1946
|
-
indent = stepback;
|
|
1947
|
-
return final;
|
|
1948
|
-
}
|
|
1949
|
-
};
|
|
1950
|
-
}
|
|
1951
|
-
});
|
|
1952
|
-
|
|
1953
|
-
// node_modules/json5/lib/index.js
|
|
1954
|
-
var require_lib = __commonJS({
|
|
1955
|
-
"node_modules/json5/lib/index.js"(exports, module) {
|
|
1956
|
-
var parse = require_parse();
|
|
1957
|
-
var stringify = require_stringify();
|
|
1958
|
-
var JSON52 = {
|
|
1959
|
-
parse,
|
|
1960
|
-
stringify
|
|
1961
|
-
};
|
|
1962
|
-
module.exports = JSON52;
|
|
1963
|
-
}
|
|
1964
|
-
});
|
|
1965
|
-
|
|
1966
|
-
// node_modules/make-dir/node_modules/semver/internal/debug.js
|
|
1967
|
-
var require_debug = __commonJS({
|
|
1968
|
-
"node_modules/make-dir/node_modules/semver/internal/debug.js"(exports, module) {
|
|
1969
|
-
"use strict";
|
|
1970
|
-
var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
|
|
1971
|
-
};
|
|
1972
|
-
module.exports = debug;
|
|
1973
|
-
}
|
|
1974
|
-
});
|
|
1975
|
-
|
|
1976
|
-
// node_modules/make-dir/node_modules/semver/internal/constants.js
|
|
1977
|
-
var require_constants = __commonJS({
|
|
1978
|
-
"node_modules/make-dir/node_modules/semver/internal/constants.js"(exports, module) {
|
|
1979
|
-
"use strict";
|
|
1980
|
-
var SEMVER_SPEC_VERSION = "2.0.0";
|
|
1981
|
-
var MAX_LENGTH = 256;
|
|
1982
|
-
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
1983
|
-
9007199254740991;
|
|
1984
|
-
var MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
1985
|
-
var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
|
|
1986
|
-
var RELEASE_TYPES = [
|
|
1987
|
-
"major",
|
|
1988
|
-
"premajor",
|
|
1989
|
-
"minor",
|
|
1990
|
-
"preminor",
|
|
1991
|
-
"patch",
|
|
1992
|
-
"prepatch",
|
|
1993
|
-
"prerelease"
|
|
1994
|
-
];
|
|
1995
|
-
module.exports = {
|
|
1996
|
-
MAX_LENGTH,
|
|
1997
|
-
MAX_SAFE_COMPONENT_LENGTH,
|
|
1998
|
-
MAX_SAFE_BUILD_LENGTH,
|
|
1999
|
-
MAX_SAFE_INTEGER,
|
|
2000
|
-
RELEASE_TYPES,
|
|
2001
|
-
SEMVER_SPEC_VERSION,
|
|
2002
|
-
FLAG_INCLUDE_PRERELEASE: 1,
|
|
2003
|
-
FLAG_LOOSE: 2
|
|
2004
|
-
};
|
|
2005
|
-
}
|
|
2006
|
-
});
|
|
2007
|
-
|
|
2008
|
-
// node_modules/make-dir/node_modules/semver/internal/re.js
|
|
2009
|
-
var require_re = __commonJS({
|
|
2010
|
-
"node_modules/make-dir/node_modules/semver/internal/re.js"(exports, module) {
|
|
2011
|
-
"use strict";
|
|
2012
|
-
var {
|
|
2013
|
-
MAX_SAFE_COMPONENT_LENGTH,
|
|
2014
|
-
MAX_SAFE_BUILD_LENGTH,
|
|
2015
|
-
MAX_LENGTH
|
|
2016
|
-
} = require_constants();
|
|
2017
|
-
var debug = require_debug();
|
|
2018
|
-
exports = module.exports = {};
|
|
2019
|
-
var re = exports.re = [];
|
|
2020
|
-
var safeRe = exports.safeRe = [];
|
|
2021
|
-
var src = exports.src = [];
|
|
2022
|
-
var safeSrc = exports.safeSrc = [];
|
|
2023
|
-
var t = exports.t = {};
|
|
2024
|
-
var R = 0;
|
|
2025
|
-
var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
2026
|
-
var safeRegexReplacements = [
|
|
2027
|
-
["\\s", 1],
|
|
2028
|
-
["\\d", MAX_LENGTH],
|
|
2029
|
-
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
|
|
2030
|
-
];
|
|
2031
|
-
var makeSafeRegex = (value) => {
|
|
2032
|
-
for (const [token, max] of safeRegexReplacements) {
|
|
2033
|
-
value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
|
|
2034
|
-
}
|
|
2035
|
-
return value;
|
|
2036
|
-
};
|
|
2037
|
-
var createToken = (name, value, isGlobal) => {
|
|
2038
|
-
const safe = makeSafeRegex(value);
|
|
2039
|
-
const index = R++;
|
|
2040
|
-
debug(name, index, value);
|
|
2041
|
-
t[name] = index;
|
|
2042
|
-
src[index] = value;
|
|
2043
|
-
safeSrc[index] = safe;
|
|
2044
|
-
re[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
2045
|
-
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
2046
|
-
};
|
|
2047
|
-
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
2048
|
-
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
2049
|
-
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
2050
|
-
createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
|
|
2051
|
-
createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
2052
|
-
createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
|
|
2053
|
-
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
2054
|
-
createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
|
|
2055
|
-
createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
2056
|
-
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
2057
|
-
createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
|
|
2058
|
-
createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
|
|
2059
|
-
createToken("FULL", `^${src[t.FULLPLAIN]}$`);
|
|
2060
|
-
createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
|
|
2061
|
-
createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
|
|
2062
|
-
createToken("GTLT", "((?:<|>)?=?)");
|
|
2063
|
-
createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
2064
|
-
createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
2065
|
-
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
|
|
2066
|
-
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
|
|
2067
|
-
createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
|
2068
|
-
createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
|
2069
|
-
createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
2070
|
-
createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
2071
|
-
createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
|
|
2072
|
-
createToken("COERCERTL", src[t.COERCE], true);
|
|
2073
|
-
createToken("COERCERTLFULL", src[t.COERCEFULL], true);
|
|
2074
|
-
createToken("LONETILDE", "(?:~>?)");
|
|
2075
|
-
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
|
2076
|
-
exports.tildeTrimReplace = "$1~";
|
|
2077
|
-
createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
|
2078
|
-
createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
2079
|
-
createToken("LONECARET", "(?:\\^)");
|
|
2080
|
-
createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
|
|
2081
|
-
exports.caretTrimReplace = "$1^";
|
|
2082
|
-
createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
|
2083
|
-
createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
2084
|
-
createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
|
|
2085
|
-
createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
|
2086
|
-
createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
|
|
2087
|
-
exports.comparatorTrimReplace = "$1$2$3";
|
|
2088
|
-
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
|
|
2089
|
-
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
|
|
2090
|
-
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
2091
|
-
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
2092
|
-
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
2093
|
-
}
|
|
2094
|
-
});
|
|
2095
|
-
|
|
2096
|
-
// node_modules/make-dir/node_modules/semver/internal/parse-options.js
|
|
2097
|
-
var require_parse_options = __commonJS({
|
|
2098
|
-
"node_modules/make-dir/node_modules/semver/internal/parse-options.js"(exports, module) {
|
|
2099
|
-
"use strict";
|
|
2100
|
-
var looseOption = Object.freeze({ loose: true });
|
|
2101
|
-
var emptyOpts = Object.freeze({});
|
|
2102
|
-
var parseOptions = (options) => {
|
|
2103
|
-
if (!options) {
|
|
2104
|
-
return emptyOpts;
|
|
2105
|
-
}
|
|
2106
|
-
if (typeof options !== "object") {
|
|
2107
|
-
return looseOption;
|
|
2108
|
-
}
|
|
2109
|
-
return options;
|
|
2110
|
-
};
|
|
2111
|
-
module.exports = parseOptions;
|
|
2112
|
-
}
|
|
2113
|
-
});
|
|
2114
|
-
|
|
2115
|
-
// node_modules/make-dir/node_modules/semver/internal/identifiers.js
|
|
2116
|
-
var require_identifiers = __commonJS({
|
|
2117
|
-
"node_modules/make-dir/node_modules/semver/internal/identifiers.js"(exports, module) {
|
|
2118
|
-
"use strict";
|
|
2119
|
-
var numeric = /^[0-9]+$/;
|
|
2120
|
-
var compareIdentifiers = (a, b) => {
|
|
2121
|
-
const anum = numeric.test(a);
|
|
2122
|
-
const bnum = numeric.test(b);
|
|
2123
|
-
if (anum && bnum) {
|
|
2124
|
-
a = +a;
|
|
2125
|
-
b = +b;
|
|
2126
|
-
}
|
|
2127
|
-
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
2128
|
-
};
|
|
2129
|
-
var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
|
|
2130
|
-
module.exports = {
|
|
2131
|
-
compareIdentifiers,
|
|
2132
|
-
rcompareIdentifiers
|
|
2133
|
-
};
|
|
2134
|
-
}
|
|
2135
|
-
});
|
|
2136
|
-
|
|
2137
|
-
// node_modules/make-dir/node_modules/semver/classes/semver.js
|
|
2138
|
-
var require_semver = __commonJS({
|
|
2139
|
-
"node_modules/make-dir/node_modules/semver/classes/semver.js"(exports, module) {
|
|
2140
|
-
"use strict";
|
|
2141
|
-
var debug = require_debug();
|
|
2142
|
-
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
2143
|
-
var { safeRe: re, t } = require_re();
|
|
2144
|
-
var parseOptions = require_parse_options();
|
|
2145
|
-
var { compareIdentifiers } = require_identifiers();
|
|
2146
|
-
var SemVer = class _SemVer {
|
|
2147
|
-
constructor(version, options) {
|
|
2148
|
-
options = parseOptions(options);
|
|
2149
|
-
if (version instanceof _SemVer) {
|
|
2150
|
-
if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {
|
|
2151
|
-
return version;
|
|
2152
|
-
} else {
|
|
2153
|
-
version = version.version;
|
|
2154
|
-
}
|
|
2155
|
-
} else if (typeof version !== "string") {
|
|
2156
|
-
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
|
2157
|
-
}
|
|
2158
|
-
if (version.length > MAX_LENGTH) {
|
|
2159
|
-
throw new TypeError(
|
|
2160
|
-
`version is longer than ${MAX_LENGTH} characters`
|
|
2161
|
-
);
|
|
2162
|
-
}
|
|
2163
|
-
debug("SemVer", version, options);
|
|
2164
|
-
this.options = options;
|
|
2165
|
-
this.loose = !!options.loose;
|
|
2166
|
-
this.includePrerelease = !!options.includePrerelease;
|
|
2167
|
-
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
2168
|
-
if (!m) {
|
|
2169
|
-
throw new TypeError(`Invalid Version: ${version}`);
|
|
2170
|
-
}
|
|
2171
|
-
this.raw = version;
|
|
2172
|
-
this.major = +m[1];
|
|
2173
|
-
this.minor = +m[2];
|
|
2174
|
-
this.patch = +m[3];
|
|
2175
|
-
if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
|
|
2176
|
-
throw new TypeError("Invalid major version");
|
|
2177
|
-
}
|
|
2178
|
-
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
|
|
2179
|
-
throw new TypeError("Invalid minor version");
|
|
2180
|
-
}
|
|
2181
|
-
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
|
|
2182
|
-
throw new TypeError("Invalid patch version");
|
|
2183
|
-
}
|
|
2184
|
-
if (!m[4]) {
|
|
2185
|
-
this.prerelease = [];
|
|
2186
|
-
} else {
|
|
2187
|
-
this.prerelease = m[4].split(".").map((id) => {
|
|
2188
|
-
if (/^[0-9]+$/.test(id)) {
|
|
2189
|
-
const num = +id;
|
|
2190
|
-
if (num >= 0 && num < MAX_SAFE_INTEGER) {
|
|
2191
|
-
return num;
|
|
2192
|
-
}
|
|
2193
|
-
}
|
|
2194
|
-
return id;
|
|
2195
|
-
});
|
|
2196
|
-
}
|
|
2197
|
-
this.build = m[5] ? m[5].split(".") : [];
|
|
2198
|
-
this.format();
|
|
2199
|
-
}
|
|
2200
|
-
format() {
|
|
2201
|
-
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
2202
|
-
if (this.prerelease.length) {
|
|
2203
|
-
this.version += `-${this.prerelease.join(".")}`;
|
|
2204
|
-
}
|
|
2205
|
-
return this.version;
|
|
2206
|
-
}
|
|
2207
|
-
toString() {
|
|
2208
|
-
return this.version;
|
|
2209
|
-
}
|
|
2210
|
-
compare(other) {
|
|
2211
|
-
debug("SemVer.compare", this.version, this.options, other);
|
|
2212
|
-
if (!(other instanceof _SemVer)) {
|
|
2213
|
-
if (typeof other === "string" && other === this.version) {
|
|
2214
|
-
return 0;
|
|
2215
|
-
}
|
|
2216
|
-
other = new _SemVer(other, this.options);
|
|
2217
|
-
}
|
|
2218
|
-
if (other.version === this.version) {
|
|
2219
|
-
return 0;
|
|
2220
|
-
}
|
|
2221
|
-
return this.compareMain(other) || this.comparePre(other);
|
|
2222
|
-
}
|
|
2223
|
-
compareMain(other) {
|
|
2224
|
-
if (!(other instanceof _SemVer)) {
|
|
2225
|
-
other = new _SemVer(other, this.options);
|
|
2226
|
-
}
|
|
2227
|
-
return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
|
|
2228
|
-
}
|
|
2229
|
-
comparePre(other) {
|
|
2230
|
-
if (!(other instanceof _SemVer)) {
|
|
2231
|
-
other = new _SemVer(other, this.options);
|
|
2232
|
-
}
|
|
2233
|
-
if (this.prerelease.length && !other.prerelease.length) {
|
|
2234
|
-
return -1;
|
|
2235
|
-
} else if (!this.prerelease.length && other.prerelease.length) {
|
|
2236
|
-
return 1;
|
|
2237
|
-
} else if (!this.prerelease.length && !other.prerelease.length) {
|
|
2238
|
-
return 0;
|
|
2239
|
-
}
|
|
2240
|
-
let i = 0;
|
|
2241
|
-
do {
|
|
2242
|
-
const a = this.prerelease[i];
|
|
2243
|
-
const b = other.prerelease[i];
|
|
2244
|
-
debug("prerelease compare", i, a, b);
|
|
2245
|
-
if (a === void 0 && b === void 0) {
|
|
2246
|
-
return 0;
|
|
2247
|
-
} else if (b === void 0) {
|
|
2248
|
-
return 1;
|
|
2249
|
-
} else if (a === void 0) {
|
|
2250
|
-
return -1;
|
|
2251
|
-
} else if (a === b) {
|
|
2252
|
-
continue;
|
|
2253
|
-
} else {
|
|
2254
|
-
return compareIdentifiers(a, b);
|
|
2255
|
-
}
|
|
2256
|
-
} while (++i);
|
|
2257
|
-
}
|
|
2258
|
-
compareBuild(other) {
|
|
2259
|
-
if (!(other instanceof _SemVer)) {
|
|
2260
|
-
other = new _SemVer(other, this.options);
|
|
2261
|
-
}
|
|
2262
|
-
let i = 0;
|
|
2263
|
-
do {
|
|
2264
|
-
const a = this.build[i];
|
|
2265
|
-
const b = other.build[i];
|
|
2266
|
-
debug("build compare", i, a, b);
|
|
2267
|
-
if (a === void 0 && b === void 0) {
|
|
2268
|
-
return 0;
|
|
2269
|
-
} else if (b === void 0) {
|
|
2270
|
-
return 1;
|
|
2271
|
-
} else if (a === void 0) {
|
|
2272
|
-
return -1;
|
|
2273
|
-
} else if (a === b) {
|
|
2274
|
-
continue;
|
|
2275
|
-
} else {
|
|
2276
|
-
return compareIdentifiers(a, b);
|
|
2277
|
-
}
|
|
2278
|
-
} while (++i);
|
|
2279
|
-
}
|
|
2280
|
-
// preminor will bump the version up to the next minor release, and immediately
|
|
2281
|
-
// down to pre-release. premajor and prepatch work the same way.
|
|
2282
|
-
inc(release, identifier, identifierBase) {
|
|
2283
|
-
if (release.startsWith("pre")) {
|
|
2284
|
-
if (!identifier && identifierBase === false) {
|
|
2285
|
-
throw new Error("invalid increment argument: identifier is empty");
|
|
2286
|
-
}
|
|
2287
|
-
if (identifier) {
|
|
2288
|
-
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
|
|
2289
|
-
if (!match || match[1] !== identifier) {
|
|
2290
|
-
throw new Error(`invalid identifier: ${identifier}`);
|
|
2291
|
-
}
|
|
2292
|
-
}
|
|
2293
|
-
}
|
|
2294
|
-
switch (release) {
|
|
2295
|
-
case "premajor":
|
|
2296
|
-
this.prerelease.length = 0;
|
|
2297
|
-
this.patch = 0;
|
|
2298
|
-
this.minor = 0;
|
|
2299
|
-
this.major++;
|
|
2300
|
-
this.inc("pre", identifier, identifierBase);
|
|
2301
|
-
break;
|
|
2302
|
-
case "preminor":
|
|
2303
|
-
this.prerelease.length = 0;
|
|
2304
|
-
this.patch = 0;
|
|
2305
|
-
this.minor++;
|
|
2306
|
-
this.inc("pre", identifier, identifierBase);
|
|
2307
|
-
break;
|
|
2308
|
-
case "prepatch":
|
|
2309
|
-
this.prerelease.length = 0;
|
|
2310
|
-
this.inc("patch", identifier, identifierBase);
|
|
2311
|
-
this.inc("pre", identifier, identifierBase);
|
|
2312
|
-
break;
|
|
2313
|
-
case "prerelease":
|
|
2314
|
-
if (this.prerelease.length === 0) {
|
|
2315
|
-
this.inc("patch", identifier, identifierBase);
|
|
2316
|
-
}
|
|
2317
|
-
this.inc("pre", identifier, identifierBase);
|
|
2318
|
-
break;
|
|
2319
|
-
case "release":
|
|
2320
|
-
if (this.prerelease.length === 0) {
|
|
2321
|
-
throw new Error(`version ${this.raw} is not a prerelease`);
|
|
2322
|
-
}
|
|
2323
|
-
this.prerelease.length = 0;
|
|
2324
|
-
break;
|
|
2325
|
-
case "major":
|
|
2326
|
-
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
|
|
2327
|
-
this.major++;
|
|
2328
|
-
}
|
|
2329
|
-
this.minor = 0;
|
|
2330
|
-
this.patch = 0;
|
|
2331
|
-
this.prerelease = [];
|
|
2332
|
-
break;
|
|
2333
|
-
case "minor":
|
|
2334
|
-
if (this.patch !== 0 || this.prerelease.length === 0) {
|
|
2335
|
-
this.minor++;
|
|
2336
|
-
}
|
|
2337
|
-
this.patch = 0;
|
|
2338
|
-
this.prerelease = [];
|
|
2339
|
-
break;
|
|
2340
|
-
case "patch":
|
|
2341
|
-
if (this.prerelease.length === 0) {
|
|
2342
|
-
this.patch++;
|
|
2343
|
-
}
|
|
2344
|
-
this.prerelease = [];
|
|
2345
|
-
break;
|
|
2346
|
-
case "pre": {
|
|
2347
|
-
const base = Number(identifierBase) ? 1 : 0;
|
|
2348
|
-
if (this.prerelease.length === 0) {
|
|
2349
|
-
this.prerelease = [base];
|
|
2350
|
-
} else {
|
|
2351
|
-
let i = this.prerelease.length;
|
|
2352
|
-
while (--i >= 0) {
|
|
2353
|
-
if (typeof this.prerelease[i] === "number") {
|
|
2354
|
-
this.prerelease[i]++;
|
|
2355
|
-
i = -2;
|
|
2356
|
-
}
|
|
2357
|
-
}
|
|
2358
|
-
if (i === -1) {
|
|
2359
|
-
if (identifier === this.prerelease.join(".") && identifierBase === false) {
|
|
2360
|
-
throw new Error("invalid increment argument: identifier already exists");
|
|
2361
|
-
}
|
|
2362
|
-
this.prerelease.push(base);
|
|
2363
|
-
}
|
|
2364
|
-
}
|
|
2365
|
-
if (identifier) {
|
|
2366
|
-
let prerelease = [identifier, base];
|
|
2367
|
-
if (identifierBase === false) {
|
|
2368
|
-
prerelease = [identifier];
|
|
2369
|
-
}
|
|
2370
|
-
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
|
|
2371
|
-
if (isNaN(this.prerelease[1])) {
|
|
2372
|
-
this.prerelease = prerelease;
|
|
2373
|
-
}
|
|
2374
|
-
} else {
|
|
2375
|
-
this.prerelease = prerelease;
|
|
2376
|
-
}
|
|
2377
|
-
}
|
|
2378
|
-
break;
|
|
2379
|
-
}
|
|
2380
|
-
default:
|
|
2381
|
-
throw new Error(`invalid increment argument: ${release}`);
|
|
2382
|
-
}
|
|
2383
|
-
this.raw = this.format();
|
|
2384
|
-
if (this.build.length) {
|
|
2385
|
-
this.raw += `+${this.build.join(".")}`;
|
|
2386
|
-
}
|
|
2387
|
-
return this;
|
|
2388
|
-
}
|
|
2389
|
-
};
|
|
2390
|
-
module.exports = SemVer;
|
|
2391
|
-
}
|
|
2392
|
-
});
|
|
2393
|
-
|
|
2394
|
-
// node_modules/make-dir/node_modules/semver/functions/compare.js
|
|
2395
|
-
var require_compare = __commonJS({
|
|
2396
|
-
"node_modules/make-dir/node_modules/semver/functions/compare.js"(exports, module) {
|
|
2397
|
-
"use strict";
|
|
2398
|
-
var SemVer = require_semver();
|
|
2399
|
-
var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
2400
|
-
module.exports = compare;
|
|
2401
|
-
}
|
|
2402
|
-
});
|
|
2403
|
-
|
|
2404
|
-
// node_modules/make-dir/node_modules/semver/functions/gte.js
|
|
2405
|
-
var require_gte = __commonJS({
|
|
2406
|
-
"node_modules/make-dir/node_modules/semver/functions/gte.js"(exports, module) {
|
|
2407
|
-
"use strict";
|
|
2408
|
-
var compare = require_compare();
|
|
2409
|
-
var gte = (a, b, loose) => compare(a, b, loose) >= 0;
|
|
2410
|
-
module.exports = gte;
|
|
2411
|
-
}
|
|
2412
|
-
});
|
|
2413
|
-
|
|
2414
|
-
// node_modules/make-dir/index.js
|
|
2415
|
-
var require_make_dir = __commonJS({
|
|
2416
|
-
"node_modules/make-dir/index.js"(exports, module) {
|
|
2417
|
-
"use strict";
|
|
2418
|
-
var fs6 = __require("fs");
|
|
2419
|
-
var path10 = __require("path");
|
|
2420
|
-
var { promisify } = __require("util");
|
|
2421
|
-
var semverGte = require_gte();
|
|
2422
|
-
var useNativeRecursiveOption = semverGte(process.version, "10.12.0");
|
|
2423
|
-
var checkPath = (pth) => {
|
|
2424
|
-
if (process.platform === "win32") {
|
|
2425
|
-
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path10.parse(pth).root, ""));
|
|
2426
|
-
if (pathHasInvalidWinCharacters) {
|
|
2427
|
-
const error = new Error(`Path contains invalid characters: ${pth}`);
|
|
2428
|
-
error.code = "EINVAL";
|
|
2429
|
-
throw error;
|
|
2430
|
-
}
|
|
2431
|
-
}
|
|
2432
|
-
};
|
|
2433
|
-
var processOptions = (options) => {
|
|
2434
|
-
const defaults = {
|
|
2435
|
-
mode: 511,
|
|
2436
|
-
fs: fs6
|
|
2437
|
-
};
|
|
2438
|
-
return {
|
|
2439
|
-
...defaults,
|
|
2440
|
-
...options
|
|
2441
|
-
};
|
|
2442
|
-
};
|
|
2443
|
-
var permissionError = (pth) => {
|
|
2444
|
-
const error = new Error(`operation not permitted, mkdir '${pth}'`);
|
|
2445
|
-
error.code = "EPERM";
|
|
2446
|
-
error.errno = -4048;
|
|
2447
|
-
error.path = pth;
|
|
2448
|
-
error.syscall = "mkdir";
|
|
2449
|
-
return error;
|
|
2450
|
-
};
|
|
2451
|
-
var makeDir = async (input, options) => {
|
|
2452
|
-
checkPath(input);
|
|
2453
|
-
options = processOptions(options);
|
|
2454
|
-
const mkdir2 = promisify(options.fs.mkdir);
|
|
2455
|
-
const stat2 = promisify(options.fs.stat);
|
|
2456
|
-
if (useNativeRecursiveOption && options.fs.mkdir === fs6.mkdir) {
|
|
2457
|
-
const pth = path10.resolve(input);
|
|
2458
|
-
await mkdir2(pth, {
|
|
2459
|
-
mode: options.mode,
|
|
2460
|
-
recursive: true
|
|
2461
|
-
});
|
|
2462
|
-
return pth;
|
|
2463
|
-
}
|
|
2464
|
-
const make = async (pth) => {
|
|
2465
|
-
try {
|
|
2466
|
-
await mkdir2(pth, options.mode);
|
|
2467
|
-
return pth;
|
|
2468
|
-
} catch (error) {
|
|
2469
|
-
if (error.code === "EPERM") {
|
|
2470
|
-
throw error;
|
|
2471
|
-
}
|
|
2472
|
-
if (error.code === "ENOENT") {
|
|
2473
|
-
if (path10.dirname(pth) === pth) {
|
|
2474
|
-
throw permissionError(pth);
|
|
2475
|
-
}
|
|
2476
|
-
if (error.message.includes("null bytes")) {
|
|
2477
|
-
throw error;
|
|
2478
|
-
}
|
|
2479
|
-
await make(path10.dirname(pth));
|
|
2480
|
-
return make(pth);
|
|
2481
|
-
}
|
|
2482
|
-
try {
|
|
2483
|
-
const stats = await stat2(pth);
|
|
2484
|
-
if (!stats.isDirectory()) {
|
|
2485
|
-
throw new Error("The path is not a directory");
|
|
2486
|
-
}
|
|
2487
|
-
} catch {
|
|
2488
|
-
throw error;
|
|
2489
|
-
}
|
|
2490
|
-
return pth;
|
|
2491
|
-
}
|
|
2492
|
-
};
|
|
2493
|
-
return make(path10.resolve(input));
|
|
2494
|
-
};
|
|
2495
|
-
module.exports = makeDir;
|
|
2496
|
-
module.exports.sync = (input, options) => {
|
|
2497
|
-
checkPath(input);
|
|
2498
|
-
options = processOptions(options);
|
|
2499
|
-
if (useNativeRecursiveOption && options.fs.mkdirSync === fs6.mkdirSync) {
|
|
2500
|
-
const pth = path10.resolve(input);
|
|
2501
|
-
fs6.mkdirSync(pth, {
|
|
2502
|
-
mode: options.mode,
|
|
2503
|
-
recursive: true
|
|
2504
|
-
});
|
|
2505
|
-
return pth;
|
|
2506
|
-
}
|
|
2507
|
-
const make = (pth) => {
|
|
2508
|
-
try {
|
|
2509
|
-
options.fs.mkdirSync(pth, options.mode);
|
|
2510
|
-
} catch (error) {
|
|
2511
|
-
if (error.code === "EPERM") {
|
|
2512
|
-
throw error;
|
|
2513
|
-
}
|
|
2514
|
-
if (error.code === "ENOENT") {
|
|
2515
|
-
if (path10.dirname(pth) === pth) {
|
|
2516
|
-
throw permissionError(pth);
|
|
2517
|
-
}
|
|
2518
|
-
if (error.message.includes("null bytes")) {
|
|
2519
|
-
throw error;
|
|
2520
|
-
}
|
|
2521
|
-
make(path10.dirname(pth));
|
|
2522
|
-
return make(pth);
|
|
2523
|
-
}
|
|
2524
|
-
try {
|
|
2525
|
-
if (!options.fs.statSync(pth).isDirectory()) {
|
|
2526
|
-
throw new Error("The path is not a directory");
|
|
2527
|
-
}
|
|
2528
|
-
} catch {
|
|
2529
|
-
throw error;
|
|
2530
|
-
}
|
|
2531
|
-
}
|
|
2532
|
-
return pth;
|
|
2533
|
-
};
|
|
2534
|
-
return make(path10.resolve(input));
|
|
2535
|
-
};
|
|
2536
|
-
}
|
|
2537
|
-
});
|
|
2538
|
-
|
|
2539
|
-
// node_modules/has-flag/index.js
|
|
2540
|
-
var require_has_flag = __commonJS({
|
|
2541
|
-
"node_modules/has-flag/index.js"(exports, module) {
|
|
2542
|
-
"use strict";
|
|
2543
|
-
module.exports = (flag, argv = process.argv) => {
|
|
2544
|
-
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
2545
|
-
const position = argv.indexOf(prefix + flag);
|
|
2546
|
-
const terminatorPosition = argv.indexOf("--");
|
|
2547
|
-
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
2548
|
-
};
|
|
2549
|
-
}
|
|
2550
|
-
});
|
|
2551
|
-
|
|
2552
|
-
// node_modules/supports-color/index.js
|
|
2553
|
-
var require_supports_color = __commonJS({
|
|
2554
|
-
"node_modules/supports-color/index.js"(exports, module) {
|
|
2555
|
-
"use strict";
|
|
2556
|
-
var os3 = __require("os");
|
|
2557
|
-
var tty = __require("tty");
|
|
2558
|
-
var hasFlag = require_has_flag();
|
|
2559
|
-
var { env: env2 } = process;
|
|
2560
|
-
var forceColor;
|
|
2561
|
-
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
2562
|
-
forceColor = 0;
|
|
2563
|
-
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
2564
|
-
forceColor = 1;
|
|
2565
|
-
}
|
|
2566
|
-
if ("FORCE_COLOR" in env2) {
|
|
2567
|
-
if (env2.FORCE_COLOR === "true") {
|
|
2568
|
-
forceColor = 1;
|
|
2569
|
-
} else if (env2.FORCE_COLOR === "false") {
|
|
2570
|
-
forceColor = 0;
|
|
2571
|
-
} else {
|
|
2572
|
-
forceColor = env2.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env2.FORCE_COLOR, 10), 3);
|
|
2573
|
-
}
|
|
2574
|
-
}
|
|
2575
|
-
function translateLevel(level) {
|
|
2576
|
-
if (level === 0) {
|
|
2577
|
-
return false;
|
|
2578
|
-
}
|
|
2579
|
-
return {
|
|
2580
|
-
level,
|
|
2581
|
-
hasBasic: true,
|
|
2582
|
-
has256: level >= 2,
|
|
2583
|
-
has16m: level >= 3
|
|
2584
|
-
};
|
|
2585
|
-
}
|
|
2586
|
-
function supportsColor(haveStream, streamIsTTY) {
|
|
2587
|
-
if (forceColor === 0) {
|
|
2588
|
-
return 0;
|
|
2589
|
-
}
|
|
2590
|
-
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
2591
|
-
return 3;
|
|
2592
|
-
}
|
|
2593
|
-
if (hasFlag("color=256")) {
|
|
2594
|
-
return 2;
|
|
2595
|
-
}
|
|
2596
|
-
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
2597
|
-
return 0;
|
|
2598
|
-
}
|
|
2599
|
-
const min = forceColor || 0;
|
|
2600
|
-
if (env2.TERM === "dumb") {
|
|
2601
|
-
return min;
|
|
2602
|
-
}
|
|
2603
|
-
if (process.platform === "win32") {
|
|
2604
|
-
const osRelease = os3.release().split(".");
|
|
2605
|
-
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
2606
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
2607
|
-
}
|
|
2608
|
-
return 1;
|
|
2609
|
-
}
|
|
2610
|
-
if ("CI" in env2) {
|
|
2611
|
-
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env2) || env2.CI_NAME === "codeship") {
|
|
2612
|
-
return 1;
|
|
2613
|
-
}
|
|
2614
|
-
return min;
|
|
2615
|
-
}
|
|
2616
|
-
if ("TEAMCITY_VERSION" in env2) {
|
|
2617
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env2.TEAMCITY_VERSION) ? 1 : 0;
|
|
2618
|
-
}
|
|
2619
|
-
if (env2.COLORTERM === "truecolor") {
|
|
2620
|
-
return 3;
|
|
2621
|
-
}
|
|
2622
|
-
if ("TERM_PROGRAM" in env2) {
|
|
2623
|
-
const version = parseInt((env2.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
2624
|
-
switch (env2.TERM_PROGRAM) {
|
|
2625
|
-
case "iTerm.app":
|
|
2626
|
-
return version >= 3 ? 3 : 2;
|
|
2627
|
-
case "Apple_Terminal":
|
|
2628
|
-
return 2;
|
|
2629
|
-
}
|
|
2630
|
-
}
|
|
2631
|
-
if (/-256(color)?$/i.test(env2.TERM)) {
|
|
2632
|
-
return 2;
|
|
2633
|
-
}
|
|
2634
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env2.TERM)) {
|
|
2635
|
-
return 1;
|
|
2636
|
-
}
|
|
2637
|
-
if ("COLORTERM" in env2) {
|
|
2638
|
-
return 1;
|
|
2639
|
-
}
|
|
2640
|
-
return min;
|
|
2641
|
-
}
|
|
2642
|
-
function getSupportLevel(stream) {
|
|
2643
|
-
const level = supportsColor(stream, stream && stream.isTTY);
|
|
2644
|
-
return translateLevel(level);
|
|
2645
|
-
}
|
|
2646
|
-
module.exports = {
|
|
2647
|
-
supportsColor: getSupportLevel,
|
|
2648
|
-
stdout: translateLevel(supportsColor(true, tty.isatty(1))),
|
|
2649
|
-
stderr: translateLevel(supportsColor(true, tty.isatty(2)))
|
|
2650
|
-
};
|
|
2651
|
-
}
|
|
2652
|
-
});
|
|
2653
|
-
|
|
2654
|
-
// node_modules/istanbul-lib-report/lib/file-writer.js
|
|
2655
|
-
var require_file_writer = __commonJS({
|
|
2656
|
-
"node_modules/istanbul-lib-report/lib/file-writer.js"(exports, module) {
|
|
2657
|
-
"use strict";
|
|
2658
|
-
var path10 = __require("path");
|
|
2659
|
-
var fs6 = __require("fs");
|
|
2660
|
-
var mkdirp = require_make_dir();
|
|
2661
|
-
var supportsColor = require_supports_color();
|
|
2662
|
-
var ContentWriter = class {
|
|
2663
|
-
/**
|
|
2664
|
-
* returns the colorized version of a string. Typically,
|
|
2665
|
-
* content writers that write to files will return the
|
|
2666
|
-
* same string and ones writing to a tty will wrap it in
|
|
2667
|
-
* appropriate escape sequences.
|
|
2668
|
-
* @param {String} str the string to colorize
|
|
2669
|
-
* @param {String} clazz one of `high`, `medium` or `low`
|
|
2670
|
-
* @returns {String} the colorized form of the string
|
|
2671
|
-
*/
|
|
2672
|
-
colorize(str) {
|
|
2673
|
-
return str;
|
|
2674
|
-
}
|
|
2675
|
-
/**
|
|
2676
|
-
* writes a string appended with a newline to the destination
|
|
2677
|
-
* @param {String} str the string to write
|
|
2678
|
-
*/
|
|
2679
|
-
println(str) {
|
|
2680
|
-
this.write(`${str}
|
|
2681
|
-
`);
|
|
2682
|
-
}
|
|
2683
|
-
/**
|
|
2684
|
-
* closes this content writer. Should be called after all writes are complete.
|
|
2685
|
-
*/
|
|
2686
|
-
close() {
|
|
2687
|
-
}
|
|
2688
|
-
};
|
|
2689
|
-
var FileContentWriter = class extends ContentWriter {
|
|
2690
|
-
constructor(fd) {
|
|
2691
|
-
super();
|
|
2692
|
-
this.fd = fd;
|
|
2693
|
-
}
|
|
2694
|
-
write(str) {
|
|
2695
|
-
fs6.writeSync(this.fd, str);
|
|
2696
|
-
}
|
|
2697
|
-
close() {
|
|
2698
|
-
fs6.closeSync(this.fd);
|
|
2699
|
-
}
|
|
2700
|
-
};
|
|
2701
|
-
var capture = false;
|
|
2702
|
-
var output = "";
|
|
2703
|
-
var ConsoleWriter = class extends ContentWriter {
|
|
2704
|
-
write(str) {
|
|
2705
|
-
if (capture) {
|
|
2706
|
-
output += str;
|
|
2707
|
-
} else {
|
|
2708
|
-
process.stdout.write(str);
|
|
2709
|
-
}
|
|
2710
|
-
}
|
|
2711
|
-
colorize(str, clazz) {
|
|
2712
|
-
const colors = {
|
|
2713
|
-
low: "31;1",
|
|
2714
|
-
medium: "33;1",
|
|
2715
|
-
high: "32;1"
|
|
2716
|
-
};
|
|
2717
|
-
if (supportsColor.stdout && colors[clazz]) {
|
|
2718
|
-
return `\x1B[${colors[clazz]}m${str}\x1B[0m`;
|
|
2719
|
-
}
|
|
2720
|
-
return str;
|
|
2721
|
-
}
|
|
2722
|
-
};
|
|
2723
|
-
var FileWriter = class _FileWriter {
|
|
2724
|
-
constructor(baseDir) {
|
|
2725
|
-
if (!baseDir) {
|
|
2726
|
-
throw new Error("baseDir must be specified");
|
|
2727
|
-
}
|
|
2728
|
-
this.baseDir = baseDir;
|
|
2729
|
-
}
|
|
2730
|
-
/**
|
|
2731
|
-
* static helpers for capturing stdout report output;
|
|
2732
|
-
* super useful for tests!
|
|
2733
|
-
*/
|
|
2734
|
-
static startCapture() {
|
|
2735
|
-
capture = true;
|
|
2736
|
-
}
|
|
2737
|
-
static stopCapture() {
|
|
2738
|
-
capture = false;
|
|
2739
|
-
}
|
|
2740
|
-
static getOutput() {
|
|
2741
|
-
return output;
|
|
2742
|
-
}
|
|
2743
|
-
static resetOutput() {
|
|
2744
|
-
output = "";
|
|
2745
|
-
}
|
|
2746
|
-
/**
|
|
2747
|
-
* returns a FileWriter that is rooted at the supplied subdirectory
|
|
2748
|
-
* @param {String} subdir the subdirectory under which to root the
|
|
2749
|
-
* returned FileWriter
|
|
2750
|
-
* @returns {FileWriter}
|
|
2751
|
-
*/
|
|
2752
|
-
writerForDir(subdir) {
|
|
2753
|
-
if (path10.isAbsolute(subdir)) {
|
|
2754
|
-
throw new Error(
|
|
2755
|
-
`Cannot create subdir writer for absolute path: ${subdir}`
|
|
2756
|
-
);
|
|
2757
|
-
}
|
|
2758
|
-
return new _FileWriter(`${this.baseDir}/${subdir}`);
|
|
2759
|
-
}
|
|
2760
|
-
/**
|
|
2761
|
-
* copies a file from a source directory to a destination name
|
|
2762
|
-
* @param {String} source path to source file
|
|
2763
|
-
* @param {String} dest relative path to destination file
|
|
2764
|
-
* @param {String} [header=undefined] optional text to prepend to destination
|
|
2765
|
-
* (e.g., an "this file is autogenerated" comment, copyright notice, etc.)
|
|
2766
|
-
*/
|
|
2767
|
-
copyFile(source, dest, header) {
|
|
2768
|
-
if (path10.isAbsolute(dest)) {
|
|
2769
|
-
throw new Error(`Cannot write to absolute path: ${dest}`);
|
|
2770
|
-
}
|
|
2771
|
-
dest = path10.resolve(this.baseDir, dest);
|
|
2772
|
-
mkdirp.sync(path10.dirname(dest));
|
|
2773
|
-
let contents;
|
|
2774
|
-
if (header) {
|
|
2775
|
-
contents = header + fs6.readFileSync(source, "utf8");
|
|
2776
|
-
} else {
|
|
2777
|
-
contents = fs6.readFileSync(source);
|
|
2778
|
-
}
|
|
2779
|
-
fs6.writeFileSync(dest, contents);
|
|
2780
|
-
}
|
|
2781
|
-
/**
|
|
2782
|
-
* returns a content writer for writing content to the supplied file.
|
|
2783
|
-
* @param {String|null} file the relative path to the file or the special
|
|
2784
|
-
* values `"-"` or `null` for writing to the console
|
|
2785
|
-
* @returns {ContentWriter}
|
|
2786
|
-
*/
|
|
2787
|
-
writeFile(file) {
|
|
2788
|
-
if (file === null || file === "-") {
|
|
2789
|
-
return new ConsoleWriter();
|
|
2790
|
-
}
|
|
2791
|
-
if (path10.isAbsolute(file)) {
|
|
2792
|
-
throw new Error(`Cannot write to absolute path: ${file}`);
|
|
2793
|
-
}
|
|
2794
|
-
file = path10.resolve(this.baseDir, file);
|
|
2795
|
-
mkdirp.sync(path10.dirname(file));
|
|
2796
|
-
return new FileContentWriter(fs6.openSync(file, "w"));
|
|
2797
|
-
}
|
|
2798
|
-
};
|
|
2799
|
-
module.exports = FileWriter;
|
|
2800
|
-
}
|
|
2801
|
-
});
|
|
2802
|
-
|
|
2803
|
-
// node_modules/istanbul-lib-report/lib/xml-writer.js
|
|
2804
|
-
var require_xml_writer = __commonJS({
|
|
2805
|
-
"node_modules/istanbul-lib-report/lib/xml-writer.js"(exports, module) {
|
|
2806
|
-
"use strict";
|
|
2807
|
-
var INDENT = " ";
|
|
2808
|
-
function attrString(attrs) {
|
|
2809
|
-
return Object.entries(attrs || {}).map(([k, v]) => ` ${k}="${v}"`).join("");
|
|
2810
|
-
}
|
|
2811
|
-
var XMLWriter = class {
|
|
2812
|
-
constructor(contentWriter) {
|
|
2813
|
-
this.cw = contentWriter;
|
|
2814
|
-
this.stack = [];
|
|
2815
|
-
}
|
|
2816
|
-
indent(str) {
|
|
2817
|
-
return this.stack.map(() => INDENT).join("") + str;
|
|
2818
|
-
}
|
|
2819
|
-
/**
|
|
2820
|
-
* writes the opening XML tag with the supplied attributes
|
|
2821
|
-
* @param {String} name tag name
|
|
2822
|
-
* @param {Object} [attrs=null] attrs attributes for the tag
|
|
2823
|
-
*/
|
|
2824
|
-
openTag(name, attrs) {
|
|
2825
|
-
const str = this.indent(`<${name + attrString(attrs)}>`);
|
|
2826
|
-
this.cw.println(str);
|
|
2827
|
-
this.stack.push(name);
|
|
2828
|
-
}
|
|
2829
|
-
/**
|
|
2830
|
-
* closes an open XML tag.
|
|
2831
|
-
* @param {String} name - tag name to close. This must match the writer's
|
|
2832
|
-
* notion of the tag that is currently open.
|
|
2833
|
-
*/
|
|
2834
|
-
closeTag(name) {
|
|
2835
|
-
if (this.stack.length === 0) {
|
|
2836
|
-
throw new Error(`Attempt to close tag ${name} when not opened`);
|
|
2837
|
-
}
|
|
2838
|
-
const stashed = this.stack.pop();
|
|
2839
|
-
const str = `</${name}>`;
|
|
2840
|
-
if (stashed !== name) {
|
|
2841
|
-
throw new Error(
|
|
2842
|
-
`Attempt to close tag ${name} when ${stashed} was the one open`
|
|
2843
|
-
);
|
|
2844
|
-
}
|
|
2845
|
-
this.cw.println(this.indent(str));
|
|
2846
|
-
}
|
|
2847
|
-
/**
|
|
2848
|
-
* writes a tag and its value opening and closing it at the same time
|
|
2849
|
-
* @param {String} name tag name
|
|
2850
|
-
* @param {Object} [attrs=null] attrs tag attributes
|
|
2851
|
-
* @param {String} [content=null] content optional tag content
|
|
2852
|
-
*/
|
|
2853
|
-
inlineTag(name, attrs, content) {
|
|
2854
|
-
let str = "<" + name + attrString(attrs);
|
|
2855
|
-
if (content) {
|
|
2856
|
-
str += `>${content}</${name}>`;
|
|
2857
|
-
} else {
|
|
2858
|
-
str += "/>";
|
|
2859
|
-
}
|
|
2860
|
-
str = this.indent(str);
|
|
2861
|
-
this.cw.println(str);
|
|
2862
|
-
}
|
|
2863
|
-
/**
|
|
2864
|
-
* closes all open tags and ends the document
|
|
2865
|
-
*/
|
|
2866
|
-
closeAll() {
|
|
2867
|
-
this.stack.slice().reverse().forEach((name) => {
|
|
2868
|
-
this.closeTag(name);
|
|
2869
|
-
});
|
|
2870
|
-
}
|
|
2871
|
-
};
|
|
2872
|
-
module.exports = XMLWriter;
|
|
2873
|
-
}
|
|
2874
|
-
});
|
|
2875
|
-
|
|
2876
|
-
// node_modules/istanbul-lib-report/lib/tree.js
|
|
2877
|
-
var require_tree = __commonJS({
|
|
2878
|
-
"node_modules/istanbul-lib-report/lib/tree.js"(exports, module) {
|
|
2879
|
-
"use strict";
|
|
2880
|
-
var Visitor = class {
|
|
2881
|
-
constructor(delegate) {
|
|
2882
|
-
this.delegate = delegate;
|
|
2883
|
-
}
|
|
2884
|
-
};
|
|
2885
|
-
["Start", "End", "Summary", "SummaryEnd", "Detail"].map((k) => `on${k}`).forEach((fn) => {
|
|
2886
|
-
Object.defineProperty(Visitor.prototype, fn, {
|
|
2887
|
-
writable: true,
|
|
2888
|
-
value(node, state) {
|
|
2889
|
-
if (typeof this.delegate[fn] === "function") {
|
|
2890
|
-
this.delegate[fn](node, state);
|
|
2891
|
-
}
|
|
2892
|
-
}
|
|
2893
|
-
});
|
|
2894
|
-
});
|
|
2895
|
-
var CompositeVisitor = class extends Visitor {
|
|
2896
|
-
constructor(visitors) {
|
|
2897
|
-
super();
|
|
2898
|
-
if (!Array.isArray(visitors)) {
|
|
2899
|
-
visitors = [visitors];
|
|
2900
|
-
}
|
|
2901
|
-
this.visitors = visitors.map((v) => {
|
|
2902
|
-
if (v instanceof Visitor) {
|
|
2903
|
-
return v;
|
|
2904
|
-
}
|
|
2905
|
-
return new Visitor(v);
|
|
2906
|
-
});
|
|
2907
|
-
}
|
|
2908
|
-
};
|
|
2909
|
-
["Start", "Summary", "SummaryEnd", "Detail", "End"].map((k) => `on${k}`).forEach((fn) => {
|
|
2910
|
-
Object.defineProperty(CompositeVisitor.prototype, fn, {
|
|
2911
|
-
value(node, state) {
|
|
2912
|
-
this.visitors.forEach((v) => {
|
|
2913
|
-
v[fn](node, state);
|
|
2914
|
-
});
|
|
2915
|
-
}
|
|
2916
|
-
});
|
|
2917
|
-
});
|
|
2918
|
-
var BaseNode = class {
|
|
2919
|
-
isRoot() {
|
|
2920
|
-
return !this.getParent();
|
|
2921
|
-
}
|
|
2922
|
-
/**
|
|
2923
|
-
* visit all nodes depth-first from this node down. Note that `onStart`
|
|
2924
|
-
* and `onEnd` are never called on the visitor even if the current
|
|
2925
|
-
* node is the root of the tree.
|
|
2926
|
-
* @param visitor a full visitor that is called during tree traversal
|
|
2927
|
-
* @param state optional state that is passed around
|
|
2928
|
-
*/
|
|
2929
|
-
visit(visitor, state) {
|
|
2930
|
-
if (this.isSummary()) {
|
|
2931
|
-
visitor.onSummary(this, state);
|
|
2932
|
-
} else {
|
|
2933
|
-
visitor.onDetail(this, state);
|
|
2934
|
-
}
|
|
2935
|
-
this.getChildren().forEach((child) => {
|
|
2936
|
-
child.visit(visitor, state);
|
|
2937
|
-
});
|
|
2938
|
-
if (this.isSummary()) {
|
|
2939
|
-
visitor.onSummaryEnd(this, state);
|
|
2940
|
-
}
|
|
2941
|
-
}
|
|
2942
|
-
};
|
|
2943
|
-
var BaseTree = class {
|
|
2944
|
-
constructor(root) {
|
|
2945
|
-
this.root = root;
|
|
2946
|
-
}
|
|
2947
|
-
/**
|
|
2948
|
-
* returns the root node of the tree
|
|
2949
|
-
*/
|
|
2950
|
-
getRoot() {
|
|
2951
|
-
return this.root;
|
|
2952
|
-
}
|
|
2953
|
-
/**
|
|
2954
|
-
* visits the tree depth-first with the supplied partial visitor
|
|
2955
|
-
* @param visitor - a potentially partial visitor
|
|
2956
|
-
* @param state - the state to be passed around during tree traversal
|
|
2957
|
-
*/
|
|
2958
|
-
visit(visitor, state) {
|
|
2959
|
-
if (!(visitor instanceof Visitor)) {
|
|
2960
|
-
visitor = new Visitor(visitor);
|
|
2961
|
-
}
|
|
2962
|
-
visitor.onStart(this.getRoot(), state);
|
|
2963
|
-
this.getRoot().visit(visitor, state);
|
|
2964
|
-
visitor.onEnd(this.getRoot(), state);
|
|
2965
|
-
}
|
|
2966
|
-
};
|
|
2967
|
-
module.exports = {
|
|
2968
|
-
BaseTree,
|
|
2969
|
-
BaseNode,
|
|
2970
|
-
Visitor,
|
|
2971
|
-
CompositeVisitor
|
|
2972
|
-
};
|
|
2973
|
-
}
|
|
2974
|
-
});
|
|
2975
|
-
|
|
2976
|
-
// node_modules/istanbul-lib-report/lib/watermarks.js
|
|
2977
|
-
var require_watermarks = __commonJS({
|
|
2978
|
-
"node_modules/istanbul-lib-report/lib/watermarks.js"(exports, module) {
|
|
2979
|
-
"use strict";
|
|
2980
|
-
module.exports = {
|
|
2981
|
-
getDefault() {
|
|
2982
|
-
return {
|
|
2983
|
-
statements: [50, 80],
|
|
2984
|
-
functions: [50, 80],
|
|
2985
|
-
branches: [50, 80],
|
|
2986
|
-
lines: [50, 80]
|
|
2987
|
-
};
|
|
2988
|
-
}
|
|
2989
|
-
};
|
|
2990
|
-
}
|
|
2991
|
-
});
|
|
2992
|
-
|
|
2993
|
-
// node_modules/istanbul-lib-coverage/lib/percent.js
|
|
2994
|
-
var require_percent = __commonJS({
|
|
2995
|
-
"node_modules/istanbul-lib-coverage/lib/percent.js"(exports, module) {
|
|
2996
|
-
"use strict";
|
|
2997
|
-
module.exports = function percent(covered, total) {
|
|
2998
|
-
let tmp;
|
|
2999
|
-
if (total > 0) {
|
|
3000
|
-
tmp = 1e3 * 100 * covered / total;
|
|
3001
|
-
return Math.floor(tmp / 10) / 100;
|
|
3002
|
-
} else {
|
|
3003
|
-
return 100;
|
|
3004
|
-
}
|
|
3005
|
-
};
|
|
3006
|
-
}
|
|
3007
|
-
});
|
|
3008
|
-
|
|
3009
|
-
// node_modules/istanbul-lib-coverage/lib/data-properties.js
|
|
3010
|
-
var require_data_properties = __commonJS({
|
|
3011
|
-
"node_modules/istanbul-lib-coverage/lib/data-properties.js"(exports, module) {
|
|
3012
|
-
"use strict";
|
|
3013
|
-
module.exports = function dataProperties(klass, properties) {
|
|
3014
|
-
properties.forEach((p) => {
|
|
3015
|
-
Object.defineProperty(klass.prototype, p, {
|
|
3016
|
-
enumerable: true,
|
|
3017
|
-
get() {
|
|
3018
|
-
return this.data[p];
|
|
3019
|
-
}
|
|
3020
|
-
});
|
|
3021
|
-
});
|
|
3022
|
-
};
|
|
3023
|
-
}
|
|
3024
|
-
});
|
|
3025
|
-
|
|
3026
|
-
// node_modules/istanbul-lib-coverage/lib/coverage-summary.js
|
|
3027
|
-
var require_coverage_summary = __commonJS({
|
|
3028
|
-
"node_modules/istanbul-lib-coverage/lib/coverage-summary.js"(exports, module) {
|
|
3029
|
-
"use strict";
|
|
3030
|
-
var percent = require_percent();
|
|
3031
|
-
var dataProperties = require_data_properties();
|
|
3032
|
-
function blankSummary() {
|
|
3033
|
-
const empty = () => ({
|
|
3034
|
-
total: 0,
|
|
3035
|
-
covered: 0,
|
|
3036
|
-
skipped: 0,
|
|
3037
|
-
pct: "Unknown"
|
|
3038
|
-
});
|
|
3039
|
-
return {
|
|
3040
|
-
lines: empty(),
|
|
3041
|
-
statements: empty(),
|
|
3042
|
-
functions: empty(),
|
|
3043
|
-
branches: empty(),
|
|
3044
|
-
branchesTrue: empty()
|
|
3045
|
-
};
|
|
3046
|
-
}
|
|
3047
|
-
function assertValidSummary(obj) {
|
|
3048
|
-
const valid = obj && obj.lines && obj.statements && obj.functions && obj.branches;
|
|
3049
|
-
if (!valid) {
|
|
3050
|
-
throw new Error(
|
|
3051
|
-
"Invalid summary coverage object, missing keys, found:" + Object.keys(obj).join(",")
|
|
3052
|
-
);
|
|
3053
|
-
}
|
|
3054
|
-
}
|
|
3055
|
-
var CoverageSummary = class _CoverageSummary {
|
|
3056
|
-
/**
|
|
3057
|
-
* @constructor
|
|
3058
|
-
* @param {Object|CoverageSummary} [obj=undefined] an optional data object or
|
|
3059
|
-
* another coverage summary to initialize this object with.
|
|
3060
|
-
*/
|
|
3061
|
-
constructor(obj) {
|
|
3062
|
-
if (!obj) {
|
|
3063
|
-
this.data = blankSummary();
|
|
3064
|
-
} else if (obj instanceof _CoverageSummary) {
|
|
3065
|
-
this.data = obj.data;
|
|
3066
|
-
} else {
|
|
3067
|
-
this.data = obj;
|
|
3068
|
-
}
|
|
3069
|
-
assertValidSummary(this.data);
|
|
3070
|
-
}
|
|
3071
|
-
/**
|
|
3072
|
-
* merges a second summary coverage object into this one
|
|
3073
|
-
* @param {CoverageSummary} obj - another coverage summary object
|
|
3074
|
-
*/
|
|
3075
|
-
merge(obj) {
|
|
3076
|
-
const keys = [
|
|
3077
|
-
"lines",
|
|
3078
|
-
"statements",
|
|
3079
|
-
"branches",
|
|
3080
|
-
"functions",
|
|
3081
|
-
"branchesTrue"
|
|
3082
|
-
];
|
|
3083
|
-
keys.forEach((key) => {
|
|
3084
|
-
if (obj[key]) {
|
|
3085
|
-
this[key].total += obj[key].total;
|
|
3086
|
-
this[key].covered += obj[key].covered;
|
|
3087
|
-
this[key].skipped += obj[key].skipped;
|
|
3088
|
-
this[key].pct = percent(this[key].covered, this[key].total);
|
|
3089
|
-
}
|
|
3090
|
-
});
|
|
3091
|
-
return this;
|
|
3092
|
-
}
|
|
3093
|
-
/**
|
|
3094
|
-
* returns a POJO that is JSON serializable. May be used to get the raw
|
|
3095
|
-
* summary object.
|
|
3096
|
-
*/
|
|
3097
|
-
toJSON() {
|
|
3098
|
-
return this.data;
|
|
3099
|
-
}
|
|
3100
|
-
/**
|
|
3101
|
-
* return true if summary has no lines of code
|
|
3102
|
-
*/
|
|
3103
|
-
isEmpty() {
|
|
3104
|
-
return this.lines.total === 0;
|
|
3105
|
-
}
|
|
3106
|
-
};
|
|
3107
|
-
dataProperties(CoverageSummary, [
|
|
3108
|
-
"lines",
|
|
3109
|
-
"statements",
|
|
3110
|
-
"functions",
|
|
3111
|
-
"branches",
|
|
3112
|
-
"branchesTrue"
|
|
3113
|
-
]);
|
|
3114
|
-
module.exports = {
|
|
3115
|
-
CoverageSummary
|
|
3116
|
-
};
|
|
3117
|
-
}
|
|
3118
|
-
});
|
|
3119
|
-
|
|
3120
|
-
// node_modules/istanbul-lib-coverage/lib/file-coverage.js
|
|
3121
|
-
var require_file_coverage = __commonJS({
|
|
3122
|
-
"node_modules/istanbul-lib-coverage/lib/file-coverage.js"(exports, module) {
|
|
3123
|
-
"use strict";
|
|
3124
|
-
var percent = require_percent();
|
|
3125
|
-
var dataProperties = require_data_properties();
|
|
3126
|
-
var { CoverageSummary } = require_coverage_summary();
|
|
3127
|
-
function emptyCoverage(filePath, reportLogic) {
|
|
3128
|
-
const cov = {
|
|
3129
|
-
path: filePath,
|
|
3130
|
-
statementMap: {},
|
|
3131
|
-
fnMap: {},
|
|
3132
|
-
branchMap: {},
|
|
3133
|
-
s: {},
|
|
3134
|
-
f: {},
|
|
3135
|
-
b: {}
|
|
3136
|
-
};
|
|
3137
|
-
if (reportLogic) cov.bT = {};
|
|
3138
|
-
return cov;
|
|
3139
|
-
}
|
|
3140
|
-
function assertValidObject(obj) {
|
|
3141
|
-
const valid = obj && obj.path && obj.statementMap && obj.fnMap && obj.branchMap && obj.s && obj.f && obj.b;
|
|
3142
|
-
if (!valid) {
|
|
3143
|
-
throw new Error(
|
|
3144
|
-
"Invalid file coverage object, missing keys, found:" + Object.keys(obj).join(",")
|
|
3145
|
-
);
|
|
3146
|
-
}
|
|
3147
|
-
}
|
|
3148
|
-
var keyFromLoc = ({ start, end }) => `${start.line}|${start.column}|${end.line}|${end.column}`;
|
|
3149
|
-
var isObj = (o) => !!o && typeof o === "object";
|
|
3150
|
-
var isLineCol = (o) => isObj(o) && typeof o.line === "number" && typeof o.column === "number";
|
|
3151
|
-
var isLoc = (o) => isObj(o) && isLineCol(o.start) && isLineCol(o.end);
|
|
3152
|
-
var getLoc = (o) => isLoc(o) ? o : isLoc(o.loc) ? o.loc : null;
|
|
3153
|
-
var findNearestContainer = (item, map) => {
|
|
3154
|
-
const itemLoc = getLoc(item);
|
|
3155
|
-
if (!itemLoc) return null;
|
|
3156
|
-
let nearestContainingItem = null;
|
|
3157
|
-
let containerDistance = null;
|
|
3158
|
-
let containerKey = null;
|
|
3159
|
-
for (const [i, mapItem] of Object.entries(map)) {
|
|
3160
|
-
const mapLoc = getLoc(mapItem);
|
|
3161
|
-
if (!mapLoc) continue;
|
|
3162
|
-
const distance = [
|
|
3163
|
-
itemLoc.start.line - mapLoc.start.line,
|
|
3164
|
-
itemLoc.start.column - mapLoc.start.column,
|
|
3165
|
-
mapLoc.end.line - itemLoc.end.line,
|
|
3166
|
-
mapLoc.end.column - itemLoc.end.column
|
|
3167
|
-
];
|
|
3168
|
-
if (distance[0] < 0 || distance[2] < 0 || distance[0] === 0 && distance[1] < 0 || distance[2] === 0 && distance[3] < 0) {
|
|
3169
|
-
continue;
|
|
3170
|
-
}
|
|
3171
|
-
if (nearestContainingItem === null) {
|
|
3172
|
-
containerDistance = distance;
|
|
3173
|
-
nearestContainingItem = mapItem;
|
|
3174
|
-
containerKey = i;
|
|
3175
|
-
continue;
|
|
3176
|
-
}
|
|
3177
|
-
const closerBefore = distance[0] < containerDistance[0] || distance[0] === 0 && distance[1] < containerDistance[1];
|
|
3178
|
-
const closerAfter = distance[2] < containerDistance[2] || distance[2] === 0 && distance[3] < containerDistance[3];
|
|
3179
|
-
if (closerBefore || closerAfter) {
|
|
3180
|
-
containerDistance = distance;
|
|
3181
|
-
nearestContainingItem = mapItem;
|
|
3182
|
-
containerKey = i;
|
|
3183
|
-
}
|
|
3184
|
-
}
|
|
3185
|
-
return containerKey;
|
|
3186
|
-
};
|
|
3187
|
-
var addHits = (aHits, bHits) => {
|
|
3188
|
-
if (typeof aHits === "number" && typeof bHits === "number") {
|
|
3189
|
-
return aHits + bHits;
|
|
3190
|
-
} else if (Array.isArray(aHits) && Array.isArray(bHits)) {
|
|
3191
|
-
return aHits.map((a, i) => (a || 0) + (bHits[i] || 0));
|
|
3192
|
-
}
|
|
3193
|
-
return null;
|
|
3194
|
-
};
|
|
3195
|
-
var addNearestContainerHits = (item, itemHits, map, mapHits) => {
|
|
3196
|
-
const container = findNearestContainer(item, map);
|
|
3197
|
-
if (container) {
|
|
3198
|
-
return addHits(itemHits, mapHits[container]);
|
|
3199
|
-
} else {
|
|
3200
|
-
return itemHits;
|
|
3201
|
-
}
|
|
3202
|
-
};
|
|
3203
|
-
var mergeProp = (aHits, aMap, bHits, bMap, itemKey = keyFromLoc) => {
|
|
3204
|
-
const aItems = {};
|
|
3205
|
-
for (const [key, itemHits] of Object.entries(aHits)) {
|
|
3206
|
-
const item = aMap[key];
|
|
3207
|
-
aItems[itemKey(item)] = [itemHits, item];
|
|
3208
|
-
}
|
|
3209
|
-
const bItems = {};
|
|
3210
|
-
for (const [key, itemHits] of Object.entries(bHits)) {
|
|
3211
|
-
const item = bMap[key];
|
|
3212
|
-
bItems[itemKey(item)] = [itemHits, item];
|
|
3213
|
-
}
|
|
3214
|
-
const mergedItems = {};
|
|
3215
|
-
for (const [key, aValue] of Object.entries(aItems)) {
|
|
3216
|
-
let aItemHits = aValue[0];
|
|
3217
|
-
const aItem = aValue[1];
|
|
3218
|
-
const bValue = bItems[key];
|
|
3219
|
-
if (!bValue) {
|
|
3220
|
-
aItemHits = addNearestContainerHits(aItem, aItemHits, bMap, bHits);
|
|
3221
|
-
} else {
|
|
3222
|
-
aItemHits = addHits(aItemHits, bValue[0]);
|
|
3223
|
-
}
|
|
3224
|
-
mergedItems[key] = [aItemHits, aItem];
|
|
3225
|
-
}
|
|
3226
|
-
for (const [key, bValue] of Object.entries(bItems)) {
|
|
3227
|
-
let bItemHits = bValue[0];
|
|
3228
|
-
const bItem = bValue[1];
|
|
3229
|
-
if (mergedItems[key]) continue;
|
|
3230
|
-
bItemHits = addNearestContainerHits(bItem, bItemHits, aMap, aHits);
|
|
3231
|
-
mergedItems[key] = [bItemHits, bItem];
|
|
3232
|
-
}
|
|
3233
|
-
const hits = {};
|
|
3234
|
-
const map = {};
|
|
3235
|
-
Object.values(mergedItems).forEach(([itemHits, item], i) => {
|
|
3236
|
-
hits[i] = itemHits;
|
|
3237
|
-
map[i] = item;
|
|
3238
|
-
});
|
|
3239
|
-
return [hits, map];
|
|
3240
|
-
};
|
|
3241
|
-
var FileCoverage = class _FileCoverage {
|
|
3242
|
-
/**
|
|
3243
|
-
* @constructor
|
|
3244
|
-
* @param {Object|FileCoverage|String} pathOrObj is a string that initializes
|
|
3245
|
-
* and empty coverage object with the specified file path or a data object that
|
|
3246
|
-
* has all the required properties for a file coverage object.
|
|
3247
|
-
*/
|
|
3248
|
-
constructor(pathOrObj, reportLogic = false) {
|
|
3249
|
-
if (!pathOrObj) {
|
|
3250
|
-
throw new Error(
|
|
3251
|
-
"Coverage must be initialized with a path or an object"
|
|
3252
|
-
);
|
|
3253
|
-
}
|
|
3254
|
-
if (typeof pathOrObj === "string") {
|
|
3255
|
-
this.data = emptyCoverage(pathOrObj, reportLogic);
|
|
3256
|
-
} else if (pathOrObj instanceof _FileCoverage) {
|
|
3257
|
-
this.data = pathOrObj.data;
|
|
3258
|
-
} else if (typeof pathOrObj === "object") {
|
|
3259
|
-
this.data = pathOrObj;
|
|
3260
|
-
} else {
|
|
3261
|
-
throw new Error("Invalid argument to coverage constructor");
|
|
3262
|
-
}
|
|
3263
|
-
assertValidObject(this.data);
|
|
3264
|
-
}
|
|
3265
|
-
/**
|
|
3266
|
-
* returns computed line coverage from statement coverage.
|
|
3267
|
-
* This is a map of hits keyed by line number in the source.
|
|
3268
|
-
*/
|
|
3269
|
-
getLineCoverage() {
|
|
3270
|
-
const statementMap = this.data.statementMap;
|
|
3271
|
-
const statements = this.data.s;
|
|
3272
|
-
const lineMap = /* @__PURE__ */ Object.create(null);
|
|
3273
|
-
Object.entries(statements).forEach(([st, count]) => {
|
|
3274
|
-
if (!statementMap[st]) {
|
|
3275
|
-
return;
|
|
3276
|
-
}
|
|
3277
|
-
const { line } = statementMap[st].start;
|
|
3278
|
-
const prevVal = lineMap[line];
|
|
3279
|
-
if (prevVal === void 0 || prevVal < count) {
|
|
3280
|
-
lineMap[line] = count;
|
|
3281
|
-
}
|
|
3282
|
-
});
|
|
3283
|
-
return lineMap;
|
|
3284
|
-
}
|
|
3285
|
-
/**
|
|
3286
|
-
* returns an array of uncovered line numbers.
|
|
3287
|
-
* @returns {Array} an array of line numbers for which no hits have been
|
|
3288
|
-
* collected.
|
|
3289
|
-
*/
|
|
3290
|
-
getUncoveredLines() {
|
|
3291
|
-
const lc = this.getLineCoverage();
|
|
3292
|
-
const ret = [];
|
|
3293
|
-
Object.entries(lc).forEach(([l, hits]) => {
|
|
3294
|
-
if (hits === 0) {
|
|
3295
|
-
ret.push(l);
|
|
3296
|
-
}
|
|
3297
|
-
});
|
|
3298
|
-
return ret;
|
|
3299
|
-
}
|
|
3300
|
-
/**
|
|
3301
|
-
* returns a map of branch coverage by source line number.
|
|
3302
|
-
* @returns {Object} an object keyed by line number. Each object
|
|
3303
|
-
* has a `covered`, `total` and `coverage` (percentage) property.
|
|
3304
|
-
*/
|
|
3305
|
-
getBranchCoverageByLine() {
|
|
3306
|
-
const branchMap = this.branchMap;
|
|
3307
|
-
const branches = this.b;
|
|
3308
|
-
const ret = {};
|
|
3309
|
-
Object.entries(branchMap).forEach(([k, map]) => {
|
|
3310
|
-
const line = map.line || map.loc.start.line;
|
|
3311
|
-
const branchData = branches[k];
|
|
3312
|
-
ret[line] = ret[line] || [];
|
|
3313
|
-
ret[line].push(...branchData);
|
|
3314
|
-
});
|
|
3315
|
-
Object.entries(ret).forEach(([k, dataArray]) => {
|
|
3316
|
-
const covered = dataArray.filter((item) => item > 0);
|
|
3317
|
-
const coverage = covered.length / dataArray.length * 100;
|
|
3318
|
-
ret[k] = {
|
|
3319
|
-
covered: covered.length,
|
|
3320
|
-
total: dataArray.length,
|
|
3321
|
-
coverage
|
|
3322
|
-
};
|
|
3323
|
-
});
|
|
3324
|
-
return ret;
|
|
3325
|
-
}
|
|
3326
|
-
/**
|
|
3327
|
-
* return a JSON-serializable POJO for this file coverage object
|
|
3328
|
-
*/
|
|
3329
|
-
toJSON() {
|
|
3330
|
-
return this.data;
|
|
3331
|
-
}
|
|
3332
|
-
/**
|
|
3333
|
-
* merges a second coverage object into this one, updating hit counts
|
|
3334
|
-
* @param {FileCoverage} other - the coverage object to be merged into this one.
|
|
3335
|
-
* Note that the other object should have the same structure as this one (same file).
|
|
3336
|
-
*/
|
|
3337
|
-
merge(other) {
|
|
3338
|
-
if (other.all === true) {
|
|
3339
|
-
return;
|
|
3340
|
-
}
|
|
3341
|
-
if (this.all === true) {
|
|
3342
|
-
this.data = other.data;
|
|
3343
|
-
return;
|
|
3344
|
-
}
|
|
3345
|
-
let [hits, map] = mergeProp(
|
|
3346
|
-
this.s,
|
|
3347
|
-
this.statementMap,
|
|
3348
|
-
other.s,
|
|
3349
|
-
other.statementMap
|
|
3350
|
-
);
|
|
3351
|
-
this.data.s = hits;
|
|
3352
|
-
this.data.statementMap = map;
|
|
3353
|
-
const keyFromLocProp = (x) => keyFromLoc(x.loc);
|
|
3354
|
-
const keyFromLocationsProp = (x) => keyFromLoc(x.locations[0]);
|
|
3355
|
-
[hits, map] = mergeProp(
|
|
3356
|
-
this.f,
|
|
3357
|
-
this.fnMap,
|
|
3358
|
-
other.f,
|
|
3359
|
-
other.fnMap,
|
|
3360
|
-
keyFromLocProp
|
|
3361
|
-
);
|
|
3362
|
-
this.data.f = hits;
|
|
3363
|
-
this.data.fnMap = map;
|
|
3364
|
-
[hits, map] = mergeProp(
|
|
3365
|
-
this.b,
|
|
3366
|
-
this.branchMap,
|
|
3367
|
-
other.b,
|
|
3368
|
-
other.branchMap,
|
|
3369
|
-
keyFromLocationsProp
|
|
3370
|
-
);
|
|
3371
|
-
this.data.b = hits;
|
|
3372
|
-
this.data.branchMap = map;
|
|
3373
|
-
if (this.bT && other.bT) {
|
|
3374
|
-
[hits, map] = mergeProp(
|
|
3375
|
-
this.bT,
|
|
3376
|
-
this.branchMap,
|
|
3377
|
-
other.bT,
|
|
3378
|
-
other.branchMap,
|
|
3379
|
-
keyFromLocationsProp
|
|
3380
|
-
);
|
|
3381
|
-
this.data.bT = hits;
|
|
3382
|
-
}
|
|
3383
|
-
}
|
|
3384
|
-
computeSimpleTotals(property) {
|
|
3385
|
-
let stats = this[property];
|
|
3386
|
-
if (typeof stats === "function") {
|
|
3387
|
-
stats = stats.call(this);
|
|
3388
|
-
}
|
|
3389
|
-
const ret = {
|
|
3390
|
-
total: Object.keys(stats).length,
|
|
3391
|
-
covered: Object.values(stats).filter((v) => !!v).length,
|
|
3392
|
-
skipped: 0
|
|
3393
|
-
};
|
|
3394
|
-
ret.pct = percent(ret.covered, ret.total);
|
|
3395
|
-
return ret;
|
|
3396
|
-
}
|
|
3397
|
-
computeBranchTotals(property) {
|
|
3398
|
-
const stats = this[property];
|
|
3399
|
-
const ret = { total: 0, covered: 0, skipped: 0 };
|
|
3400
|
-
Object.values(stats).forEach((branches) => {
|
|
3401
|
-
ret.covered += branches.filter((hits) => hits > 0).length;
|
|
3402
|
-
ret.total += branches.length;
|
|
3403
|
-
});
|
|
3404
|
-
ret.pct = percent(ret.covered, ret.total);
|
|
3405
|
-
return ret;
|
|
3406
|
-
}
|
|
3407
|
-
/**
|
|
3408
|
-
* resets hit counts for all statements, functions and branches
|
|
3409
|
-
* in this coverage object resulting in zero coverage.
|
|
3410
|
-
*/
|
|
3411
|
-
resetHits() {
|
|
3412
|
-
const statements = this.s;
|
|
3413
|
-
const functions = this.f;
|
|
3414
|
-
const branches = this.b;
|
|
3415
|
-
const branchesTrue = this.bT;
|
|
3416
|
-
Object.keys(statements).forEach((s) => {
|
|
3417
|
-
statements[s] = 0;
|
|
3418
|
-
});
|
|
3419
|
-
Object.keys(functions).forEach((f) => {
|
|
3420
|
-
functions[f] = 0;
|
|
3421
|
-
});
|
|
3422
|
-
Object.keys(branches).forEach((b) => {
|
|
3423
|
-
branches[b].fill(0);
|
|
3424
|
-
});
|
|
3425
|
-
if (branchesTrue) {
|
|
3426
|
-
Object.keys(branchesTrue).forEach((bT) => {
|
|
3427
|
-
branchesTrue[bT].fill(0);
|
|
3428
|
-
});
|
|
3429
|
-
}
|
|
3430
|
-
}
|
|
3431
|
-
/**
|
|
3432
|
-
* returns a CoverageSummary for this file coverage object
|
|
3433
|
-
* @returns {CoverageSummary}
|
|
3434
|
-
*/
|
|
3435
|
-
toSummary() {
|
|
3436
|
-
const ret = {};
|
|
3437
|
-
ret.lines = this.computeSimpleTotals("getLineCoverage");
|
|
3438
|
-
ret.functions = this.computeSimpleTotals("f", "fnMap");
|
|
3439
|
-
ret.statements = this.computeSimpleTotals("s", "statementMap");
|
|
3440
|
-
ret.branches = this.computeBranchTotals("b");
|
|
3441
|
-
if (this.bT) {
|
|
3442
|
-
ret.branchesTrue = this.computeBranchTotals("bT");
|
|
3443
|
-
}
|
|
3444
|
-
return new CoverageSummary(ret);
|
|
3445
|
-
}
|
|
3446
|
-
};
|
|
3447
|
-
dataProperties(FileCoverage, [
|
|
3448
|
-
"path",
|
|
3449
|
-
"statementMap",
|
|
3450
|
-
"fnMap",
|
|
3451
|
-
"branchMap",
|
|
3452
|
-
"s",
|
|
3453
|
-
"f",
|
|
3454
|
-
"b",
|
|
3455
|
-
"bT",
|
|
3456
|
-
"all"
|
|
3457
|
-
]);
|
|
3458
|
-
module.exports = {
|
|
3459
|
-
FileCoverage,
|
|
3460
|
-
// exported for testing
|
|
3461
|
-
findNearestContainer,
|
|
3462
|
-
addHits,
|
|
3463
|
-
addNearestContainerHits
|
|
3464
|
-
};
|
|
3465
|
-
}
|
|
3466
|
-
});
|
|
3467
|
-
|
|
3468
|
-
// node_modules/istanbul-lib-coverage/lib/coverage-map.js
|
|
3469
|
-
var require_coverage_map = __commonJS({
|
|
3470
|
-
"node_modules/istanbul-lib-coverage/lib/coverage-map.js"(exports, module) {
|
|
3471
|
-
"use strict";
|
|
3472
|
-
var { FileCoverage } = require_file_coverage();
|
|
3473
|
-
var { CoverageSummary } = require_coverage_summary();
|
|
3474
|
-
function maybeConstruct(obj, klass) {
|
|
3475
|
-
if (obj instanceof klass) {
|
|
3476
|
-
return obj;
|
|
3477
|
-
}
|
|
3478
|
-
return new klass(obj);
|
|
3479
|
-
}
|
|
3480
|
-
function loadMap(source) {
|
|
3481
|
-
const data = /* @__PURE__ */ Object.create(null);
|
|
3482
|
-
if (!source) {
|
|
3483
|
-
return data;
|
|
3484
|
-
}
|
|
3485
|
-
Object.entries(source).forEach(([k, cov]) => {
|
|
3486
|
-
data[k] = maybeConstruct(cov, FileCoverage);
|
|
3487
|
-
});
|
|
3488
|
-
return data;
|
|
3489
|
-
}
|
|
3490
|
-
var CoverageMap = class _CoverageMap {
|
|
3491
|
-
/**
|
|
3492
|
-
* @constructor
|
|
3493
|
-
* @param {Object} [obj=undefined] obj A coverage map from which to initialize this
|
|
3494
|
-
* map's contents. This can be the raw global coverage object.
|
|
3495
|
-
*/
|
|
3496
|
-
constructor(obj) {
|
|
3497
|
-
if (obj instanceof _CoverageMap) {
|
|
3498
|
-
this.data = obj.data;
|
|
3499
|
-
} else {
|
|
3500
|
-
this.data = loadMap(obj);
|
|
3501
|
-
}
|
|
3502
|
-
}
|
|
3503
|
-
/**
|
|
3504
|
-
* merges a second coverage map into this one
|
|
3505
|
-
* @param {CoverageMap} obj - a CoverageMap or its raw data. Coverage is merged
|
|
3506
|
-
* correctly for the same files and additional file coverage keys are created
|
|
3507
|
-
* as needed.
|
|
3508
|
-
*/
|
|
3509
|
-
merge(obj) {
|
|
3510
|
-
const other = maybeConstruct(obj, _CoverageMap);
|
|
3511
|
-
Object.values(other.data).forEach((fc) => {
|
|
3512
|
-
this.addFileCoverage(fc);
|
|
3513
|
-
});
|
|
3514
|
-
}
|
|
3515
|
-
/**
|
|
3516
|
-
* filter the coveragemap based on the callback provided
|
|
3517
|
-
* @param {Function (filename)} callback - Returns true if the path
|
|
3518
|
-
* should be included in the coveragemap. False if it should be
|
|
3519
|
-
* removed.
|
|
3520
|
-
*/
|
|
3521
|
-
filter(callback) {
|
|
3522
|
-
Object.keys(this.data).forEach((k) => {
|
|
3523
|
-
if (!callback(k)) {
|
|
3524
|
-
delete this.data[k];
|
|
3525
|
-
}
|
|
3526
|
-
});
|
|
3527
|
-
}
|
|
3528
|
-
/**
|
|
3529
|
-
* returns a JSON-serializable POJO for this coverage map
|
|
3530
|
-
* @returns {Object}
|
|
3531
|
-
*/
|
|
3532
|
-
toJSON() {
|
|
3533
|
-
return this.data;
|
|
3534
|
-
}
|
|
3535
|
-
/**
|
|
3536
|
-
* returns an array for file paths for which this map has coverage
|
|
3537
|
-
* @returns {Array{string}} - array of files
|
|
3538
|
-
*/
|
|
3539
|
-
files() {
|
|
3540
|
-
return Object.keys(this.data);
|
|
3541
|
-
}
|
|
3542
|
-
/**
|
|
3543
|
-
* returns the file coverage for the specified file.
|
|
3544
|
-
* @param {String} file
|
|
3545
|
-
* @returns {FileCoverage}
|
|
3546
|
-
*/
|
|
3547
|
-
fileCoverageFor(file) {
|
|
3548
|
-
const fc = this.data[file];
|
|
3549
|
-
if (!fc) {
|
|
3550
|
-
throw new Error(`No file coverage available for: ${file}`);
|
|
3551
|
-
}
|
|
3552
|
-
return fc;
|
|
3553
|
-
}
|
|
3554
|
-
/**
|
|
3555
|
-
* adds a file coverage object to this map. If the path for the object,
|
|
3556
|
-
* already exists in the map, it is merged with the existing coverage
|
|
3557
|
-
* otherwise a new key is added to the map.
|
|
3558
|
-
* @param {FileCoverage} fc the file coverage to add
|
|
3559
|
-
*/
|
|
3560
|
-
addFileCoverage(fc) {
|
|
3561
|
-
const cov = new FileCoverage(fc);
|
|
3562
|
-
const { path: path10 } = cov;
|
|
3563
|
-
if (this.data[path10]) {
|
|
3564
|
-
this.data[path10].merge(cov);
|
|
3565
|
-
} else {
|
|
3566
|
-
this.data[path10] = cov;
|
|
3567
|
-
}
|
|
3568
|
-
}
|
|
3569
|
-
/**
|
|
3570
|
-
* returns the coverage summary for all the file coverage objects in this map.
|
|
3571
|
-
* @returns {CoverageSummary}
|
|
3572
|
-
*/
|
|
3573
|
-
getCoverageSummary() {
|
|
3574
|
-
const ret = new CoverageSummary();
|
|
3575
|
-
Object.values(this.data).forEach((fc) => {
|
|
3576
|
-
ret.merge(fc.toSummary());
|
|
3577
|
-
});
|
|
3578
|
-
return ret;
|
|
3579
|
-
}
|
|
3580
|
-
};
|
|
3581
|
-
module.exports = {
|
|
3582
|
-
CoverageMap
|
|
3583
|
-
};
|
|
3584
|
-
}
|
|
3585
|
-
});
|
|
3586
|
-
|
|
3587
|
-
// node_modules/istanbul-lib-coverage/index.js
|
|
3588
|
-
var require_istanbul_lib_coverage = __commonJS({
|
|
3589
|
-
"node_modules/istanbul-lib-coverage/index.js"(exports, module) {
|
|
3590
|
-
"use strict";
|
|
3591
|
-
var { FileCoverage } = require_file_coverage();
|
|
3592
|
-
var { CoverageMap } = require_coverage_map();
|
|
3593
|
-
var { CoverageSummary } = require_coverage_summary();
|
|
3594
|
-
module.exports = {
|
|
3595
|
-
/**
|
|
3596
|
-
* creates a coverage summary object
|
|
3597
|
-
* @param {Object} obj an argument with the same semantics
|
|
3598
|
-
* as the one passed to the `CoverageSummary` constructor
|
|
3599
|
-
* @returns {CoverageSummary}
|
|
3600
|
-
*/
|
|
3601
|
-
createCoverageSummary(obj) {
|
|
3602
|
-
if (obj && obj instanceof CoverageSummary) {
|
|
3603
|
-
return obj;
|
|
3604
|
-
}
|
|
3605
|
-
return new CoverageSummary(obj);
|
|
3606
|
-
},
|
|
3607
|
-
/**
|
|
3608
|
-
* creates a CoverageMap object
|
|
3609
|
-
* @param {Object} obj optional - an argument with the same semantics
|
|
3610
|
-
* as the one passed to the CoverageMap constructor.
|
|
3611
|
-
* @returns {CoverageMap}
|
|
3612
|
-
*/
|
|
3613
|
-
createCoverageMap(obj) {
|
|
3614
|
-
if (obj && obj instanceof CoverageMap) {
|
|
3615
|
-
return obj;
|
|
3616
|
-
}
|
|
3617
|
-
return new CoverageMap(obj);
|
|
3618
|
-
},
|
|
3619
|
-
/**
|
|
3620
|
-
* creates a FileCoverage object
|
|
3621
|
-
* @param {Object} obj optional - an argument with the same semantics
|
|
3622
|
-
* as the one passed to the FileCoverage constructor.
|
|
3623
|
-
* @returns {FileCoverage}
|
|
3624
|
-
*/
|
|
3625
|
-
createFileCoverage(obj) {
|
|
3626
|
-
if (obj && obj instanceof FileCoverage) {
|
|
3627
|
-
return obj;
|
|
3628
|
-
}
|
|
3629
|
-
return new FileCoverage(obj);
|
|
3630
|
-
}
|
|
3631
|
-
};
|
|
3632
|
-
module.exports.classes = {
|
|
3633
|
-
/**
|
|
3634
|
-
* the file coverage constructor
|
|
3635
|
-
*/
|
|
3636
|
-
FileCoverage
|
|
3637
|
-
};
|
|
3638
|
-
}
|
|
3639
|
-
});
|
|
3640
|
-
|
|
3641
|
-
// node_modules/istanbul-lib-report/lib/path.js
|
|
3642
|
-
var require_path = __commonJS({
|
|
3643
|
-
"node_modules/istanbul-lib-report/lib/path.js"(exports, module) {
|
|
3644
|
-
"use strict";
|
|
3645
|
-
var path10 = __require("path");
|
|
3646
|
-
var parsePath = path10.parse;
|
|
3647
|
-
var SEP = path10.sep;
|
|
3648
|
-
var origParser = parsePath;
|
|
3649
|
-
var origSep = SEP;
|
|
3650
|
-
function makeRelativeNormalizedPath(str, sep) {
|
|
3651
|
-
const parsed = parsePath(str);
|
|
3652
|
-
let root = parsed.root;
|
|
3653
|
-
let dir;
|
|
3654
|
-
let file = parsed.base;
|
|
3655
|
-
let quoted;
|
|
3656
|
-
let pos;
|
|
3657
|
-
if (sep === "\\") {
|
|
3658
|
-
pos = root.indexOf(":\\");
|
|
3659
|
-
if (pos >= 0) {
|
|
3660
|
-
root = root.substring(0, pos + 2);
|
|
3661
|
-
}
|
|
3662
|
-
}
|
|
3663
|
-
dir = parsed.dir.substring(root.length);
|
|
3664
|
-
if (str === "") {
|
|
3665
|
-
return [];
|
|
3666
|
-
}
|
|
3667
|
-
if (sep !== "/") {
|
|
3668
|
-
quoted = new RegExp(sep.replace(/\W/g, "\\$&"), "g");
|
|
3669
|
-
dir = dir.replace(quoted, "/");
|
|
3670
|
-
file = file.replace(quoted, "/");
|
|
3671
|
-
}
|
|
3672
|
-
if (dir !== "") {
|
|
3673
|
-
dir = `${dir}/${file}`;
|
|
3674
|
-
} else {
|
|
3675
|
-
dir = file;
|
|
3676
|
-
}
|
|
3677
|
-
if (dir.substring(0, 1) === "/") {
|
|
3678
|
-
dir = dir.substring(1);
|
|
3679
|
-
}
|
|
3680
|
-
dir = dir.split(/\/+/);
|
|
3681
|
-
return dir;
|
|
3682
|
-
}
|
|
3683
|
-
var Path = class _Path {
|
|
3684
|
-
constructor(strOrArray) {
|
|
3685
|
-
if (Array.isArray(strOrArray)) {
|
|
3686
|
-
this.v = strOrArray;
|
|
3687
|
-
} else if (typeof strOrArray === "string") {
|
|
3688
|
-
this.v = makeRelativeNormalizedPath(strOrArray, SEP);
|
|
3689
|
-
} else {
|
|
3690
|
-
throw new Error(
|
|
3691
|
-
`Invalid Path argument must be string or array:${strOrArray}`
|
|
3692
|
-
);
|
|
1757
|
+
}
|
|
3693
1758
|
}
|
|
3694
1759
|
}
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
}
|
|
3698
|
-
|
|
3699
|
-
return this.v.length > 0;
|
|
1760
|
+
if (space instanceof Number) {
|
|
1761
|
+
space = Number(space);
|
|
1762
|
+
} else if (space instanceof String) {
|
|
1763
|
+
space = String(space);
|
|
3700
1764
|
}
|
|
3701
|
-
|
|
3702
|
-
if (
|
|
3703
|
-
|
|
1765
|
+
if (typeof space === "number") {
|
|
1766
|
+
if (space > 0) {
|
|
1767
|
+
space = Math.min(10, Math.floor(space));
|
|
1768
|
+
gap = " ".substr(0, space);
|
|
3704
1769
|
}
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
return new _Path(p);
|
|
3708
|
-
}
|
|
3709
|
-
elements() {
|
|
3710
|
-
return this.v.slice();
|
|
3711
|
-
}
|
|
3712
|
-
name() {
|
|
3713
|
-
return this.v.slice(-1)[0];
|
|
1770
|
+
} else if (typeof space === "string") {
|
|
1771
|
+
gap = space.substr(0, 10);
|
|
3714
1772
|
}
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
if (
|
|
3722
|
-
|
|
1773
|
+
return serializeProperty("", { "": value });
|
|
1774
|
+
function serializeProperty(key, holder) {
|
|
1775
|
+
let value2 = holder[key];
|
|
1776
|
+
if (value2 != null) {
|
|
1777
|
+
if (typeof value2.toJSON5 === "function") {
|
|
1778
|
+
value2 = value2.toJSON5(key);
|
|
1779
|
+
} else if (typeof value2.toJSON === "function") {
|
|
1780
|
+
value2 = value2.toJSON(key);
|
|
3723
1781
|
}
|
|
3724
1782
|
}
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
ancestorOf(other) {
|
|
3728
|
-
return other.contains(this) && other.length !== this.length;
|
|
3729
|
-
}
|
|
3730
|
-
descendantOf(other) {
|
|
3731
|
-
return this.contains(other) && other.length !== this.length;
|
|
3732
|
-
}
|
|
3733
|
-
commonPrefixPath(other) {
|
|
3734
|
-
const len = this.length > other.length ? other.length : this.length;
|
|
3735
|
-
let i;
|
|
3736
|
-
const ret = [];
|
|
3737
|
-
for (i = 0; i < len; i += 1) {
|
|
3738
|
-
if (this.v[i] === other.v[i]) {
|
|
3739
|
-
ret.push(this.v[i]);
|
|
3740
|
-
} else {
|
|
3741
|
-
break;
|
|
3742
|
-
}
|
|
1783
|
+
if (replacerFunc) {
|
|
1784
|
+
value2 = replacerFunc.call(holder, key, value2);
|
|
3743
1785
|
}
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
return -1;
|
|
1786
|
+
if (value2 instanceof Number) {
|
|
1787
|
+
value2 = Number(value2);
|
|
1788
|
+
} else if (value2 instanceof String) {
|
|
1789
|
+
value2 = String(value2);
|
|
1790
|
+
} else if (value2 instanceof Boolean) {
|
|
1791
|
+
value2 = value2.valueOf();
|
|
3751
1792
|
}
|
|
3752
|
-
|
|
3753
|
-
|
|
1793
|
+
switch (value2) {
|
|
1794
|
+
case null:
|
|
1795
|
+
return "null";
|
|
1796
|
+
case true:
|
|
1797
|
+
return "true";
|
|
1798
|
+
case false:
|
|
1799
|
+
return "false";
|
|
3754
1800
|
}
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
return astr < bstr ? -1 : astr > bstr ? 1 : 0;
|
|
3758
|
-
}
|
|
3759
|
-
};
|
|
3760
|
-
["push", "pop", "shift", "unshift", "splice"].forEach((fn) => {
|
|
3761
|
-
Object.defineProperty(Path.prototype, fn, {
|
|
3762
|
-
value(...args) {
|
|
3763
|
-
return this.v[fn](...args);
|
|
1801
|
+
if (typeof value2 === "string") {
|
|
1802
|
+
return quoteString(value2, false);
|
|
3764
1803
|
}
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
});
|
|
3773
|
-
module.exports = Path;
|
|
3774
|
-
Path.tester = {
|
|
3775
|
-
setParserAndSep(p, sep) {
|
|
3776
|
-
parsePath = p;
|
|
3777
|
-
SEP = sep;
|
|
3778
|
-
},
|
|
3779
|
-
reset() {
|
|
3780
|
-
parsePath = origParser;
|
|
3781
|
-
SEP = origSep;
|
|
1804
|
+
if (typeof value2 === "number") {
|
|
1805
|
+
return String(value2);
|
|
1806
|
+
}
|
|
1807
|
+
if (typeof value2 === "object") {
|
|
1808
|
+
return Array.isArray(value2) ? serializeArray(value2) : serializeObject(value2);
|
|
1809
|
+
}
|
|
1810
|
+
return void 0;
|
|
3782
1811
|
}
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
let relPath;
|
|
3826
|
-
let i;
|
|
3827
|
-
const parentPath = parent ? parent.path : new Path([]);
|
|
3828
|
-
if (parentPath.ancestorOf(myPath)) {
|
|
3829
|
-
relPath = new Path(myPath.elements());
|
|
3830
|
-
for (i = 0; i < parentPath.length; i += 1) {
|
|
3831
|
-
relPath.shift();
|
|
1812
|
+
function quoteString(value2) {
|
|
1813
|
+
const quotes = {
|
|
1814
|
+
"'": 0.1,
|
|
1815
|
+
'"': 0.2
|
|
1816
|
+
};
|
|
1817
|
+
const replacements = {
|
|
1818
|
+
"'": "\\'",
|
|
1819
|
+
'"': '\\"',
|
|
1820
|
+
"\\": "\\\\",
|
|
1821
|
+
"\b": "\\b",
|
|
1822
|
+
"\f": "\\f",
|
|
1823
|
+
"\n": "\\n",
|
|
1824
|
+
"\r": "\\r",
|
|
1825
|
+
" ": "\\t",
|
|
1826
|
+
"\v": "\\v",
|
|
1827
|
+
"\0": "\\0",
|
|
1828
|
+
"\u2028": "\\u2028",
|
|
1829
|
+
"\u2029": "\\u2029"
|
|
1830
|
+
};
|
|
1831
|
+
let product = "";
|
|
1832
|
+
for (let i = 0; i < value2.length; i++) {
|
|
1833
|
+
const c = value2[i];
|
|
1834
|
+
switch (c) {
|
|
1835
|
+
case "'":
|
|
1836
|
+
case '"':
|
|
1837
|
+
quotes[c]++;
|
|
1838
|
+
product += c;
|
|
1839
|
+
continue;
|
|
1840
|
+
case "\0":
|
|
1841
|
+
if (util2.isDigit(value2[i + 1])) {
|
|
1842
|
+
product += "\\x00";
|
|
1843
|
+
continue;
|
|
1844
|
+
}
|
|
1845
|
+
}
|
|
1846
|
+
if (replacements[c]) {
|
|
1847
|
+
product += replacements[c];
|
|
1848
|
+
continue;
|
|
1849
|
+
}
|
|
1850
|
+
if (c < " ") {
|
|
1851
|
+
let hexString = c.charCodeAt(0).toString(16);
|
|
1852
|
+
product += "\\x" + ("00" + hexString).substring(hexString.length);
|
|
1853
|
+
continue;
|
|
3832
1854
|
}
|
|
3833
|
-
|
|
1855
|
+
product += c;
|
|
3834
1856
|
}
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
return this.parent;
|
|
3839
|
-
}
|
|
3840
|
-
getChildren() {
|
|
3841
|
-
return this.children;
|
|
3842
|
-
}
|
|
3843
|
-
isSummary() {
|
|
3844
|
-
return !this.fileCoverage;
|
|
3845
|
-
}
|
|
3846
|
-
getFileCoverage() {
|
|
3847
|
-
return this.fileCoverage;
|
|
1857
|
+
const quoteChar = quote || Object.keys(quotes).reduce((a, b) => quotes[a] < quotes[b] ? a : b);
|
|
1858
|
+
product = product.replace(new RegExp(quoteChar, "g"), replacements[quoteChar]);
|
|
1859
|
+
return quoteChar + product + quoteChar;
|
|
3848
1860
|
}
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
if (Object.prototype.hasOwnProperty.call(this, cacheProp)) {
|
|
3853
|
-
return this[cacheProp];
|
|
1861
|
+
function serializeObject(value2) {
|
|
1862
|
+
if (stack.indexOf(value2) >= 0) {
|
|
1863
|
+
throw TypeError("Converting circular structure to JSON5");
|
|
3854
1864
|
}
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
1865
|
+
stack.push(value2);
|
|
1866
|
+
let stepback = indent;
|
|
1867
|
+
indent = indent + gap;
|
|
1868
|
+
let keys = propertyList || Object.keys(value2);
|
|
1869
|
+
let partial = [];
|
|
1870
|
+
for (const key of keys) {
|
|
1871
|
+
const propertyString = serializeProperty(key, value2);
|
|
1872
|
+
if (propertyString !== void 0) {
|
|
1873
|
+
let member = serializeKey(key) + ":";
|
|
1874
|
+
if (gap !== "") {
|
|
1875
|
+
member += " ";
|
|
3863
1876
|
}
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
});
|
|
3867
|
-
if (count === 0 && filesOnly) {
|
|
3868
|
-
summary = null;
|
|
1877
|
+
member += propertyString;
|
|
1878
|
+
partial.push(member);
|
|
3869
1879
|
}
|
|
3870
1880
|
}
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
if (childPrefix && !node.isRoot()) {
|
|
3880
|
-
node.path.unshift(childPrefix);
|
|
3881
|
-
}
|
|
3882
|
-
};
|
|
3883
|
-
this.visit({
|
|
3884
|
-
onDetail: maybePrefix,
|
|
3885
|
-
onSummary(node) {
|
|
3886
|
-
maybePrefix(node);
|
|
3887
|
-
node.children.sort((a, b) => {
|
|
3888
|
-
const astr = a.path.toString();
|
|
3889
|
-
const bstr = b.path.toString();
|
|
3890
|
-
return astr < bstr ? -1 : astr > bstr ? 1 : (
|
|
3891
|
-
/* istanbul ignore next */
|
|
3892
|
-
0
|
|
3893
|
-
);
|
|
3894
|
-
});
|
|
3895
|
-
}
|
|
3896
|
-
});
|
|
3897
|
-
}
|
|
3898
|
-
};
|
|
3899
|
-
function findCommonParent(paths) {
|
|
3900
|
-
return paths.reduce(
|
|
3901
|
-
(common, path10) => common.commonPrefixPath(path10),
|
|
3902
|
-
paths[0] || new Path([])
|
|
3903
|
-
);
|
|
3904
|
-
}
|
|
3905
|
-
function findOrCreateParent(parentPath, nodeMap, created = () => {
|
|
3906
|
-
}) {
|
|
3907
|
-
let parent = nodeMap[parentPath.toString()];
|
|
3908
|
-
if (!parent) {
|
|
3909
|
-
parent = new ReportNode(parentPath);
|
|
3910
|
-
nodeMap[parentPath.toString()] = parent;
|
|
3911
|
-
created(parentPath, parent);
|
|
3912
|
-
}
|
|
3913
|
-
return parent;
|
|
3914
|
-
}
|
|
3915
|
-
function toDirParents(list) {
|
|
3916
|
-
const nodeMap = /* @__PURE__ */ Object.create(null);
|
|
3917
|
-
list.forEach((o) => {
|
|
3918
|
-
const parent = findOrCreateParent(o.path.parent(), nodeMap);
|
|
3919
|
-
parent.addChild(new ReportNode(o.path, o.fileCoverage));
|
|
3920
|
-
});
|
|
3921
|
-
return Object.values(nodeMap);
|
|
3922
|
-
}
|
|
3923
|
-
function addAllPaths(topPaths, nodeMap, path10, node) {
|
|
3924
|
-
const parent = findOrCreateParent(
|
|
3925
|
-
path10.parent(),
|
|
3926
|
-
nodeMap,
|
|
3927
|
-
(parentPath, parent2) => {
|
|
3928
|
-
if (parentPath.hasParent()) {
|
|
3929
|
-
addAllPaths(topPaths, nodeMap, parentPath, parent2);
|
|
1881
|
+
let final;
|
|
1882
|
+
if (partial.length === 0) {
|
|
1883
|
+
final = "{}";
|
|
1884
|
+
} else {
|
|
1885
|
+
let properties;
|
|
1886
|
+
if (gap === "") {
|
|
1887
|
+
properties = partial.join(",");
|
|
1888
|
+
final = "{" + properties + "}";
|
|
3930
1889
|
} else {
|
|
3931
|
-
|
|
1890
|
+
let separator = ",\n" + indent;
|
|
1891
|
+
properties = partial.join(separator);
|
|
1892
|
+
final = "{\n" + indent + properties + ",\n" + stepback + "}";
|
|
3932
1893
|
}
|
|
3933
1894
|
}
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
function foldIntoOneDir(node, parent) {
|
|
3938
|
-
const { children } = node;
|
|
3939
|
-
if (children.length === 1 && !children[0].fileCoverage) {
|
|
3940
|
-
children[0].parent = parent;
|
|
3941
|
-
return foldIntoOneDir(children[0], parent);
|
|
3942
|
-
}
|
|
3943
|
-
node.children = children.map((child) => foldIntoOneDir(child, node));
|
|
3944
|
-
return node;
|
|
3945
|
-
}
|
|
3946
|
-
function pkgSummaryPrefix(dirParents, commonParent) {
|
|
3947
|
-
if (!dirParents.some((dp) => dp.path.length === 0)) {
|
|
3948
|
-
return;
|
|
3949
|
-
}
|
|
3950
|
-
if (commonParent.length === 0) {
|
|
3951
|
-
return "root";
|
|
3952
|
-
}
|
|
3953
|
-
return commonParent.name();
|
|
3954
|
-
}
|
|
3955
|
-
var SummarizerFactory = class {
|
|
3956
|
-
constructor(coverageMap, defaultSummarizer = "pkg") {
|
|
3957
|
-
this._coverageMap = coverageMap;
|
|
3958
|
-
this._defaultSummarizer = defaultSummarizer;
|
|
3959
|
-
this._initialList = coverageMap.files().map((filePath) => ({
|
|
3960
|
-
filePath,
|
|
3961
|
-
path: new Path(filePath),
|
|
3962
|
-
fileCoverage: coverageMap.fileCoverageFor(filePath)
|
|
3963
|
-
}));
|
|
3964
|
-
this._commonParent = findCommonParent(
|
|
3965
|
-
this._initialList.map((o) => o.path.parent())
|
|
3966
|
-
);
|
|
3967
|
-
if (this._commonParent.length > 0) {
|
|
3968
|
-
this._initialList.forEach((o) => {
|
|
3969
|
-
o.path.splice(0, this._commonParent.length);
|
|
3970
|
-
});
|
|
3971
|
-
}
|
|
3972
|
-
}
|
|
3973
|
-
get defaultSummarizer() {
|
|
3974
|
-
return this[this._defaultSummarizer];
|
|
3975
|
-
}
|
|
3976
|
-
get flat() {
|
|
3977
|
-
if (!this._flat) {
|
|
3978
|
-
this._flat = new ReportTree(
|
|
3979
|
-
ReportNode.createRoot(
|
|
3980
|
-
this._initialList.map(
|
|
3981
|
-
(node) => new ReportNode(node.path, node.fileCoverage)
|
|
3982
|
-
)
|
|
3983
|
-
)
|
|
3984
|
-
);
|
|
3985
|
-
}
|
|
3986
|
-
return this._flat;
|
|
1895
|
+
stack.pop();
|
|
1896
|
+
indent = stepback;
|
|
1897
|
+
return final;
|
|
3987
1898
|
}
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
return new ReportTree(dirParents[0]);
|
|
1899
|
+
function serializeKey(key) {
|
|
1900
|
+
if (key.length === 0) {
|
|
1901
|
+
return quoteString(key, true);
|
|
3992
1902
|
}
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
);
|
|
3997
|
-
}
|
|
3998
|
-
get pkg() {
|
|
3999
|
-
if (!this._pkg) {
|
|
4000
|
-
this._pkg = this._createPkg();
|
|
1903
|
+
const firstChar = String.fromCodePoint(key.codePointAt(0));
|
|
1904
|
+
if (!util2.isIdStartChar(firstChar)) {
|
|
1905
|
+
return quoteString(key, true);
|
|
4001
1906
|
}
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
const topPaths = [];
|
|
4007
|
-
this._initialList.forEach((o) => {
|
|
4008
|
-
const node = new ReportNode(o.path, o.fileCoverage);
|
|
4009
|
-
addAllPaths(topPaths, nodeMap, o.path, node);
|
|
4010
|
-
});
|
|
4011
|
-
const topNodes = topPaths.map((node) => foldIntoOneDir(node));
|
|
4012
|
-
if (topNodes.length === 1) {
|
|
4013
|
-
return new ReportTree(topNodes[0]);
|
|
1907
|
+
for (let i = firstChar.length; i < key.length; i++) {
|
|
1908
|
+
if (!util2.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) {
|
|
1909
|
+
return quoteString(key, true);
|
|
1910
|
+
}
|
|
4014
1911
|
}
|
|
4015
|
-
return
|
|
1912
|
+
return key;
|
|
4016
1913
|
}
|
|
4017
|
-
|
|
4018
|
-
if (
|
|
4019
|
-
|
|
1914
|
+
function serializeArray(value2) {
|
|
1915
|
+
if (stack.indexOf(value2) >= 0) {
|
|
1916
|
+
throw TypeError("Converting circular structure to JSON5");
|
|
4020
1917
|
}
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
// node_modules/istanbul-lib-report/lib/context.js
|
|
4029
|
-
var require_context = __commonJS({
|
|
4030
|
-
"node_modules/istanbul-lib-report/lib/context.js"(exports, module) {
|
|
4031
|
-
"use strict";
|
|
4032
|
-
var fs6 = __require("fs");
|
|
4033
|
-
var FileWriter = require_file_writer();
|
|
4034
|
-
var XMLWriter = require_xml_writer();
|
|
4035
|
-
var tree = require_tree();
|
|
4036
|
-
var watermarks = require_watermarks();
|
|
4037
|
-
var SummarizerFactory = require_summarizer_factory();
|
|
4038
|
-
function defaultSourceLookup(path10) {
|
|
4039
|
-
try {
|
|
4040
|
-
return fs6.readFileSync(path10, "utf8");
|
|
4041
|
-
} catch (ex) {
|
|
4042
|
-
throw new Error(`Unable to lookup source: ${path10} (${ex.message})`);
|
|
4043
|
-
}
|
|
4044
|
-
}
|
|
4045
|
-
function normalizeWatermarks(specified = {}) {
|
|
4046
|
-
Object.entries(watermarks.getDefault()).forEach(([k, value]) => {
|
|
4047
|
-
const specValue = specified[k];
|
|
4048
|
-
if (!Array.isArray(specValue) || specValue.length !== 2) {
|
|
4049
|
-
specified[k] = value;
|
|
1918
|
+
stack.push(value2);
|
|
1919
|
+
let stepback = indent;
|
|
1920
|
+
indent = indent + gap;
|
|
1921
|
+
let partial = [];
|
|
1922
|
+
for (let i = 0; i < value2.length; i++) {
|
|
1923
|
+
const propertyString = serializeProperty(String(i), value2);
|
|
1924
|
+
partial.push(propertyString !== void 0 ? propertyString : "null");
|
|
4050
1925
|
}
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
this.data = {};
|
|
4064
|
-
}
|
|
4065
|
-
/**
|
|
4066
|
-
* returns a FileWriter implementation for reporting use. Also available
|
|
4067
|
-
* as the `writer` property on the context.
|
|
4068
|
-
* @returns {Writer}
|
|
4069
|
-
*/
|
|
4070
|
-
getWriter() {
|
|
4071
|
-
return this.writer;
|
|
4072
|
-
}
|
|
4073
|
-
/**
|
|
4074
|
-
* returns the source code for the specified file path or throws if
|
|
4075
|
-
* the source could not be found.
|
|
4076
|
-
* @param {String} filePath the file path as found in a file coverage object
|
|
4077
|
-
* @returns {String} the source code
|
|
4078
|
-
*/
|
|
4079
|
-
getSource(filePath) {
|
|
4080
|
-
return this.sourceFinder(filePath);
|
|
4081
|
-
}
|
|
4082
|
-
/**
|
|
4083
|
-
* returns the coverage class given a coverage
|
|
4084
|
-
* types and a percentage value.
|
|
4085
|
-
* @param {String} type - the coverage type, one of `statements`, `functions`,
|
|
4086
|
-
* `branches`, or `lines`
|
|
4087
|
-
* @param {Number} value - the percentage value
|
|
4088
|
-
* @returns {String} one of `high`, `medium` or `low`
|
|
4089
|
-
*/
|
|
4090
|
-
classForPercent(type, value) {
|
|
4091
|
-
const watermarks2 = this.watermarks[type];
|
|
4092
|
-
if (!watermarks2) {
|
|
4093
|
-
return "unknown";
|
|
4094
|
-
}
|
|
4095
|
-
if (value < watermarks2[0]) {
|
|
4096
|
-
return "low";
|
|
4097
|
-
}
|
|
4098
|
-
if (value >= watermarks2[1]) {
|
|
4099
|
-
return "high";
|
|
4100
|
-
}
|
|
4101
|
-
return "medium";
|
|
4102
|
-
}
|
|
4103
|
-
/**
|
|
4104
|
-
* returns an XML writer for the supplied content writer
|
|
4105
|
-
* @param {ContentWriter} contentWriter the content writer to which the returned XML writer
|
|
4106
|
-
* writes data
|
|
4107
|
-
* @returns {XMLWriter}
|
|
4108
|
-
*/
|
|
4109
|
-
getXMLWriter(contentWriter) {
|
|
4110
|
-
return new XMLWriter(contentWriter);
|
|
4111
|
-
}
|
|
4112
|
-
/**
|
|
4113
|
-
* returns a full visitor given a partial one.
|
|
4114
|
-
* @param {Object} partialVisitor a partial visitor only having the functions of
|
|
4115
|
-
* interest to the caller. These functions are called with a scope that is the
|
|
4116
|
-
* supplied object.
|
|
4117
|
-
* @returns {Visitor}
|
|
4118
|
-
*/
|
|
4119
|
-
getVisitor(partialVisitor) {
|
|
4120
|
-
return new tree.Visitor(partialVisitor);
|
|
4121
|
-
}
|
|
4122
|
-
getTree(name = "defaultSummarizer") {
|
|
4123
|
-
return this._summarizerFactory[name];
|
|
4124
|
-
}
|
|
4125
|
-
};
|
|
4126
|
-
Object.defineProperty(Context.prototype, "writer", {
|
|
4127
|
-
enumerable: true,
|
|
4128
|
-
get() {
|
|
4129
|
-
if (!this.data.writer) {
|
|
4130
|
-
this.data.writer = new FileWriter(this.dir);
|
|
1926
|
+
let final;
|
|
1927
|
+
if (partial.length === 0) {
|
|
1928
|
+
final = "[]";
|
|
1929
|
+
} else {
|
|
1930
|
+
if (gap === "") {
|
|
1931
|
+
let properties = partial.join(",");
|
|
1932
|
+
final = "[" + properties + "]";
|
|
1933
|
+
} else {
|
|
1934
|
+
let separator = ",\n" + indent;
|
|
1935
|
+
let properties = partial.join(separator);
|
|
1936
|
+
final = "[\n" + indent + properties + ",\n" + stepback + "]";
|
|
1937
|
+
}
|
|
4131
1938
|
}
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
module.exports = Context;
|
|
4136
|
-
}
|
|
4137
|
-
});
|
|
4138
|
-
|
|
4139
|
-
// node_modules/istanbul-lib-report/lib/report-base.js
|
|
4140
|
-
var require_report_base = __commonJS({
|
|
4141
|
-
"node_modules/istanbul-lib-report/lib/report-base.js"(exports, module) {
|
|
4142
|
-
"use strict";
|
|
4143
|
-
var _summarizer = Symbol("ReportBase.#summarizer");
|
|
4144
|
-
var ReportBase = class {
|
|
4145
|
-
constructor(opts = {}) {
|
|
4146
|
-
this[_summarizer] = opts.summarizer;
|
|
4147
|
-
}
|
|
4148
|
-
execute(context) {
|
|
4149
|
-
context.getTree(this[_summarizer]).visit(this, context);
|
|
1939
|
+
stack.pop();
|
|
1940
|
+
indent = stepback;
|
|
1941
|
+
return final;
|
|
4150
1942
|
}
|
|
4151
1943
|
};
|
|
4152
|
-
module.exports = ReportBase;
|
|
4153
|
-
}
|
|
4154
|
-
});
|
|
4155
|
-
|
|
4156
|
-
// node_modules/istanbul-lib-report/index.js
|
|
4157
|
-
var require_istanbul_lib_report = __commonJS({
|
|
4158
|
-
"node_modules/istanbul-lib-report/index.js"(exports, module) {
|
|
4159
|
-
"use strict";
|
|
4160
|
-
var Context = require_context();
|
|
4161
|
-
var watermarks = require_watermarks();
|
|
4162
|
-
var ReportBase = require_report_base();
|
|
4163
|
-
module.exports = {
|
|
4164
|
-
/**
|
|
4165
|
-
* returns a reporting context for the supplied options
|
|
4166
|
-
* @param {Object} [opts=null] opts
|
|
4167
|
-
* @returns {Context}
|
|
4168
|
-
*/
|
|
4169
|
-
createContext(opts) {
|
|
4170
|
-
return new Context(opts);
|
|
4171
|
-
},
|
|
4172
|
-
/**
|
|
4173
|
-
* returns the default watermarks that would be used when not
|
|
4174
|
-
* overridden
|
|
4175
|
-
* @returns {Object} an object with `statements`, `functions`, `branches`,
|
|
4176
|
-
* and `line` keys. Each value is a 2 element array that has the low and
|
|
4177
|
-
* high watermark as percentages.
|
|
4178
|
-
*/
|
|
4179
|
-
getDefaultWatermarks() {
|
|
4180
|
-
return watermarks.getDefault();
|
|
4181
|
-
},
|
|
4182
|
-
/**
|
|
4183
|
-
* Base class for all reports
|
|
4184
|
-
*/
|
|
4185
|
-
ReportBase
|
|
4186
|
-
};
|
|
4187
1944
|
}
|
|
4188
1945
|
});
|
|
4189
1946
|
|
|
4190
|
-
// node_modules/
|
|
4191
|
-
var
|
|
4192
|
-
"node_modules/
|
|
4193
|
-
|
|
4194
|
-
var
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
let Cons;
|
|
4199
|
-
try {
|
|
4200
|
-
Cons = __require(path10.join(__dirname, "lib", name));
|
|
4201
|
-
} catch (e) {
|
|
4202
|
-
if (e.code !== "MODULE_NOT_FOUND") {
|
|
4203
|
-
throw e;
|
|
4204
|
-
}
|
|
4205
|
-
Cons = __require(name);
|
|
4206
|
-
}
|
|
4207
|
-
return new Cons(cfg);
|
|
4208
|
-
}
|
|
1947
|
+
// node_modules/json5/lib/index.js
|
|
1948
|
+
var require_lib = __commonJS({
|
|
1949
|
+
"node_modules/json5/lib/index.js"(exports, module) {
|
|
1950
|
+
var parse = require_parse();
|
|
1951
|
+
var stringify = require_stringify();
|
|
1952
|
+
var JSON52 = {
|
|
1953
|
+
parse,
|
|
1954
|
+
stringify
|
|
4209
1955
|
};
|
|
1956
|
+
module.exports = JSON52;
|
|
4210
1957
|
}
|
|
4211
1958
|
});
|
|
4212
1959
|
|
|
@@ -7314,8 +5061,6 @@ ${footer}`;
|
|
|
7314
5061
|
}
|
|
7315
5062
|
|
|
7316
5063
|
// src/lib/program.ts
|
|
7317
|
-
var LibReport = __toESM(require_istanbul_lib_report(), 1);
|
|
7318
|
-
var Reports = __toESM(require_istanbul_reports(), 1);
|
|
7319
5064
|
init_env_utils();
|
|
7320
5065
|
init_exec();
|
|
7321
5066
|
init_args();
|
|
@@ -7324,9 +5069,15 @@ import * as os2 from "node:os";
|
|
|
7324
5069
|
import * as fsSync3 from "node:fs";
|
|
7325
5070
|
import { createRequire as createRequire2 } from "node:module";
|
|
7326
5071
|
import * as fs5 from "node:fs/promises";
|
|
5072
|
+
import * as LibReport from "istanbul-lib-report";
|
|
5073
|
+
import * as Reports from "istanbul-reports";
|
|
7327
5074
|
var jestBin = "./node_modules/.bin/jest";
|
|
7328
5075
|
var babelNodeBin = "./node_modules/.bin/babel-node";
|
|
7329
|
-
var
|
|
5076
|
+
var moduleSpecifierForRequire = (
|
|
5077
|
+
// @ts-ignore
|
|
5078
|
+
typeof __filename !== "undefined" ? __filename : import.meta.url
|
|
5079
|
+
);
|
|
5080
|
+
var requireCjs = createRequire2(moduleSpecifierForRequire);
|
|
7330
5081
|
var registerSignalHandlersOnce = () => {
|
|
7331
5082
|
let handled = false;
|
|
7332
5083
|
const on = (sig) => {
|