@bigbinary/neeto-audit-frontend 2.0.1 → 2.0.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/README.md +52 -1
- package/common/.husky/widget/pre-push +7 -0
- package/common/eslint/widget/.eslintrc.js +9 -0
- package/common/prettier/widget/.prettierrc.js +16 -0
- package/common/recommendedDependencies/common.js +5 -1
- package/common/recommendedDependencies/extension.js +2 -4
- package/common/recommendedDependencies/frontend.js +4 -5
- package/common/recommendedDependencies/nano.js +4 -5
- package/dist/index.js +1886 -1113
- package/package.json +12 -12
- package/src/constants/index.js +1 -0
- package/src/verifiers/currentNodeVersion/index.js +5 -1
- package/src/verifiers/eslint/constants.js +1 -1
- package/src/verifiers/prettier/constants.js +2 -0
- package/src/verifiers/prettier/index.js +4 -2
- package/src/verifiers/recommendedPackageVersions/index.js +5 -1
package/dist/index.js
CHANGED
|
@@ -811,6 +811,7 @@ function _curryN(length, received, fn) {
|
|
|
811
811
|
var argsIdx = 0;
|
|
812
812
|
var left = length;
|
|
813
813
|
var combinedIdx = 0;
|
|
814
|
+
var hasPlaceholder = false;
|
|
814
815
|
|
|
815
816
|
while (combinedIdx < received.length || argsIdx < arguments.length) {
|
|
816
817
|
var result;
|
|
@@ -826,12 +827,14 @@ function _curryN(length, received, fn) {
|
|
|
826
827
|
|
|
827
828
|
if (!_isPlaceholder(result)) {
|
|
828
829
|
left -= 1;
|
|
830
|
+
} else {
|
|
831
|
+
hasPlaceholder = true;
|
|
829
832
|
}
|
|
830
833
|
|
|
831
834
|
combinedIdx += 1;
|
|
832
835
|
}
|
|
833
836
|
|
|
834
|
-
return left <= 0 ? fn.apply(this, combined) : _arity(left, _curryN(length, combined, fn));
|
|
837
|
+
return !hasPlaceholder && left <= 0 ? fn.apply(this, combined) : _arity(Math.max(0, left), _curryN(length, combined, fn));
|
|
835
838
|
};
|
|
836
839
|
}
|
|
837
840
|
|
|
@@ -1062,18 +1065,20 @@ function _objectIs(a, b) {
|
|
|
1062
1065
|
|
|
1063
1066
|
var _objectIs$1 = typeof Object.is === 'function' ? Object.is : _objectIs;
|
|
1064
1067
|
|
|
1065
|
-
var toString$
|
|
1068
|
+
var toString$2 = Object.prototype.toString;
|
|
1066
1069
|
|
|
1067
1070
|
var _isArguments =
|
|
1068
1071
|
/*#__PURE__*/
|
|
1069
1072
|
function () {
|
|
1070
|
-
return toString$
|
|
1071
|
-
return toString$
|
|
1073
|
+
return toString$2.call(arguments) === '[object Arguments]' ? function _isArguments(x) {
|
|
1074
|
+
return toString$2.call(x) === '[object Arguments]';
|
|
1072
1075
|
} : function _isArguments(x) {
|
|
1073
1076
|
return _has('callee', x);
|
|
1074
1077
|
};
|
|
1075
1078
|
}();
|
|
1076
1079
|
|
|
1080
|
+
var _isArguments$1 = _isArguments;
|
|
1081
|
+
|
|
1077
1082
|
var hasEnumBug = !
|
|
1078
1083
|
/*#__PURE__*/
|
|
1079
1084
|
{
|
|
@@ -1135,7 +1140,7 @@ _curry1(function keys(obj) {
|
|
|
1135
1140
|
var prop, nIdx;
|
|
1136
1141
|
var ks = [];
|
|
1137
1142
|
|
|
1138
|
-
var checkArgsLength = hasArgsEnumBug && _isArguments(obj);
|
|
1143
|
+
var checkArgsLength = hasArgsEnumBug && _isArguments$1(obj);
|
|
1139
1144
|
|
|
1140
1145
|
for (prop in obj) {
|
|
1141
1146
|
if (_has(prop, obj) && (!checkArgsLength || prop !== 'length')) {
|
|
@@ -1159,6 +1164,7 @@ _curry1(function keys(obj) {
|
|
|
1159
1164
|
|
|
1160
1165
|
return ks;
|
|
1161
1166
|
});
|
|
1167
|
+
var keys$1 = keys;
|
|
1162
1168
|
|
|
1163
1169
|
/**
|
|
1164
1170
|
* Gives a single-word string description of the (native) type of a value,
|
|
@@ -1183,6 +1189,7 @@ _curry1(function keys(obj) {
|
|
|
1183
1189
|
* R.type([]); //=> "Array"
|
|
1184
1190
|
* R.type(/[A-z]/); //=> "RegExp"
|
|
1185
1191
|
* R.type(() => {}); //=> "Function"
|
|
1192
|
+
* R.type(async () => {}); //=> "AsyncFunction"
|
|
1186
1193
|
* R.type(undefined); //=> "Undefined"
|
|
1187
1194
|
*/
|
|
1188
1195
|
|
|
@@ -1192,6 +1199,8 @@ _curry1(function type(val) {
|
|
|
1192
1199
|
return val === null ? 'Null' : val === undefined ? 'Undefined' : Object.prototype.toString.call(val).slice(8, -1);
|
|
1193
1200
|
});
|
|
1194
1201
|
|
|
1202
|
+
var type$1 = type;
|
|
1203
|
+
|
|
1195
1204
|
/**
|
|
1196
1205
|
* private _uniqContentEquals function.
|
|
1197
1206
|
* That function is checking equality of 2 iterator contents with 2 assumptions
|
|
@@ -1223,9 +1232,9 @@ function _equals(a, b, stackA, stackB) {
|
|
|
1223
1232
|
return true;
|
|
1224
1233
|
}
|
|
1225
1234
|
|
|
1226
|
-
var typeA = type(a);
|
|
1235
|
+
var typeA = type$1(a);
|
|
1227
1236
|
|
|
1228
|
-
if (typeA !== type(b)) {
|
|
1237
|
+
if (typeA !== type$1(b)) {
|
|
1229
1238
|
return false;
|
|
1230
1239
|
}
|
|
1231
1240
|
|
|
@@ -1325,9 +1334,9 @@ function _equals(a, b, stackA, stackB) {
|
|
|
1325
1334
|
return false;
|
|
1326
1335
|
}
|
|
1327
1336
|
|
|
1328
|
-
var keysA = keys(a);
|
|
1337
|
+
var keysA = keys$1(a);
|
|
1329
1338
|
|
|
1330
|
-
if (keysA.length !== keys(b).length) {
|
|
1339
|
+
if (keysA.length !== keys$1(b).length) {
|
|
1331
1340
|
return false;
|
|
1332
1341
|
}
|
|
1333
1342
|
|
|
@@ -1380,6 +1389,8 @@ _curry2(function equals(a, b) {
|
|
|
1380
1389
|
return _equals(a, b, [], []);
|
|
1381
1390
|
});
|
|
1382
1391
|
|
|
1392
|
+
var equals$1 = equals;
|
|
1393
|
+
|
|
1383
1394
|
function _indexOf(list, a, idx) {
|
|
1384
1395
|
var inf, item; // Array.prototype.indexOf doesn't exist below IE9
|
|
1385
1396
|
|
|
@@ -1437,7 +1448,7 @@ function _indexOf(list, a, idx) {
|
|
|
1437
1448
|
|
|
1438
1449
|
|
|
1439
1450
|
while (idx < list.length) {
|
|
1440
|
-
if (equals(list[idx], a)) {
|
|
1451
|
+
if (equals$1(list[idx], a)) {
|
|
1441
1452
|
return idx;
|
|
1442
1453
|
}
|
|
1443
1454
|
|
|
@@ -1483,6 +1494,8 @@ var _toISOString = typeof Date.prototype.toISOString === 'function' ? function _
|
|
|
1483
1494
|
return d.getUTCFullYear() + '-' + pad(d.getUTCMonth() + 1) + '-' + pad(d.getUTCDate()) + 'T' + pad(d.getUTCHours()) + ':' + pad(d.getUTCMinutes()) + ':' + pad(d.getUTCSeconds()) + '.' + (d.getUTCMilliseconds() / 1000).toFixed(3).slice(2, 5) + 'Z';
|
|
1484
1495
|
};
|
|
1485
1496
|
|
|
1497
|
+
var _toISOString$1 = _toISOString;
|
|
1498
|
+
|
|
1486
1499
|
function _complement(f) {
|
|
1487
1500
|
return function () {
|
|
1488
1501
|
return !f.apply(this, arguments);
|
|
@@ -1585,10 +1598,12 @@ _dispatchable(['fantasy-land/filter', 'filter'], _xfilter, function (pred, filte
|
|
|
1585
1598
|
}
|
|
1586
1599
|
|
|
1587
1600
|
return acc;
|
|
1588
|
-
}, {}, keys(filterable)) : // else
|
|
1601
|
+
}, {}, keys$1(filterable)) : // else
|
|
1589
1602
|
_filter(pred, filterable);
|
|
1590
1603
|
}));
|
|
1591
1604
|
|
|
1605
|
+
var filter$1 = filter;
|
|
1606
|
+
|
|
1592
1607
|
/**
|
|
1593
1608
|
* The complement of [`filter`](#filter).
|
|
1594
1609
|
*
|
|
@@ -1617,9 +1632,11 @@ _dispatchable(['fantasy-land/filter', 'filter'], _xfilter, function (pred, filte
|
|
|
1617
1632
|
var reject =
|
|
1618
1633
|
/*#__PURE__*/
|
|
1619
1634
|
_curry2(function reject(pred, filterable) {
|
|
1620
|
-
return filter(_complement(pred), filterable);
|
|
1635
|
+
return filter$1(_complement(pred), filterable);
|
|
1621
1636
|
});
|
|
1622
1637
|
|
|
1638
|
+
var reject$1 = reject;
|
|
1639
|
+
|
|
1623
1640
|
function _toString(x, seen) {
|
|
1624
1641
|
var recur = function recur(y) {
|
|
1625
1642
|
var xs = seen.concat([x]);
|
|
@@ -1638,15 +1655,15 @@ function _toString(x, seen) {
|
|
|
1638
1655
|
return '(function() { return arguments; }(' + _map(recur, x).join(', ') + '))';
|
|
1639
1656
|
|
|
1640
1657
|
case '[object Array]':
|
|
1641
|
-
return '[' + _map(recur, x).concat(mapPairs(x, reject(function (k) {
|
|
1658
|
+
return '[' + _map(recur, x).concat(mapPairs(x, reject$1(function (k) {
|
|
1642
1659
|
return /^\d+$/.test(k);
|
|
1643
|
-
}, keys(x)))).join(', ') + ']';
|
|
1660
|
+
}, keys$1(x)))).join(', ') + ']';
|
|
1644
1661
|
|
|
1645
1662
|
case '[object Boolean]':
|
|
1646
1663
|
return typeof x === 'object' ? 'new Boolean(' + recur(x.valueOf()) + ')' : x.toString();
|
|
1647
1664
|
|
|
1648
1665
|
case '[object Date]':
|
|
1649
|
-
return 'new Date(' + (isNaN(x.valueOf()) ? recur(NaN) : _quote(_toISOString(x))) + ')';
|
|
1666
|
+
return 'new Date(' + (isNaN(x.valueOf()) ? recur(NaN) : _quote(_toISOString$1(x))) + ')';
|
|
1650
1667
|
|
|
1651
1668
|
case '[object Map]':
|
|
1652
1669
|
return 'new Map(' + recur(Array.from(x)) + ')';
|
|
@@ -1675,7 +1692,7 @@ function _toString(x, seen) {
|
|
|
1675
1692
|
}
|
|
1676
1693
|
}
|
|
1677
1694
|
|
|
1678
|
-
return '{' + mapPairs(x, keys(x)).join(', ') + '}';
|
|
1695
|
+
return '{' + mapPairs(x, keys$1(x)).join(', ') + '}';
|
|
1679
1696
|
}
|
|
1680
1697
|
}
|
|
1681
1698
|
|
|
@@ -1722,6 +1739,8 @@ _curry1(function toString(val) {
|
|
|
1722
1739
|
return _toString(val, []);
|
|
1723
1740
|
});
|
|
1724
1741
|
|
|
1742
|
+
var toString$1 = toString;
|
|
1743
|
+
|
|
1725
1744
|
var XMap =
|
|
1726
1745
|
/*#__PURE__*/
|
|
1727
1746
|
function () {
|
|
@@ -1746,6 +1765,8 @@ var _xmap = function _xmap(f) {
|
|
|
1746
1765
|
};
|
|
1747
1766
|
};
|
|
1748
1767
|
|
|
1768
|
+
var _xmap$1 = _xmap;
|
|
1769
|
+
|
|
1749
1770
|
/**
|
|
1750
1771
|
* Takes a function and
|
|
1751
1772
|
* a [functor](https://github.com/fantasyland/fantasy-land#functor),
|
|
@@ -1786,7 +1807,7 @@ var map =
|
|
|
1786
1807
|
/*#__PURE__*/
|
|
1787
1808
|
_curry2(
|
|
1788
1809
|
/*#__PURE__*/
|
|
1789
|
-
_dispatchable(['fantasy-land/map', 'map'], _xmap, function map(fn, functor) {
|
|
1810
|
+
_dispatchable(['fantasy-land/map', 'map'], _xmap$1, function map(fn, functor) {
|
|
1790
1811
|
switch (Object.prototype.toString.call(functor)) {
|
|
1791
1812
|
case '[object Function]':
|
|
1792
1813
|
return curryN$1(functor.length, function () {
|
|
@@ -1797,13 +1818,15 @@ _dispatchable(['fantasy-land/map', 'map'], _xmap, function map(fn, functor) {
|
|
|
1797
1818
|
return _arrayReduce(function (acc, key) {
|
|
1798
1819
|
acc[key] = fn(functor[key]);
|
|
1799
1820
|
return acc;
|
|
1800
|
-
}, {}, keys(functor));
|
|
1821
|
+
}, {}, keys$1(functor));
|
|
1801
1822
|
|
|
1802
1823
|
default:
|
|
1803
1824
|
return _map(fn, functor);
|
|
1804
1825
|
}
|
|
1805
1826
|
}));
|
|
1806
1827
|
|
|
1828
|
+
var map$1 = map;
|
|
1829
|
+
|
|
1807
1830
|
function _isString(x) {
|
|
1808
1831
|
return Object.prototype.toString.call(x) === '[object String]';
|
|
1809
1832
|
}
|
|
@@ -1893,10 +1916,12 @@ _curry1(function isArrayLike(x) {
|
|
|
1893
1916
|
return false;
|
|
1894
1917
|
});
|
|
1895
1918
|
|
|
1919
|
+
var _isArrayLike$1 = _isArrayLike;
|
|
1920
|
+
|
|
1896
1921
|
var symIterator = typeof Symbol !== 'undefined' ? Symbol.iterator : '@@iterator';
|
|
1897
1922
|
function _createReduce(arrayReduce, methodReduce, iterableReduce) {
|
|
1898
1923
|
return function _reduce(xf, acc, list) {
|
|
1899
|
-
if (_isArrayLike(list)) {
|
|
1924
|
+
if (_isArrayLike$1(list)) {
|
|
1900
1925
|
return arrayReduce(xf, acc, list);
|
|
1901
1926
|
}
|
|
1902
1927
|
|
|
@@ -1943,6 +1968,8 @@ var _reduce =
|
|
|
1943
1968
|
/*#__PURE__*/
|
|
1944
1969
|
_createReduce(_arrayReduce, _methodReduce, _iterableReduce);
|
|
1945
1970
|
|
|
1971
|
+
var _reduce$1 = _reduce;
|
|
1972
|
+
|
|
1946
1973
|
/**
|
|
1947
1974
|
* ap applies a list of functions to a list of values.
|
|
1948
1975
|
*
|
|
@@ -1975,11 +2002,13 @@ var ap =
|
|
|
1975
2002
|
_curry2(function ap(applyF, applyX) {
|
|
1976
2003
|
return typeof applyX['fantasy-land/ap'] === 'function' ? applyX['fantasy-land/ap'](applyF) : typeof applyF.ap === 'function' ? applyF.ap(applyX) : typeof applyF === 'function' ? function (x) {
|
|
1977
2004
|
return applyF(x)(applyX(x));
|
|
1978
|
-
} : _reduce(function (acc, f) {
|
|
1979
|
-
return _concat(acc, map(f, applyX));
|
|
2005
|
+
} : _reduce$1(function (acc, f) {
|
|
2006
|
+
return _concat(acc, map$1(f, applyX));
|
|
1980
2007
|
}, [], applyF);
|
|
1981
2008
|
});
|
|
1982
2009
|
|
|
2010
|
+
var ap$1 = ap;
|
|
2011
|
+
|
|
1983
2012
|
/**
|
|
1984
2013
|
* Checks if the input value is `null` or `undefined`.
|
|
1985
2014
|
*
|
|
@@ -2034,10 +2063,12 @@ var liftN =
|
|
|
2034
2063
|
_curry2(function liftN(arity, fn) {
|
|
2035
2064
|
var lifted = curryN$1(arity, fn);
|
|
2036
2065
|
return curryN$1(arity, function () {
|
|
2037
|
-
return _arrayReduce(ap, map(lifted, arguments[0]), Array.prototype.slice.call(arguments, 1));
|
|
2066
|
+
return _arrayReduce(ap$1, map$1(lifted, arguments[0]), Array.prototype.slice.call(arguments, 1));
|
|
2038
2067
|
});
|
|
2039
2068
|
});
|
|
2040
2069
|
|
|
2070
|
+
var liftN$1 = liftN;
|
|
2071
|
+
|
|
2041
2072
|
/**
|
|
2042
2073
|
* "lifts" a function of arity >= 1 so that it may "map over" a list, Function or other
|
|
2043
2074
|
* object that satisfies the [FantasyLand Apply spec](https://github.com/fantasyland/fantasy-land#apply).
|
|
@@ -2064,7 +2095,7 @@ _curry2(function liftN(arity, fn) {
|
|
|
2064
2095
|
var lift =
|
|
2065
2096
|
/*#__PURE__*/
|
|
2066
2097
|
_curry1(function lift(fn) {
|
|
2067
|
-
return liftN(fn.length, fn);
|
|
2098
|
+
return liftN$1(fn.length, fn);
|
|
2068
2099
|
});
|
|
2069
2100
|
|
|
2070
2101
|
var lift$1 = lift;
|
|
@@ -2095,6 +2126,8 @@ _curry1(function not(a) {
|
|
|
2095
2126
|
return !a;
|
|
2096
2127
|
});
|
|
2097
2128
|
|
|
2129
|
+
var not$1 = not;
|
|
2130
|
+
|
|
2098
2131
|
/**
|
|
2099
2132
|
* Takes a function `f` and returns a function `g` such that if called with the same arguments
|
|
2100
2133
|
* when `f` returns a "truthy" value, `g` returns `false` and when `f` returns a "falsy" value `g` returns `true`.
|
|
@@ -2120,7 +2153,7 @@ _curry1(function not(a) {
|
|
|
2120
2153
|
|
|
2121
2154
|
var complement =
|
|
2122
2155
|
/*#__PURE__*/
|
|
2123
|
-
lift$1(not);
|
|
2156
|
+
lift$1(not$1);
|
|
2124
2157
|
var complement$1 = complement;
|
|
2125
2158
|
|
|
2126
2159
|
function _identity(x) {
|
|
@@ -2178,23 +2211,7 @@ var identity$1 = identity;
|
|
|
2178
2211
|
* - `g(_, 2)(_, 3)(1)`
|
|
2179
2212
|
*
|
|
2180
2213
|
* Please note that default parameters don't count towards a [function arity](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/length)
|
|
2181
|
-
* and therefore `curry` won't work well with those
|
|
2182
|
-
*
|
|
2183
|
-
* ```
|
|
2184
|
-
* const h = R.curry((a, b, c = 2) => a + b + c);
|
|
2185
|
-
*
|
|
2186
|
-
* h(40);
|
|
2187
|
-
* //=> function (waits for `b`)
|
|
2188
|
-
*
|
|
2189
|
-
* h(39)(1);
|
|
2190
|
-
* //=> 42
|
|
2191
|
-
*
|
|
2192
|
-
* h(1)(2, 3);
|
|
2193
|
-
* //=> 6
|
|
2194
|
-
*
|
|
2195
|
-
* h(1)(2)(7);
|
|
2196
|
-
* //=> Error! (`3` is not a function!)
|
|
2197
|
-
* ```
|
|
2214
|
+
* and therefore `curry` won't work well with those.
|
|
2198
2215
|
*
|
|
2199
2216
|
* @func
|
|
2200
2217
|
* @memberOf R
|
|
@@ -2207,11 +2224,14 @@ var identity$1 = identity;
|
|
|
2207
2224
|
* @example
|
|
2208
2225
|
*
|
|
2209
2226
|
* const addFourNumbers = (a, b, c, d) => a + b + c + d;
|
|
2210
|
-
*
|
|
2211
2227
|
* const curriedAddFourNumbers = R.curry(addFourNumbers);
|
|
2212
2228
|
* const f = curriedAddFourNumbers(1, 2);
|
|
2213
2229
|
* const g = f(3);
|
|
2214
2230
|
* g(4); //=> 10
|
|
2231
|
+
*
|
|
2232
|
+
* // R.curry not working well with default parameters
|
|
2233
|
+
* const h = R.curry((a, b, c = 2) => a + b + c);
|
|
2234
|
+
* h(1)(2)(7); //=> Error! (`3` is not a function!)
|
|
2215
2235
|
*/
|
|
2216
2236
|
|
|
2217
2237
|
var curry =
|
|
@@ -2296,12 +2316,14 @@ function _isTypedArray(val) {
|
|
|
2296
2316
|
var empty =
|
|
2297
2317
|
/*#__PURE__*/
|
|
2298
2318
|
_curry1(function empty(x) {
|
|
2299
|
-
return x != null && typeof x['fantasy-land/empty'] === 'function' ? x['fantasy-land/empty']() : x != null && x.constructor != null && typeof x.constructor['fantasy-land/empty'] === 'function' ? x.constructor['fantasy-land/empty']() : x != null && typeof x.empty === 'function' ? x.empty() : x != null && x.constructor != null && typeof x.constructor.empty === 'function' ? x.constructor.empty() : _isArray(x) ? [] : _isString(x) ? '' : _isObject(x) ? {} : _isArguments(x) ? function () {
|
|
2319
|
+
return x != null && typeof x['fantasy-land/empty'] === 'function' ? x['fantasy-land/empty']() : x != null && x.constructor != null && typeof x.constructor['fantasy-land/empty'] === 'function' ? x.constructor['fantasy-land/empty']() : x != null && typeof x.empty === 'function' ? x.empty() : x != null && x.constructor != null && typeof x.constructor.empty === 'function' ? x.constructor.empty() : _isArray(x) ? [] : _isString(x) ? '' : _isObject(x) ? {} : _isArguments$1(x) ? function () {
|
|
2300
2320
|
return arguments;
|
|
2301
2321
|
}() : _isTypedArray(x) ? x.constructor.from('') : void 0 // else
|
|
2302
2322
|
;
|
|
2303
2323
|
});
|
|
2304
2324
|
|
|
2325
|
+
var empty$1 = empty;
|
|
2326
|
+
|
|
2305
2327
|
/**
|
|
2306
2328
|
* Reports whether two objects have the same value, in [`R.equals`](#equals)
|
|
2307
2329
|
* terms, for the specified property. Useful as a curried predicate.
|
|
@@ -2327,7 +2349,7 @@ _curry1(function empty(x) {
|
|
|
2327
2349
|
var eqProps =
|
|
2328
2350
|
/*#__PURE__*/
|
|
2329
2351
|
_curry3(function eqProps(prop, obj1, obj2) {
|
|
2330
|
-
return equals(obj1[prop], obj2[prop]);
|
|
2352
|
+
return equals$1(obj1[prop], obj2[prop]);
|
|
2331
2353
|
});
|
|
2332
2354
|
|
|
2333
2355
|
var eqProps$1 = eqProps;
|
|
@@ -2449,7 +2471,7 @@ _curry2(function invoker(arity, method) {
|
|
|
2449
2471
|
return target[method].apply(target, Array.prototype.slice.call(arguments, 0, arity));
|
|
2450
2472
|
}
|
|
2451
2473
|
|
|
2452
|
-
throw new TypeError(toString(target) + ' does not have a method named "' + method + '"');
|
|
2474
|
+
throw new TypeError(toString$1(target) + ' does not have a method named "' + method + '"');
|
|
2453
2475
|
});
|
|
2454
2476
|
});
|
|
2455
2477
|
|
|
@@ -2480,13 +2502,13 @@ var invoker$1 = invoker;
|
|
|
2480
2502
|
* R.is(Number, {}); //=> false
|
|
2481
2503
|
*/
|
|
2482
2504
|
|
|
2483
|
-
var is =
|
|
2505
|
+
var is$1 =
|
|
2484
2506
|
/*#__PURE__*/
|
|
2485
2507
|
_curry2(function is(Ctor, val) {
|
|
2486
2508
|
return val instanceof Ctor || val != null && (val.constructor === Ctor || Ctor.name === 'Object' && typeof val === 'object');
|
|
2487
2509
|
});
|
|
2488
2510
|
|
|
2489
|
-
var is$
|
|
2511
|
+
var is$2 = is$1;
|
|
2490
2512
|
|
|
2491
2513
|
/**
|
|
2492
2514
|
* Returns `true` if the given value is its type's empty value; `false`
|
|
@@ -2514,7 +2536,7 @@ var is$1 = is;
|
|
|
2514
2536
|
var isEmpty =
|
|
2515
2537
|
/*#__PURE__*/
|
|
2516
2538
|
_curry1(function isEmpty(x) {
|
|
2517
|
-
return x != null && equals(x, empty(x));
|
|
2539
|
+
return x != null && equals$1(x, empty$1(x));
|
|
2518
2540
|
});
|
|
2519
2541
|
|
|
2520
2542
|
var isEmpty$1 = isEmpty;
|
|
@@ -2547,7 +2569,7 @@ _curry2(function mapObjIndexed(fn, obj) {
|
|
|
2547
2569
|
return _arrayReduce(function (acc, key) {
|
|
2548
2570
|
acc[key] = fn(obj[key], key, obj);
|
|
2549
2571
|
return acc;
|
|
2550
|
-
}, {}, keys(obj));
|
|
2572
|
+
}, {}, keys$1(obj));
|
|
2551
2573
|
});
|
|
2552
2574
|
|
|
2553
2575
|
var mapObjIndexed$1 = mapObjIndexed;
|
|
@@ -2601,6 +2623,8 @@ _curry3(function mergeWithKey(fn, l, r) {
|
|
|
2601
2623
|
return result;
|
|
2602
2624
|
});
|
|
2603
2625
|
|
|
2626
|
+
var mergeWithKey$1 = mergeWithKey;
|
|
2627
|
+
|
|
2604
2628
|
/**
|
|
2605
2629
|
* Creates a new object with the own properties of the two provided objects.
|
|
2606
2630
|
* If a key exists in both objects:
|
|
@@ -2633,7 +2657,7 @@ _curry3(function mergeWithKey(fn, l, r) {
|
|
|
2633
2657
|
var mergeDeepWithKey =
|
|
2634
2658
|
/*#__PURE__*/
|
|
2635
2659
|
_curry3(function mergeDeepWithKey(fn, lObj, rObj) {
|
|
2636
|
-
return mergeWithKey(function (k, lVal, rVal) {
|
|
2660
|
+
return mergeWithKey$1(function (k, lVal, rVal) {
|
|
2637
2661
|
if (_isObject(lVal) && _isObject(rVal)) {
|
|
2638
2662
|
return mergeDeepWithKey(fn, lVal, rVal);
|
|
2639
2663
|
} else {
|
|
@@ -2642,6 +2666,8 @@ _curry3(function mergeDeepWithKey(fn, lObj, rObj) {
|
|
|
2642
2666
|
}, lObj, rObj);
|
|
2643
2667
|
});
|
|
2644
2668
|
|
|
2669
|
+
var mergeDeepWithKey$1 = mergeDeepWithKey;
|
|
2670
|
+
|
|
2645
2671
|
/**
|
|
2646
2672
|
* Creates a new object with the own properties of the first object merged with
|
|
2647
2673
|
* the own properties of the second object. If a key exists in both objects:
|
|
@@ -2667,7 +2693,7 @@ _curry3(function mergeDeepWithKey(fn, lObj, rObj) {
|
|
|
2667
2693
|
var mergeDeepRight =
|
|
2668
2694
|
/*#__PURE__*/
|
|
2669
2695
|
_curry2(function mergeDeepRight(lObj, rObj) {
|
|
2670
|
-
return mergeDeepWithKey(function (k, lVal, rVal) {
|
|
2696
|
+
return mergeDeepWithKey$1(function (k, lVal, rVal) {
|
|
2671
2697
|
return rVal;
|
|
2672
2698
|
}, lObj, rObj);
|
|
2673
2699
|
});
|
|
@@ -2837,6 +2863,708 @@ function _typeof(obj) {
|
|
|
2837
2863
|
}, _typeof(obj);
|
|
2838
2864
|
}
|
|
2839
2865
|
|
|
2866
|
+
// src/utils/env.ts
|
|
2867
|
+
var NOTHING = Symbol.for("immer-nothing");
|
|
2868
|
+
var DRAFTABLE = Symbol.for("immer-draftable");
|
|
2869
|
+
var DRAFT_STATE = Symbol.for("immer-state");
|
|
2870
|
+
|
|
2871
|
+
// src/utils/errors.ts
|
|
2872
|
+
var errors$1 = process.env.NODE_ENV !== "production" ? [
|
|
2873
|
+
// All error codes, starting by 0:
|
|
2874
|
+
function(plugin) {
|
|
2875
|
+
return `The plugin for '${plugin}' has not been loaded into Immer. To enable the plugin, import and call \`enable${plugin}()\` when initializing your application.`;
|
|
2876
|
+
},
|
|
2877
|
+
function(thing) {
|
|
2878
|
+
return `produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${thing}'`;
|
|
2879
|
+
},
|
|
2880
|
+
"This object has been frozen and should not be mutated",
|
|
2881
|
+
function(data) {
|
|
2882
|
+
return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? " + data;
|
|
2883
|
+
},
|
|
2884
|
+
"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",
|
|
2885
|
+
"Immer forbids circular references",
|
|
2886
|
+
"The first or second argument to `produce` must be a function",
|
|
2887
|
+
"The third argument to `produce` must be a function or undefined",
|
|
2888
|
+
"First argument to `createDraft` must be a plain object, an array, or an immerable object",
|
|
2889
|
+
"First argument to `finishDraft` must be a draft returned by `createDraft`",
|
|
2890
|
+
function(thing) {
|
|
2891
|
+
return `'current' expects a draft, got: ${thing}`;
|
|
2892
|
+
},
|
|
2893
|
+
"Object.defineProperty() cannot be used on an Immer draft",
|
|
2894
|
+
"Object.setPrototypeOf() cannot be used on an Immer draft",
|
|
2895
|
+
"Immer only supports deleting array indices",
|
|
2896
|
+
"Immer only supports setting array indices and the 'length' property",
|
|
2897
|
+
function(thing) {
|
|
2898
|
+
return `'original' expects a draft, got: ${thing}`;
|
|
2899
|
+
}
|
|
2900
|
+
// Note: if more errors are added, the errorOffset in Patches.ts should be increased
|
|
2901
|
+
// See Patches.ts for additional errors
|
|
2902
|
+
] : [];
|
|
2903
|
+
function die(error, ...args) {
|
|
2904
|
+
if (process.env.NODE_ENV !== "production") {
|
|
2905
|
+
const e = errors$1[error];
|
|
2906
|
+
const msg = typeof e === "function" ? e.apply(null, args) : e;
|
|
2907
|
+
throw new Error(`[Immer] ${msg}`);
|
|
2908
|
+
}
|
|
2909
|
+
throw new Error(
|
|
2910
|
+
`[Immer] minified error nr: ${error}. Full error at: https://bit.ly/3cXEKWf`
|
|
2911
|
+
);
|
|
2912
|
+
}
|
|
2913
|
+
|
|
2914
|
+
// src/utils/common.ts
|
|
2915
|
+
var getPrototypeOf = Object.getPrototypeOf;
|
|
2916
|
+
function isDraft(value) {
|
|
2917
|
+
return !!value && !!value[DRAFT_STATE];
|
|
2918
|
+
}
|
|
2919
|
+
function isDraftable(value) {
|
|
2920
|
+
if (!value)
|
|
2921
|
+
return false;
|
|
2922
|
+
return isPlainObject(value) || Array.isArray(value) || !!value[DRAFTABLE] || !!value.constructor?.[DRAFTABLE] || isMap(value) || isSet(value);
|
|
2923
|
+
}
|
|
2924
|
+
var objectCtorString = Object.prototype.constructor.toString();
|
|
2925
|
+
function isPlainObject(value) {
|
|
2926
|
+
if (!value || typeof value !== "object")
|
|
2927
|
+
return false;
|
|
2928
|
+
const proto = getPrototypeOf(value);
|
|
2929
|
+
if (proto === null) {
|
|
2930
|
+
return true;
|
|
2931
|
+
}
|
|
2932
|
+
const Ctor = Object.hasOwnProperty.call(proto, "constructor") && proto.constructor;
|
|
2933
|
+
if (Ctor === Object)
|
|
2934
|
+
return true;
|
|
2935
|
+
return typeof Ctor == "function" && Function.toString.call(Ctor) === objectCtorString;
|
|
2936
|
+
}
|
|
2937
|
+
function each(obj, iter) {
|
|
2938
|
+
if (getArchtype(obj) === 0 /* Object */) {
|
|
2939
|
+
Object.entries(obj).forEach(([key, value]) => {
|
|
2940
|
+
iter(key, value, obj);
|
|
2941
|
+
});
|
|
2942
|
+
} else {
|
|
2943
|
+
obj.forEach((entry, index) => iter(index, entry, obj));
|
|
2944
|
+
}
|
|
2945
|
+
}
|
|
2946
|
+
function getArchtype(thing) {
|
|
2947
|
+
const state = thing[DRAFT_STATE];
|
|
2948
|
+
return state ? state.type_ : Array.isArray(thing) ? 1 /* Array */ : isMap(thing) ? 2 /* Map */ : isSet(thing) ? 3 /* Set */ : 0 /* Object */;
|
|
2949
|
+
}
|
|
2950
|
+
function has(thing, prop) {
|
|
2951
|
+
return getArchtype(thing) === 2 /* Map */ ? thing.has(prop) : Object.prototype.hasOwnProperty.call(thing, prop);
|
|
2952
|
+
}
|
|
2953
|
+
function set(thing, propOrOldValue, value) {
|
|
2954
|
+
const t = getArchtype(thing);
|
|
2955
|
+
if (t === 2 /* Map */)
|
|
2956
|
+
thing.set(propOrOldValue, value);
|
|
2957
|
+
else if (t === 3 /* Set */) {
|
|
2958
|
+
thing.add(value);
|
|
2959
|
+
} else
|
|
2960
|
+
thing[propOrOldValue] = value;
|
|
2961
|
+
}
|
|
2962
|
+
function is(x, y) {
|
|
2963
|
+
if (x === y) {
|
|
2964
|
+
return x !== 0 || 1 / x === 1 / y;
|
|
2965
|
+
} else {
|
|
2966
|
+
return x !== x && y !== y;
|
|
2967
|
+
}
|
|
2968
|
+
}
|
|
2969
|
+
function isMap(target) {
|
|
2970
|
+
return target instanceof Map;
|
|
2971
|
+
}
|
|
2972
|
+
function isSet(target) {
|
|
2973
|
+
return target instanceof Set;
|
|
2974
|
+
}
|
|
2975
|
+
function latest(state) {
|
|
2976
|
+
return state.copy_ || state.base_;
|
|
2977
|
+
}
|
|
2978
|
+
function shallowCopy(base, strict) {
|
|
2979
|
+
if (isMap(base)) {
|
|
2980
|
+
return new Map(base);
|
|
2981
|
+
}
|
|
2982
|
+
if (isSet(base)) {
|
|
2983
|
+
return new Set(base);
|
|
2984
|
+
}
|
|
2985
|
+
if (Array.isArray(base))
|
|
2986
|
+
return Array.prototype.slice.call(base);
|
|
2987
|
+
if (!strict && isPlainObject(base)) {
|
|
2988
|
+
if (!getPrototypeOf(base)) {
|
|
2989
|
+
const obj = /* @__PURE__ */ Object.create(null);
|
|
2990
|
+
return Object.assign(obj, base);
|
|
2991
|
+
}
|
|
2992
|
+
return { ...base };
|
|
2993
|
+
}
|
|
2994
|
+
const descriptors = Object.getOwnPropertyDescriptors(base);
|
|
2995
|
+
delete descriptors[DRAFT_STATE];
|
|
2996
|
+
let keys = Reflect.ownKeys(descriptors);
|
|
2997
|
+
for (let i = 0; i < keys.length; i++) {
|
|
2998
|
+
const key = keys[i];
|
|
2999
|
+
const desc = descriptors[key];
|
|
3000
|
+
if (desc.writable === false) {
|
|
3001
|
+
desc.writable = true;
|
|
3002
|
+
desc.configurable = true;
|
|
3003
|
+
}
|
|
3004
|
+
if (desc.get || desc.set)
|
|
3005
|
+
descriptors[key] = {
|
|
3006
|
+
configurable: true,
|
|
3007
|
+
writable: true,
|
|
3008
|
+
// could live with !!desc.set as well here...
|
|
3009
|
+
enumerable: desc.enumerable,
|
|
3010
|
+
value: base[key]
|
|
3011
|
+
};
|
|
3012
|
+
}
|
|
3013
|
+
return Object.create(getPrototypeOf(base), descriptors);
|
|
3014
|
+
}
|
|
3015
|
+
function freeze(obj, deep = false) {
|
|
3016
|
+
if (isFrozen(obj) || isDraft(obj) || !isDraftable(obj))
|
|
3017
|
+
return obj;
|
|
3018
|
+
if (getArchtype(obj) > 1) {
|
|
3019
|
+
obj.set = obj.add = obj.clear = obj.delete = dontMutateFrozenCollections;
|
|
3020
|
+
}
|
|
3021
|
+
Object.freeze(obj);
|
|
3022
|
+
if (deep)
|
|
3023
|
+
each(obj, (_key, value) => freeze(value, true));
|
|
3024
|
+
return obj;
|
|
3025
|
+
}
|
|
3026
|
+
function dontMutateFrozenCollections() {
|
|
3027
|
+
die(2);
|
|
3028
|
+
}
|
|
3029
|
+
function isFrozen(obj) {
|
|
3030
|
+
return Object.isFrozen(obj);
|
|
3031
|
+
}
|
|
3032
|
+
|
|
3033
|
+
// src/utils/plugins.ts
|
|
3034
|
+
var plugins = {};
|
|
3035
|
+
function getPlugin(pluginKey) {
|
|
3036
|
+
const plugin = plugins[pluginKey];
|
|
3037
|
+
if (!plugin) {
|
|
3038
|
+
die(0, pluginKey);
|
|
3039
|
+
}
|
|
3040
|
+
return plugin;
|
|
3041
|
+
}
|
|
3042
|
+
|
|
3043
|
+
// src/core/scope.ts
|
|
3044
|
+
var currentScope;
|
|
3045
|
+
function getCurrentScope() {
|
|
3046
|
+
return currentScope;
|
|
3047
|
+
}
|
|
3048
|
+
function createScope(parent_, immer_) {
|
|
3049
|
+
return {
|
|
3050
|
+
drafts_: [],
|
|
3051
|
+
parent_,
|
|
3052
|
+
immer_,
|
|
3053
|
+
// Whenever the modified draft contains a draft from another scope, we
|
|
3054
|
+
// need to prevent auto-freezing so the unowned draft can be finalized.
|
|
3055
|
+
canAutoFreeze_: true,
|
|
3056
|
+
unfinalizedDrafts_: 0
|
|
3057
|
+
};
|
|
3058
|
+
}
|
|
3059
|
+
function usePatchesInScope(scope, patchListener) {
|
|
3060
|
+
if (patchListener) {
|
|
3061
|
+
getPlugin("Patches");
|
|
3062
|
+
scope.patches_ = [];
|
|
3063
|
+
scope.inversePatches_ = [];
|
|
3064
|
+
scope.patchListener_ = patchListener;
|
|
3065
|
+
}
|
|
3066
|
+
}
|
|
3067
|
+
function revokeScope(scope) {
|
|
3068
|
+
leaveScope(scope);
|
|
3069
|
+
scope.drafts_.forEach(revokeDraft);
|
|
3070
|
+
scope.drafts_ = null;
|
|
3071
|
+
}
|
|
3072
|
+
function leaveScope(scope) {
|
|
3073
|
+
if (scope === currentScope) {
|
|
3074
|
+
currentScope = scope.parent_;
|
|
3075
|
+
}
|
|
3076
|
+
}
|
|
3077
|
+
function enterScope(immer2) {
|
|
3078
|
+
return currentScope = createScope(currentScope, immer2);
|
|
3079
|
+
}
|
|
3080
|
+
function revokeDraft(draft) {
|
|
3081
|
+
const state = draft[DRAFT_STATE];
|
|
3082
|
+
if (state.type_ === 0 /* Object */ || state.type_ === 1 /* Array */)
|
|
3083
|
+
state.revoke_();
|
|
3084
|
+
else
|
|
3085
|
+
state.revoked_ = true;
|
|
3086
|
+
}
|
|
3087
|
+
|
|
3088
|
+
// src/core/finalize.ts
|
|
3089
|
+
function processResult(result, scope) {
|
|
3090
|
+
scope.unfinalizedDrafts_ = scope.drafts_.length;
|
|
3091
|
+
const baseDraft = scope.drafts_[0];
|
|
3092
|
+
const isReplaced = result !== void 0 && result !== baseDraft;
|
|
3093
|
+
if (isReplaced) {
|
|
3094
|
+
if (baseDraft[DRAFT_STATE].modified_) {
|
|
3095
|
+
revokeScope(scope);
|
|
3096
|
+
die(4);
|
|
3097
|
+
}
|
|
3098
|
+
if (isDraftable(result)) {
|
|
3099
|
+
result = finalize(scope, result);
|
|
3100
|
+
if (!scope.parent_)
|
|
3101
|
+
maybeFreeze(scope, result);
|
|
3102
|
+
}
|
|
3103
|
+
if (scope.patches_) {
|
|
3104
|
+
getPlugin("Patches").generateReplacementPatches_(
|
|
3105
|
+
baseDraft[DRAFT_STATE].base_,
|
|
3106
|
+
result,
|
|
3107
|
+
scope.patches_,
|
|
3108
|
+
scope.inversePatches_
|
|
3109
|
+
);
|
|
3110
|
+
}
|
|
3111
|
+
} else {
|
|
3112
|
+
result = finalize(scope, baseDraft, []);
|
|
3113
|
+
}
|
|
3114
|
+
revokeScope(scope);
|
|
3115
|
+
if (scope.patches_) {
|
|
3116
|
+
scope.patchListener_(scope.patches_, scope.inversePatches_);
|
|
3117
|
+
}
|
|
3118
|
+
return result !== NOTHING ? result : void 0;
|
|
3119
|
+
}
|
|
3120
|
+
function finalize(rootScope, value, path) {
|
|
3121
|
+
if (isFrozen(value))
|
|
3122
|
+
return value;
|
|
3123
|
+
const state = value[DRAFT_STATE];
|
|
3124
|
+
if (!state) {
|
|
3125
|
+
each(
|
|
3126
|
+
value,
|
|
3127
|
+
(key, childValue) => finalizeProperty(rootScope, state, value, key, childValue, path));
|
|
3128
|
+
return value;
|
|
3129
|
+
}
|
|
3130
|
+
if (state.scope_ !== rootScope)
|
|
3131
|
+
return value;
|
|
3132
|
+
if (!state.modified_) {
|
|
3133
|
+
maybeFreeze(rootScope, state.base_, true);
|
|
3134
|
+
return state.base_;
|
|
3135
|
+
}
|
|
3136
|
+
if (!state.finalized_) {
|
|
3137
|
+
state.finalized_ = true;
|
|
3138
|
+
state.scope_.unfinalizedDrafts_--;
|
|
3139
|
+
const result = state.copy_;
|
|
3140
|
+
let resultEach = result;
|
|
3141
|
+
let isSet2 = false;
|
|
3142
|
+
if (state.type_ === 3 /* Set */) {
|
|
3143
|
+
resultEach = new Set(result);
|
|
3144
|
+
result.clear();
|
|
3145
|
+
isSet2 = true;
|
|
3146
|
+
}
|
|
3147
|
+
each(
|
|
3148
|
+
resultEach,
|
|
3149
|
+
(key, childValue) => finalizeProperty(rootScope, state, result, key, childValue, path, isSet2)
|
|
3150
|
+
);
|
|
3151
|
+
maybeFreeze(rootScope, result, false);
|
|
3152
|
+
if (path && rootScope.patches_) {
|
|
3153
|
+
getPlugin("Patches").generatePatches_(
|
|
3154
|
+
state,
|
|
3155
|
+
path,
|
|
3156
|
+
rootScope.patches_,
|
|
3157
|
+
rootScope.inversePatches_
|
|
3158
|
+
);
|
|
3159
|
+
}
|
|
3160
|
+
}
|
|
3161
|
+
return state.copy_;
|
|
3162
|
+
}
|
|
3163
|
+
function finalizeProperty(rootScope, parentState, targetObject, prop, childValue, rootPath, targetIsSet) {
|
|
3164
|
+
if (process.env.NODE_ENV !== "production" && childValue === targetObject)
|
|
3165
|
+
die(5);
|
|
3166
|
+
if (isDraft(childValue)) {
|
|
3167
|
+
const path = rootPath && parentState && parentState.type_ !== 3 /* Set */ && // Set objects are atomic since they have no keys.
|
|
3168
|
+
!has(parentState.assigned_, prop) ? rootPath.concat(prop) : void 0;
|
|
3169
|
+
const res = finalize(rootScope, childValue, path);
|
|
3170
|
+
set(targetObject, prop, res);
|
|
3171
|
+
if (isDraft(res)) {
|
|
3172
|
+
rootScope.canAutoFreeze_ = false;
|
|
3173
|
+
} else
|
|
3174
|
+
return;
|
|
3175
|
+
} else if (targetIsSet) {
|
|
3176
|
+
targetObject.add(childValue);
|
|
3177
|
+
}
|
|
3178
|
+
if (isDraftable(childValue) && !isFrozen(childValue)) {
|
|
3179
|
+
if (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) {
|
|
3180
|
+
return;
|
|
3181
|
+
}
|
|
3182
|
+
finalize(rootScope, childValue);
|
|
3183
|
+
if (!parentState || !parentState.scope_.parent_)
|
|
3184
|
+
maybeFreeze(rootScope, childValue);
|
|
3185
|
+
}
|
|
3186
|
+
}
|
|
3187
|
+
function maybeFreeze(scope, value, deep = false) {
|
|
3188
|
+
if (!scope.parent_ && scope.immer_.autoFreeze_ && scope.canAutoFreeze_) {
|
|
3189
|
+
freeze(value, deep);
|
|
3190
|
+
}
|
|
3191
|
+
}
|
|
3192
|
+
|
|
3193
|
+
// src/core/proxy.ts
|
|
3194
|
+
function createProxyProxy(base, parent) {
|
|
3195
|
+
const isArray = Array.isArray(base);
|
|
3196
|
+
const state = {
|
|
3197
|
+
type_: isArray ? 1 /* Array */ : 0 /* Object */,
|
|
3198
|
+
// Track which produce call this is associated with.
|
|
3199
|
+
scope_: parent ? parent.scope_ : getCurrentScope(),
|
|
3200
|
+
// True for both shallow and deep changes.
|
|
3201
|
+
modified_: false,
|
|
3202
|
+
// Used during finalization.
|
|
3203
|
+
finalized_: false,
|
|
3204
|
+
// Track which properties have been assigned (true) or deleted (false).
|
|
3205
|
+
assigned_: {},
|
|
3206
|
+
// The parent draft state.
|
|
3207
|
+
parent_: parent,
|
|
3208
|
+
// The base state.
|
|
3209
|
+
base_: base,
|
|
3210
|
+
// The base proxy.
|
|
3211
|
+
draft_: null,
|
|
3212
|
+
// set below
|
|
3213
|
+
// The base copy with any updated values.
|
|
3214
|
+
copy_: null,
|
|
3215
|
+
// Called by the `produce` function.
|
|
3216
|
+
revoke_: null,
|
|
3217
|
+
isManual_: false
|
|
3218
|
+
};
|
|
3219
|
+
let target = state;
|
|
3220
|
+
let traps = objectTraps;
|
|
3221
|
+
if (isArray) {
|
|
3222
|
+
target = [state];
|
|
3223
|
+
traps = arrayTraps;
|
|
3224
|
+
}
|
|
3225
|
+
const { revoke, proxy } = Proxy.revocable(target, traps);
|
|
3226
|
+
state.draft_ = proxy;
|
|
3227
|
+
state.revoke_ = revoke;
|
|
3228
|
+
return proxy;
|
|
3229
|
+
}
|
|
3230
|
+
var objectTraps = {
|
|
3231
|
+
get(state, prop) {
|
|
3232
|
+
if (prop === DRAFT_STATE)
|
|
3233
|
+
return state;
|
|
3234
|
+
const source = latest(state);
|
|
3235
|
+
if (!has(source, prop)) {
|
|
3236
|
+
return readPropFromProto(state, source, prop);
|
|
3237
|
+
}
|
|
3238
|
+
const value = source[prop];
|
|
3239
|
+
if (state.finalized_ || !isDraftable(value)) {
|
|
3240
|
+
return value;
|
|
3241
|
+
}
|
|
3242
|
+
if (value === peek(state.base_, prop)) {
|
|
3243
|
+
prepareCopy(state);
|
|
3244
|
+
return state.copy_[prop] = createProxy(value, state);
|
|
3245
|
+
}
|
|
3246
|
+
return value;
|
|
3247
|
+
},
|
|
3248
|
+
has(state, prop) {
|
|
3249
|
+
return prop in latest(state);
|
|
3250
|
+
},
|
|
3251
|
+
ownKeys(state) {
|
|
3252
|
+
return Reflect.ownKeys(latest(state));
|
|
3253
|
+
},
|
|
3254
|
+
set(state, prop, value) {
|
|
3255
|
+
const desc = getDescriptorFromProto(latest(state), prop);
|
|
3256
|
+
if (desc?.set) {
|
|
3257
|
+
desc.set.call(state.draft_, value);
|
|
3258
|
+
return true;
|
|
3259
|
+
}
|
|
3260
|
+
if (!state.modified_) {
|
|
3261
|
+
const current2 = peek(latest(state), prop);
|
|
3262
|
+
const currentState = current2?.[DRAFT_STATE];
|
|
3263
|
+
if (currentState && currentState.base_ === value) {
|
|
3264
|
+
state.copy_[prop] = value;
|
|
3265
|
+
state.assigned_[prop] = false;
|
|
3266
|
+
return true;
|
|
3267
|
+
}
|
|
3268
|
+
if (is(value, current2) && (value !== void 0 || has(state.base_, prop)))
|
|
3269
|
+
return true;
|
|
3270
|
+
prepareCopy(state);
|
|
3271
|
+
markChanged(state);
|
|
3272
|
+
}
|
|
3273
|
+
if (state.copy_[prop] === value && // special case: handle new props with value 'undefined'
|
|
3274
|
+
(value !== void 0 || prop in state.copy_) || // special case: NaN
|
|
3275
|
+
Number.isNaN(value) && Number.isNaN(state.copy_[prop]))
|
|
3276
|
+
return true;
|
|
3277
|
+
state.copy_[prop] = value;
|
|
3278
|
+
state.assigned_[prop] = true;
|
|
3279
|
+
return true;
|
|
3280
|
+
},
|
|
3281
|
+
deleteProperty(state, prop) {
|
|
3282
|
+
if (peek(state.base_, prop) !== void 0 || prop in state.base_) {
|
|
3283
|
+
state.assigned_[prop] = false;
|
|
3284
|
+
prepareCopy(state);
|
|
3285
|
+
markChanged(state);
|
|
3286
|
+
} else {
|
|
3287
|
+
delete state.assigned_[prop];
|
|
3288
|
+
}
|
|
3289
|
+
if (state.copy_) {
|
|
3290
|
+
delete state.copy_[prop];
|
|
3291
|
+
}
|
|
3292
|
+
return true;
|
|
3293
|
+
},
|
|
3294
|
+
// Note: We never coerce `desc.value` into an Immer draft, because we can't make
|
|
3295
|
+
// the same guarantee in ES5 mode.
|
|
3296
|
+
getOwnPropertyDescriptor(state, prop) {
|
|
3297
|
+
const owner = latest(state);
|
|
3298
|
+
const desc = Reflect.getOwnPropertyDescriptor(owner, prop);
|
|
3299
|
+
if (!desc)
|
|
3300
|
+
return desc;
|
|
3301
|
+
return {
|
|
3302
|
+
writable: true,
|
|
3303
|
+
configurable: state.type_ !== 1 /* Array */ || prop !== "length",
|
|
3304
|
+
enumerable: desc.enumerable,
|
|
3305
|
+
value: owner[prop]
|
|
3306
|
+
};
|
|
3307
|
+
},
|
|
3308
|
+
defineProperty() {
|
|
3309
|
+
die(11);
|
|
3310
|
+
},
|
|
3311
|
+
getPrototypeOf(state) {
|
|
3312
|
+
return getPrototypeOf(state.base_);
|
|
3313
|
+
},
|
|
3314
|
+
setPrototypeOf() {
|
|
3315
|
+
die(12);
|
|
3316
|
+
}
|
|
3317
|
+
};
|
|
3318
|
+
var arrayTraps = {};
|
|
3319
|
+
each(objectTraps, (key, fn) => {
|
|
3320
|
+
arrayTraps[key] = function() {
|
|
3321
|
+
arguments[0] = arguments[0][0];
|
|
3322
|
+
return fn.apply(this, arguments);
|
|
3323
|
+
};
|
|
3324
|
+
});
|
|
3325
|
+
arrayTraps.deleteProperty = function(state, prop) {
|
|
3326
|
+
if (process.env.NODE_ENV !== "production" && isNaN(parseInt(prop)))
|
|
3327
|
+
die(13);
|
|
3328
|
+
return arrayTraps.set.call(this, state, prop, void 0);
|
|
3329
|
+
};
|
|
3330
|
+
arrayTraps.set = function(state, prop, value) {
|
|
3331
|
+
if (process.env.NODE_ENV !== "production" && prop !== "length" && isNaN(parseInt(prop)))
|
|
3332
|
+
die(14);
|
|
3333
|
+
return objectTraps.set.call(this, state[0], prop, value, state[0]);
|
|
3334
|
+
};
|
|
3335
|
+
function peek(draft, prop) {
|
|
3336
|
+
const state = draft[DRAFT_STATE];
|
|
3337
|
+
const source = state ? latest(state) : draft;
|
|
3338
|
+
return source[prop];
|
|
3339
|
+
}
|
|
3340
|
+
function readPropFromProto(state, source, prop) {
|
|
3341
|
+
const desc = getDescriptorFromProto(source, prop);
|
|
3342
|
+
return desc ? `value` in desc ? desc.value : (
|
|
3343
|
+
// This is a very special case, if the prop is a getter defined by the
|
|
3344
|
+
// prototype, we should invoke it with the draft as context!
|
|
3345
|
+
desc.get?.call(state.draft_)
|
|
3346
|
+
) : void 0;
|
|
3347
|
+
}
|
|
3348
|
+
function getDescriptorFromProto(source, prop) {
|
|
3349
|
+
if (!(prop in source))
|
|
3350
|
+
return void 0;
|
|
3351
|
+
let proto = getPrototypeOf(source);
|
|
3352
|
+
while (proto) {
|
|
3353
|
+
const desc = Object.getOwnPropertyDescriptor(proto, prop);
|
|
3354
|
+
if (desc)
|
|
3355
|
+
return desc;
|
|
3356
|
+
proto = getPrototypeOf(proto);
|
|
3357
|
+
}
|
|
3358
|
+
return void 0;
|
|
3359
|
+
}
|
|
3360
|
+
function markChanged(state) {
|
|
3361
|
+
if (!state.modified_) {
|
|
3362
|
+
state.modified_ = true;
|
|
3363
|
+
if (state.parent_) {
|
|
3364
|
+
markChanged(state.parent_);
|
|
3365
|
+
}
|
|
3366
|
+
}
|
|
3367
|
+
}
|
|
3368
|
+
function prepareCopy(state) {
|
|
3369
|
+
if (!state.copy_) {
|
|
3370
|
+
state.copy_ = shallowCopy(
|
|
3371
|
+
state.base_,
|
|
3372
|
+
state.scope_.immer_.useStrictShallowCopy_
|
|
3373
|
+
);
|
|
3374
|
+
}
|
|
3375
|
+
}
|
|
3376
|
+
|
|
3377
|
+
// src/core/immerClass.ts
|
|
3378
|
+
var Immer2 = class {
|
|
3379
|
+
constructor(config) {
|
|
3380
|
+
this.autoFreeze_ = true;
|
|
3381
|
+
this.useStrictShallowCopy_ = false;
|
|
3382
|
+
/**
|
|
3383
|
+
* The `produce` function takes a value and a "recipe function" (whose
|
|
3384
|
+
* return value often depends on the base state). The recipe function is
|
|
3385
|
+
* free to mutate its first argument however it wants. All mutations are
|
|
3386
|
+
* only ever applied to a __copy__ of the base state.
|
|
3387
|
+
*
|
|
3388
|
+
* Pass only a function to create a "curried producer" which relieves you
|
|
3389
|
+
* from passing the recipe function every time.
|
|
3390
|
+
*
|
|
3391
|
+
* Only plain objects and arrays are made mutable. All other objects are
|
|
3392
|
+
* considered uncopyable.
|
|
3393
|
+
*
|
|
3394
|
+
* Note: This function is __bound__ to its `Immer` instance.
|
|
3395
|
+
*
|
|
3396
|
+
* @param {any} base - the initial state
|
|
3397
|
+
* @param {Function} recipe - function that receives a proxy of the base state as first argument and which can be freely modified
|
|
3398
|
+
* @param {Function} patchListener - optional function that will be called with all the patches produced here
|
|
3399
|
+
* @returns {any} a new state, or the initial state if nothing was modified
|
|
3400
|
+
*/
|
|
3401
|
+
this.produce = (base, recipe, patchListener) => {
|
|
3402
|
+
if (typeof base === "function" && typeof recipe !== "function") {
|
|
3403
|
+
const defaultBase = recipe;
|
|
3404
|
+
recipe = base;
|
|
3405
|
+
const self = this;
|
|
3406
|
+
return function curriedProduce(base2 = defaultBase, ...args) {
|
|
3407
|
+
return self.produce(base2, (draft) => recipe.call(this, draft, ...args));
|
|
3408
|
+
};
|
|
3409
|
+
}
|
|
3410
|
+
if (typeof recipe !== "function")
|
|
3411
|
+
die(6);
|
|
3412
|
+
if (patchListener !== void 0 && typeof patchListener !== "function")
|
|
3413
|
+
die(7);
|
|
3414
|
+
let result;
|
|
3415
|
+
if (isDraftable(base)) {
|
|
3416
|
+
const scope = enterScope(this);
|
|
3417
|
+
const proxy = createProxy(base, void 0);
|
|
3418
|
+
let hasError = true;
|
|
3419
|
+
try {
|
|
3420
|
+
result = recipe(proxy);
|
|
3421
|
+
hasError = false;
|
|
3422
|
+
} finally {
|
|
3423
|
+
if (hasError)
|
|
3424
|
+
revokeScope(scope);
|
|
3425
|
+
else
|
|
3426
|
+
leaveScope(scope);
|
|
3427
|
+
}
|
|
3428
|
+
usePatchesInScope(scope, patchListener);
|
|
3429
|
+
return processResult(result, scope);
|
|
3430
|
+
} else if (!base || typeof base !== "object") {
|
|
3431
|
+
result = recipe(base);
|
|
3432
|
+
if (result === void 0)
|
|
3433
|
+
result = base;
|
|
3434
|
+
if (result === NOTHING)
|
|
3435
|
+
result = void 0;
|
|
3436
|
+
if (this.autoFreeze_)
|
|
3437
|
+
freeze(result, true);
|
|
3438
|
+
if (patchListener) {
|
|
3439
|
+
const p = [];
|
|
3440
|
+
const ip = [];
|
|
3441
|
+
getPlugin("Patches").generateReplacementPatches_(base, result, p, ip);
|
|
3442
|
+
patchListener(p, ip);
|
|
3443
|
+
}
|
|
3444
|
+
return result;
|
|
3445
|
+
} else
|
|
3446
|
+
die(1, base);
|
|
3447
|
+
};
|
|
3448
|
+
this.produceWithPatches = (base, recipe) => {
|
|
3449
|
+
if (typeof base === "function") {
|
|
3450
|
+
return (state, ...args) => this.produceWithPatches(state, (draft) => base(draft, ...args));
|
|
3451
|
+
}
|
|
3452
|
+
let patches, inversePatches;
|
|
3453
|
+
const result = this.produce(base, recipe, (p, ip) => {
|
|
3454
|
+
patches = p;
|
|
3455
|
+
inversePatches = ip;
|
|
3456
|
+
});
|
|
3457
|
+
return [result, patches, inversePatches];
|
|
3458
|
+
};
|
|
3459
|
+
if (typeof config?.autoFreeze === "boolean")
|
|
3460
|
+
this.setAutoFreeze(config.autoFreeze);
|
|
3461
|
+
if (typeof config?.useStrictShallowCopy === "boolean")
|
|
3462
|
+
this.setUseStrictShallowCopy(config.useStrictShallowCopy);
|
|
3463
|
+
}
|
|
3464
|
+
createDraft(base) {
|
|
3465
|
+
if (!isDraftable(base))
|
|
3466
|
+
die(8);
|
|
3467
|
+
if (isDraft(base))
|
|
3468
|
+
base = current(base);
|
|
3469
|
+
const scope = enterScope(this);
|
|
3470
|
+
const proxy = createProxy(base, void 0);
|
|
3471
|
+
proxy[DRAFT_STATE].isManual_ = true;
|
|
3472
|
+
leaveScope(scope);
|
|
3473
|
+
return proxy;
|
|
3474
|
+
}
|
|
3475
|
+
finishDraft(draft, patchListener) {
|
|
3476
|
+
const state = draft && draft[DRAFT_STATE];
|
|
3477
|
+
if (!state || !state.isManual_)
|
|
3478
|
+
die(9);
|
|
3479
|
+
const { scope_: scope } = state;
|
|
3480
|
+
usePatchesInScope(scope, patchListener);
|
|
3481
|
+
return processResult(void 0, scope);
|
|
3482
|
+
}
|
|
3483
|
+
/**
|
|
3484
|
+
* Pass true to automatically freeze all copies created by Immer.
|
|
3485
|
+
*
|
|
3486
|
+
* By default, auto-freezing is enabled.
|
|
3487
|
+
*/
|
|
3488
|
+
setAutoFreeze(value) {
|
|
3489
|
+
this.autoFreeze_ = value;
|
|
3490
|
+
}
|
|
3491
|
+
/**
|
|
3492
|
+
* Pass true to enable strict shallow copy.
|
|
3493
|
+
*
|
|
3494
|
+
* By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.
|
|
3495
|
+
*/
|
|
3496
|
+
setUseStrictShallowCopy(value) {
|
|
3497
|
+
this.useStrictShallowCopy_ = value;
|
|
3498
|
+
}
|
|
3499
|
+
applyPatches(base, patches) {
|
|
3500
|
+
let i;
|
|
3501
|
+
for (i = patches.length - 1; i >= 0; i--) {
|
|
3502
|
+
const patch = patches[i];
|
|
3503
|
+
if (patch.path.length === 0 && patch.op === "replace") {
|
|
3504
|
+
base = patch.value;
|
|
3505
|
+
break;
|
|
3506
|
+
}
|
|
3507
|
+
}
|
|
3508
|
+
if (i > -1) {
|
|
3509
|
+
patches = patches.slice(i + 1);
|
|
3510
|
+
}
|
|
3511
|
+
const applyPatchesImpl = getPlugin("Patches").applyPatches_;
|
|
3512
|
+
if (isDraft(base)) {
|
|
3513
|
+
return applyPatchesImpl(base, patches);
|
|
3514
|
+
}
|
|
3515
|
+
return this.produce(
|
|
3516
|
+
base,
|
|
3517
|
+
(draft) => applyPatchesImpl(draft, patches)
|
|
3518
|
+
);
|
|
3519
|
+
}
|
|
3520
|
+
};
|
|
3521
|
+
function createProxy(value, parent) {
|
|
3522
|
+
const draft = isMap(value) ? getPlugin("MapSet").proxyMap_(value, parent) : isSet(value) ? getPlugin("MapSet").proxySet_(value, parent) : createProxyProxy(value, parent);
|
|
3523
|
+
const scope = parent ? parent.scope_ : getCurrentScope();
|
|
3524
|
+
scope.drafts_.push(draft);
|
|
3525
|
+
return draft;
|
|
3526
|
+
}
|
|
3527
|
+
|
|
3528
|
+
// src/core/current.ts
|
|
3529
|
+
function current(value) {
|
|
3530
|
+
if (!isDraft(value))
|
|
3531
|
+
die(10, value);
|
|
3532
|
+
return currentImpl(value);
|
|
3533
|
+
}
|
|
3534
|
+
function currentImpl(value) {
|
|
3535
|
+
if (!isDraftable(value) || isFrozen(value))
|
|
3536
|
+
return value;
|
|
3537
|
+
const state = value[DRAFT_STATE];
|
|
3538
|
+
let copy;
|
|
3539
|
+
if (state) {
|
|
3540
|
+
if (!state.modified_)
|
|
3541
|
+
return state.base_;
|
|
3542
|
+
state.finalized_ = true;
|
|
3543
|
+
copy = shallowCopy(value, state.scope_.immer_.useStrictShallowCopy_);
|
|
3544
|
+
} else {
|
|
3545
|
+
copy = shallowCopy(value, true);
|
|
3546
|
+
}
|
|
3547
|
+
each(copy, (key, childValue) => {
|
|
3548
|
+
set(copy, key, currentImpl(childValue));
|
|
3549
|
+
});
|
|
3550
|
+
if (state) {
|
|
3551
|
+
state.finalized_ = false;
|
|
3552
|
+
}
|
|
3553
|
+
return copy;
|
|
3554
|
+
}
|
|
3555
|
+
|
|
3556
|
+
// src/immer.ts
|
|
3557
|
+
var immer = new Immer2();
|
|
3558
|
+
immer.produce;
|
|
3559
|
+
immer.produceWithPatches.bind(
|
|
3560
|
+
immer
|
|
3561
|
+
);
|
|
3562
|
+
immer.setAutoFreeze.bind(immer);
|
|
3563
|
+
immer.setUseStrictShallowCopy.bind(immer);
|
|
3564
|
+
immer.applyPatches.bind(immer);
|
|
3565
|
+
immer.createDraft.bind(immer);
|
|
3566
|
+
immer.finishDraft.bind(immer);
|
|
3567
|
+
|
|
2840
3568
|
/* eslint-disable @bigbinary/neeto/neetocommons-tips */
|
|
2841
3569
|
|
|
2842
3570
|
/**
|
|
@@ -2904,12 +3632,11 @@ var argument = {};
|
|
|
2904
3632
|
|
|
2905
3633
|
var error = {};
|
|
2906
3634
|
|
|
2907
|
-
// @ts-check
|
|
2908
|
-
|
|
2909
3635
|
/**
|
|
2910
3636
|
* CommanderError class
|
|
2911
3637
|
* @class
|
|
2912
3638
|
*/
|
|
3639
|
+
|
|
2913
3640
|
let CommanderError$2 = class CommanderError extends Error {
|
|
2914
3641
|
/**
|
|
2915
3642
|
* Constructs the CommanderError class
|
|
@@ -2952,8 +3679,6 @@ error.InvalidArgumentError = InvalidArgumentError$3;
|
|
|
2952
3679
|
|
|
2953
3680
|
const { InvalidArgumentError: InvalidArgumentError$2 } = error;
|
|
2954
3681
|
|
|
2955
|
-
// @ts-check
|
|
2956
|
-
|
|
2957
3682
|
let Argument$2 = class Argument {
|
|
2958
3683
|
/**
|
|
2959
3684
|
* Initialize a new command argument with the given name and description.
|
|
@@ -3018,7 +3743,7 @@ let Argument$2 = class Argument {
|
|
|
3018
3743
|
/**
|
|
3019
3744
|
* Set the default value, and optionally supply the description to be displayed in the help.
|
|
3020
3745
|
*
|
|
3021
|
-
* @param {
|
|
3746
|
+
* @param {*} value
|
|
3022
3747
|
* @param {string} [description]
|
|
3023
3748
|
* @return {Argument}
|
|
3024
3749
|
*/
|
|
@@ -3112,8 +3837,6 @@ const { humanReadableArgName: humanReadableArgName$1 } = argument;
|
|
|
3112
3837
|
* @typedef { import("./option.js").Option } Option
|
|
3113
3838
|
*/
|
|
3114
3839
|
|
|
3115
|
-
// @ts-check
|
|
3116
|
-
|
|
3117
3840
|
// Although this is a class, methods are static in style to allow override using subclass or just functions.
|
|
3118
3841
|
let Help$2 = class Help {
|
|
3119
3842
|
constructor() {
|
|
@@ -3205,8 +3928,8 @@ let Help$2 = class Help {
|
|
|
3205
3928
|
if (!this.showGlobalOptions) return [];
|
|
3206
3929
|
|
|
3207
3930
|
const globalOptions = [];
|
|
3208
|
-
for (let
|
|
3209
|
-
const visibleOptions =
|
|
3931
|
+
for (let ancestorCmd = cmd.parent; ancestorCmd; ancestorCmd = ancestorCmd.parent) {
|
|
3932
|
+
const visibleOptions = ancestorCmd.options.filter((option) => !option.hidden);
|
|
3210
3933
|
globalOptions.push(...visibleOptions);
|
|
3211
3934
|
}
|
|
3212
3935
|
if (this.sortOptions) {
|
|
@@ -3225,14 +3948,14 @@ let Help$2 = class Help {
|
|
|
3225
3948
|
visibleArguments(cmd) {
|
|
3226
3949
|
// Side effect! Apply the legacy descriptions before the arguments are displayed.
|
|
3227
3950
|
if (cmd._argsDescription) {
|
|
3228
|
-
cmd.
|
|
3951
|
+
cmd.registeredArguments.forEach(argument => {
|
|
3229
3952
|
argument.description = argument.description || cmd._argsDescription[argument.name()] || '';
|
|
3230
3953
|
});
|
|
3231
3954
|
}
|
|
3232
3955
|
|
|
3233
3956
|
// If there are any arguments with a description then return all the arguments.
|
|
3234
|
-
if (cmd.
|
|
3235
|
-
return cmd.
|
|
3957
|
+
if (cmd.registeredArguments.find(argument => argument.description)) {
|
|
3958
|
+
return cmd.registeredArguments;
|
|
3236
3959
|
}
|
|
3237
3960
|
return [];
|
|
3238
3961
|
}
|
|
@@ -3246,7 +3969,7 @@ let Help$2 = class Help {
|
|
|
3246
3969
|
|
|
3247
3970
|
subcommandTerm(cmd) {
|
|
3248
3971
|
// Legacy. Ignores custom usage string, and nested commands.
|
|
3249
|
-
const args = cmd.
|
|
3972
|
+
const args = cmd.registeredArguments.map(arg => humanReadableArgName$1(arg)).join(' ');
|
|
3250
3973
|
return cmd._name +
|
|
3251
3974
|
(cmd._aliases[0] ? '|' + cmd._aliases[0] : '') +
|
|
3252
3975
|
(cmd.options.length ? ' [options]' : '') + // simplistic check for non-help option
|
|
@@ -3344,11 +4067,11 @@ let Help$2 = class Help {
|
|
|
3344
4067
|
if (cmd._aliases[0]) {
|
|
3345
4068
|
cmdName = cmdName + '|' + cmd._aliases[0];
|
|
3346
4069
|
}
|
|
3347
|
-
let
|
|
3348
|
-
for (let
|
|
3349
|
-
|
|
4070
|
+
let ancestorCmdNames = '';
|
|
4071
|
+
for (let ancestorCmd = cmd.parent; ancestorCmd; ancestorCmd = ancestorCmd.parent) {
|
|
4072
|
+
ancestorCmdNames = ancestorCmd.name() + ' ' + ancestorCmdNames;
|
|
3350
4073
|
}
|
|
3351
|
-
return
|
|
4074
|
+
return ancestorCmdNames + cmdName + ' ' + cmd.usage();
|
|
3352
4075
|
}
|
|
3353
4076
|
|
|
3354
4077
|
/**
|
|
@@ -3571,8 +4294,6 @@ var option = {};
|
|
|
3571
4294
|
|
|
3572
4295
|
const { InvalidArgumentError: InvalidArgumentError$1 } = error;
|
|
3573
4296
|
|
|
3574
|
-
// @ts-check
|
|
3575
|
-
|
|
3576
4297
|
let Option$2 = class Option {
|
|
3577
4298
|
/**
|
|
3578
4299
|
* Initialize a new `Option` with the given `flags` and `description`.
|
|
@@ -3611,7 +4332,7 @@ let Option$2 = class Option {
|
|
|
3611
4332
|
/**
|
|
3612
4333
|
* Set the default value, and optionally supply the description to be displayed in the help.
|
|
3613
4334
|
*
|
|
3614
|
-
* @param {
|
|
4335
|
+
* @param {*} value
|
|
3615
4336
|
* @param {string} [description]
|
|
3616
4337
|
* @return {Option}
|
|
3617
4338
|
*/
|
|
@@ -3630,7 +4351,7 @@ let Option$2 = class Option {
|
|
|
3630
4351
|
* new Option('--color').default('GREYSCALE').preset('RGB');
|
|
3631
4352
|
* new Option('--donate [amount]').preset('20').argParser(parseFloat);
|
|
3632
4353
|
*
|
|
3633
|
-
* @param {
|
|
4354
|
+
* @param {*} arg
|
|
3634
4355
|
* @return {Option}
|
|
3635
4356
|
*/
|
|
3636
4357
|
|
|
@@ -3846,7 +4567,7 @@ let DualOptions$1 = class DualOptions {
|
|
|
3846
4567
|
/**
|
|
3847
4568
|
* Did the value come from the option, and not from possible matching dual option?
|
|
3848
4569
|
*
|
|
3849
|
-
* @param {
|
|
4570
|
+
* @param {*} value
|
|
3850
4571
|
* @param {Option} option
|
|
3851
4572
|
* @returns {boolean}
|
|
3852
4573
|
*/
|
|
@@ -4016,8 +4737,6 @@ const { Help: Help$1 } = help;
|
|
|
4016
4737
|
const { Option: Option$1, splitOptionFlags, DualOptions } = option;
|
|
4017
4738
|
const { suggestSimilar } = suggestSimilar$2;
|
|
4018
4739
|
|
|
4019
|
-
// @ts-check
|
|
4020
|
-
|
|
4021
4740
|
let Command$1 = class Command extends EventEmitter {
|
|
4022
4741
|
/**
|
|
4023
4742
|
* Initialize a new `Command`.
|
|
@@ -4035,7 +4754,8 @@ let Command$1 = class Command extends EventEmitter {
|
|
|
4035
4754
|
this._allowUnknownOption = false;
|
|
4036
4755
|
this._allowExcessArguments = true;
|
|
4037
4756
|
/** @type {Argument[]} */
|
|
4038
|
-
this.
|
|
4757
|
+
this.registeredArguments = [];
|
|
4758
|
+
this._args = this.registeredArguments; // deprecated old name
|
|
4039
4759
|
/** @type {string[]} */
|
|
4040
4760
|
this.args = []; // cli args with options removed
|
|
4041
4761
|
this.rawArgs = [];
|
|
@@ -4115,6 +4835,19 @@ let Command$1 = class Command extends EventEmitter {
|
|
|
4115
4835
|
return this;
|
|
4116
4836
|
}
|
|
4117
4837
|
|
|
4838
|
+
/**
|
|
4839
|
+
* @returns {Command[]}
|
|
4840
|
+
* @api private
|
|
4841
|
+
*/
|
|
4842
|
+
|
|
4843
|
+
_getCommandAndAncestors() {
|
|
4844
|
+
const result = [];
|
|
4845
|
+
for (let command = this; command; command = command.parent) {
|
|
4846
|
+
result.push(command);
|
|
4847
|
+
}
|
|
4848
|
+
return result;
|
|
4849
|
+
}
|
|
4850
|
+
|
|
4118
4851
|
/**
|
|
4119
4852
|
* Define a command.
|
|
4120
4853
|
*
|
|
@@ -4349,14 +5082,14 @@ let Command$1 = class Command extends EventEmitter {
|
|
|
4349
5082
|
* @return {Command} `this` command for chaining
|
|
4350
5083
|
*/
|
|
4351
5084
|
addArgument(argument) {
|
|
4352
|
-
const previousArgument = this.
|
|
5085
|
+
const previousArgument = this.registeredArguments.slice(-1)[0];
|
|
4353
5086
|
if (previousArgument && previousArgument.variadic) {
|
|
4354
5087
|
throw new Error(`only the last argument can be variadic '${previousArgument.name()}'`);
|
|
4355
5088
|
}
|
|
4356
5089
|
if (argument.required && argument.defaultValue !== undefined && argument.parseArg === undefined) {
|
|
4357
5090
|
throw new Error(`a default value for a required argument is never used: '${argument.name()}'`);
|
|
4358
5091
|
}
|
|
4359
|
-
this.
|
|
5092
|
+
this.registeredArguments.push(argument);
|
|
4360
5093
|
return this;
|
|
4361
5094
|
}
|
|
4362
5095
|
|
|
@@ -4474,7 +5207,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
4474
5207
|
action(fn) {
|
|
4475
5208
|
const listener = (args) => {
|
|
4476
5209
|
// The .action callback takes an extra parameter which is the command or options.
|
|
4477
|
-
const expectedArgsCount = this.
|
|
5210
|
+
const expectedArgsCount = this.registeredArguments.length;
|
|
4478
5211
|
const actionArgs = args.slice(0, expectedArgsCount);
|
|
4479
5212
|
if (this._storeOptionsAsProperties) {
|
|
4480
5213
|
actionArgs[expectedArgsCount] = this; // backwards compatible "options"
|
|
@@ -4504,6 +5237,28 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
4504
5237
|
return new Option$1(flags, description);
|
|
4505
5238
|
}
|
|
4506
5239
|
|
|
5240
|
+
/**
|
|
5241
|
+
* Wrap parseArgs to catch 'commander.invalidArgument'.
|
|
5242
|
+
*
|
|
5243
|
+
* @param {Option | Argument} target
|
|
5244
|
+
* @param {string} value
|
|
5245
|
+
* @param {*} previous
|
|
5246
|
+
* @param {string} invalidArgumentMessage
|
|
5247
|
+
* @api private
|
|
5248
|
+
*/
|
|
5249
|
+
|
|
5250
|
+
_callParseArg(target, value, previous, invalidArgumentMessage) {
|
|
5251
|
+
try {
|
|
5252
|
+
return target.parseArg(value, previous);
|
|
5253
|
+
} catch (err) {
|
|
5254
|
+
if (err.code === 'commander.invalidArgument') {
|
|
5255
|
+
const message = `${invalidArgumentMessage} ${err.message}`;
|
|
5256
|
+
this.error(message, { exitCode: err.exitCode, code: err.code });
|
|
5257
|
+
}
|
|
5258
|
+
throw err;
|
|
5259
|
+
}
|
|
5260
|
+
}
|
|
5261
|
+
|
|
4507
5262
|
/**
|
|
4508
5263
|
* Add an option.
|
|
4509
5264
|
*
|
|
@@ -4539,15 +5294,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
4539
5294
|
// custom processing
|
|
4540
5295
|
const oldValue = this.getOptionValue(name);
|
|
4541
5296
|
if (val !== null && option.parseArg) {
|
|
4542
|
-
|
|
4543
|
-
val = option.parseArg(val, oldValue);
|
|
4544
|
-
} catch (err) {
|
|
4545
|
-
if (err.code === 'commander.invalidArgument') {
|
|
4546
|
-
const message = `${invalidValueMessage} ${err.message}`;
|
|
4547
|
-
this.error(message, { exitCode: err.exitCode, code: err.code });
|
|
4548
|
-
}
|
|
4549
|
-
throw err;
|
|
4550
|
-
}
|
|
5297
|
+
val = this._callParseArg(option, val, oldValue, invalidValueMessage);
|
|
4551
5298
|
} else if (val !== null && option.variadic) {
|
|
4552
5299
|
val = option._concatValue(val, oldValue);
|
|
4553
5300
|
}
|
|
@@ -4609,57 +5356,29 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
4609
5356
|
}
|
|
4610
5357
|
|
|
4611
5358
|
/**
|
|
4612
|
-
* Define option with `flags`, `description
|
|
4613
|
-
* coercion `fn`.
|
|
5359
|
+
* Define option with `flags`, `description`, and optional argument parsing function or `defaultValue` or both.
|
|
4614
5360
|
*
|
|
4615
|
-
* The `flags` string contains the short and/or long flags,
|
|
4616
|
-
*
|
|
4617
|
-
* all will output this way when `--help` is used.
|
|
5361
|
+
* The `flags` string contains the short and/or long flags, separated by comma, a pipe or space. A required
|
|
5362
|
+
* option-argument is indicated by `<>` and an optional option-argument by `[]`.
|
|
4618
5363
|
*
|
|
4619
|
-
*
|
|
4620
|
-
* "-p|--pepper"
|
|
4621
|
-
* "-p --pepper"
|
|
5364
|
+
* See the README for more details, and see also addOption() and requiredOption().
|
|
4622
5365
|
*
|
|
4623
5366
|
* @example
|
|
4624
|
-
*
|
|
4625
|
-
*
|
|
4626
|
-
*
|
|
4627
|
-
*
|
|
4628
|
-
* //
|
|
4629
|
-
*
|
|
4630
|
-
* --pepper
|
|
4631
|
-
* program.pepper
|
|
4632
|
-
* // => true
|
|
4633
|
-
*
|
|
4634
|
-
* // simple boolean defaulting to true (unless non-negated option is also defined)
|
|
4635
|
-
* program.option('-C, --no-cheese', 'remove cheese');
|
|
4636
|
-
*
|
|
4637
|
-
* program.cheese
|
|
4638
|
-
* // => true
|
|
4639
|
-
*
|
|
4640
|
-
* --no-cheese
|
|
4641
|
-
* program.cheese
|
|
4642
|
-
* // => false
|
|
4643
|
-
*
|
|
4644
|
-
* // required argument
|
|
4645
|
-
* program.option('-C, --chdir <path>', 'change the working directory');
|
|
4646
|
-
*
|
|
4647
|
-
* --chdir /tmp
|
|
4648
|
-
* program.chdir
|
|
4649
|
-
* // => "/tmp"
|
|
4650
|
-
*
|
|
4651
|
-
* // optional argument
|
|
4652
|
-
* program.option('-c, --cheese [type]', 'add cheese [marble]');
|
|
5367
|
+
* program
|
|
5368
|
+
* .option('-p, --pepper', 'add pepper')
|
|
5369
|
+
* .option('-p, --pizza-type <TYPE>', 'type of pizza') // required option-argument
|
|
5370
|
+
* .option('-c, --cheese [CHEESE]', 'add extra cheese', 'mozzarella') // optional option-argument with default
|
|
5371
|
+
* .option('-t, --tip <VALUE>', 'add tip to purchase cost', parseFloat) // custom parse function
|
|
4653
5372
|
*
|
|
4654
5373
|
* @param {string} flags
|
|
4655
5374
|
* @param {string} [description]
|
|
4656
|
-
* @param {Function|*} [
|
|
5375
|
+
* @param {Function|*} [parseArg] - custom option processing function or default value
|
|
4657
5376
|
* @param {*} [defaultValue]
|
|
4658
5377
|
* @return {Command} `this` command for chaining
|
|
4659
5378
|
*/
|
|
4660
5379
|
|
|
4661
|
-
option(flags, description,
|
|
4662
|
-
return this._optionEx({}, flags, description,
|
|
5380
|
+
option(flags, description, parseArg, defaultValue) {
|
|
5381
|
+
return this._optionEx({}, flags, description, parseArg, defaultValue);
|
|
4663
5382
|
}
|
|
4664
5383
|
|
|
4665
5384
|
/**
|
|
@@ -4670,13 +5389,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
4670
5389
|
*
|
|
4671
5390
|
* @param {string} flags
|
|
4672
5391
|
* @param {string} [description]
|
|
4673
|
-
* @param {Function|*} [
|
|
5392
|
+
* @param {Function|*} [parseArg] - custom option processing function or default value
|
|
4674
5393
|
* @param {*} [defaultValue]
|
|
4675
5394
|
* @return {Command} `this` command for chaining
|
|
4676
5395
|
*/
|
|
4677
5396
|
|
|
4678
|
-
requiredOption(flags, description,
|
|
4679
|
-
return this._optionEx({ mandatory: true }, flags, description,
|
|
5397
|
+
requiredOption(flags, description, parseArg, defaultValue) {
|
|
5398
|
+
return this._optionEx({ mandatory: true }, flags, description, parseArg, defaultValue);
|
|
4680
5399
|
}
|
|
4681
5400
|
|
|
4682
5401
|
/**
|
|
@@ -4754,10 +5473,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
4754
5473
|
*/
|
|
4755
5474
|
|
|
4756
5475
|
storeOptionsAsProperties(storeAsProperties = true) {
|
|
4757
|
-
this._storeOptionsAsProperties = !!storeAsProperties;
|
|
4758
5476
|
if (this.options.length) {
|
|
4759
5477
|
throw new Error('call .storeOptionsAsProperties() before adding options');
|
|
4760
5478
|
}
|
|
5479
|
+
// if (Object.keys(this._optionValues).length) {
|
|
5480
|
+
// throw new Error('call .storeOptionsAsProperties() before setting option values');
|
|
5481
|
+
// }
|
|
5482
|
+
this._storeOptionsAsProperties = !!storeAsProperties;
|
|
4761
5483
|
return this;
|
|
4762
5484
|
}
|
|
4763
5485
|
|
|
@@ -4829,7 +5551,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
4829
5551
|
getOptionValueSourceWithGlobals(key) {
|
|
4830
5552
|
// global overwrites local, like optsWithGlobals
|
|
4831
5553
|
let source;
|
|
4832
|
-
|
|
5554
|
+
this._getCommandAndAncestors().forEach((cmd) => {
|
|
4833
5555
|
if (cmd.getOptionValueSource(key) !== undefined) {
|
|
4834
5556
|
source = cmd.getOptionValueSource(key);
|
|
4835
5557
|
}
|
|
@@ -5076,16 +5798,16 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
5076
5798
|
const subCommand = this._findCommand(commandName);
|
|
5077
5799
|
if (!subCommand) this.help({ error: true });
|
|
5078
5800
|
|
|
5079
|
-
let
|
|
5080
|
-
|
|
5081
|
-
|
|
5801
|
+
let promiseChain;
|
|
5802
|
+
promiseChain = this._chainOrCallSubCommandHook(promiseChain, subCommand, 'preSubcommand');
|
|
5803
|
+
promiseChain = this._chainOrCall(promiseChain, () => {
|
|
5082
5804
|
if (subCommand._executableHandler) {
|
|
5083
5805
|
this._executeSubCommand(subCommand, operands.concat(unknown));
|
|
5084
5806
|
} else {
|
|
5085
5807
|
return subCommand._parseCommand(operands, unknown);
|
|
5086
5808
|
}
|
|
5087
5809
|
});
|
|
5088
|
-
return
|
|
5810
|
+
return promiseChain;
|
|
5089
5811
|
}
|
|
5090
5812
|
|
|
5091
5813
|
/**
|
|
@@ -5105,33 +5827,35 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
5105
5827
|
}
|
|
5106
5828
|
|
|
5107
5829
|
// Fallback to parsing the help flag to invoke the help.
|
|
5108
|
-
return this._dispatchSubcommand(subcommandName, [], [
|
|
5830
|
+
return this._dispatchSubcommand(subcommandName, [], [
|
|
5831
|
+
this._helpLongFlag || this._helpShortFlag
|
|
5832
|
+
]);
|
|
5109
5833
|
}
|
|
5110
5834
|
|
|
5111
5835
|
/**
|
|
5112
|
-
* Check this.args against expected this.
|
|
5836
|
+
* Check this.args against expected this.registeredArguments.
|
|
5113
5837
|
*
|
|
5114
5838
|
* @api private
|
|
5115
5839
|
*/
|
|
5116
5840
|
|
|
5117
5841
|
_checkNumberOfArguments() {
|
|
5118
5842
|
// too few
|
|
5119
|
-
this.
|
|
5843
|
+
this.registeredArguments.forEach((arg, i) => {
|
|
5120
5844
|
if (arg.required && this.args[i] == null) {
|
|
5121
5845
|
this.missingArgument(arg.name());
|
|
5122
5846
|
}
|
|
5123
5847
|
});
|
|
5124
5848
|
// too many
|
|
5125
|
-
if (this.
|
|
5849
|
+
if (this.registeredArguments.length > 0 && this.registeredArguments[this.registeredArguments.length - 1].variadic) {
|
|
5126
5850
|
return;
|
|
5127
5851
|
}
|
|
5128
|
-
if (this.args.length > this.
|
|
5852
|
+
if (this.args.length > this.registeredArguments.length) {
|
|
5129
5853
|
this._excessArguments(this.args);
|
|
5130
5854
|
}
|
|
5131
5855
|
}
|
|
5132
5856
|
|
|
5133
5857
|
/**
|
|
5134
|
-
* Process this.args using this.
|
|
5858
|
+
* Process this.args using this.registeredArguments and save as this.processedArgs!
|
|
5135
5859
|
*
|
|
5136
5860
|
* @api private
|
|
5137
5861
|
*/
|
|
@@ -5141,15 +5865,8 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
5141
5865
|
// Extra processing for nice error message on parsing failure.
|
|
5142
5866
|
let parsedValue = value;
|
|
5143
5867
|
if (value !== null && argument.parseArg) {
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
} catch (err) {
|
|
5147
|
-
if (err.code === 'commander.invalidArgument') {
|
|
5148
|
-
const message = `error: command-argument value '${value}' is invalid for argument '${argument.name()}'. ${err.message}`;
|
|
5149
|
-
this.error(message, { exitCode: err.exitCode, code: err.code });
|
|
5150
|
-
}
|
|
5151
|
-
throw err;
|
|
5152
|
-
}
|
|
5868
|
+
const invalidValueMessage = `error: command-argument value '${value}' is invalid for argument '${argument.name()}'.`;
|
|
5869
|
+
parsedValue = this._callParseArg(argument, value, previous, invalidValueMessage);
|
|
5153
5870
|
}
|
|
5154
5871
|
return parsedValue;
|
|
5155
5872
|
};
|
|
@@ -5157,7 +5874,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
5157
5874
|
this._checkNumberOfArguments();
|
|
5158
5875
|
|
|
5159
5876
|
const processedArgs = [];
|
|
5160
|
-
this.
|
|
5877
|
+
this.registeredArguments.forEach((declaredArg, index) => {
|
|
5161
5878
|
let value = declaredArg.defaultValue;
|
|
5162
5879
|
if (declaredArg.variadic) {
|
|
5163
5880
|
// Collect together remaining arguments for passing together as an array.
|
|
@@ -5212,7 +5929,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
5212
5929
|
_chainOrCallHooks(promise, event) {
|
|
5213
5930
|
let result = promise;
|
|
5214
5931
|
const hooks = [];
|
|
5215
|
-
|
|
5932
|
+
this._getCommandAndAncestors()
|
|
5216
5933
|
.reverse()
|
|
5217
5934
|
.filter(cmd => cmd._lifeCycleHooks[event] !== undefined)
|
|
5218
5935
|
.forEach(hookedCommand => {
|
|
@@ -5299,16 +6016,16 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
5299
6016
|
checkForUnknownOptions();
|
|
5300
6017
|
this._processArguments();
|
|
5301
6018
|
|
|
5302
|
-
let
|
|
5303
|
-
|
|
5304
|
-
|
|
6019
|
+
let promiseChain;
|
|
6020
|
+
promiseChain = this._chainOrCallHooks(promiseChain, 'preAction');
|
|
6021
|
+
promiseChain = this._chainOrCall(promiseChain, () => this._actionHandler(this.processedArgs));
|
|
5305
6022
|
if (this.parent) {
|
|
5306
|
-
|
|
6023
|
+
promiseChain = this._chainOrCall(promiseChain, () => {
|
|
5307
6024
|
this.parent.emit(commandEvent, operands, unknown); // legacy
|
|
5308
6025
|
});
|
|
5309
6026
|
}
|
|
5310
|
-
|
|
5311
|
-
return
|
|
6027
|
+
promiseChain = this._chainOrCallHooks(promiseChain, 'postAction');
|
|
6028
|
+
return promiseChain;
|
|
5312
6029
|
}
|
|
5313
6030
|
if (this.parent && this.parent.listenerCount(commandEvent)) {
|
|
5314
6031
|
checkForUnknownOptions();
|
|
@@ -5369,13 +6086,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
5369
6086
|
|
|
5370
6087
|
_checkForMissingMandatoryOptions() {
|
|
5371
6088
|
// Walk up hierarchy so can call in subcommand after checking for displaying help.
|
|
5372
|
-
|
|
6089
|
+
this._getCommandAndAncestors().forEach((cmd) => {
|
|
5373
6090
|
cmd.options.forEach((anOption) => {
|
|
5374
6091
|
if (anOption.mandatory && (cmd.getOptionValue(anOption.attributeName()) === undefined)) {
|
|
5375
6092
|
cmd.missingMandatoryOptionValue(anOption);
|
|
5376
6093
|
}
|
|
5377
6094
|
});
|
|
5378
|
-
}
|
|
6095
|
+
});
|
|
5379
6096
|
}
|
|
5380
6097
|
|
|
5381
6098
|
/**
|
|
@@ -5416,9 +6133,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
5416
6133
|
*/
|
|
5417
6134
|
_checkForConflictingOptions() {
|
|
5418
6135
|
// Walk up hierarchy so can call in subcommand after checking for displaying help.
|
|
5419
|
-
|
|
6136
|
+
this._getCommandAndAncestors().forEach((cmd) => {
|
|
5420
6137
|
cmd._checkForConflictingLocalOptions();
|
|
5421
|
-
}
|
|
6138
|
+
});
|
|
5422
6139
|
}
|
|
5423
6140
|
|
|
5424
6141
|
/**
|
|
@@ -5581,7 +6298,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
5581
6298
|
*/
|
|
5582
6299
|
optsWithGlobals() {
|
|
5583
6300
|
// globals overwrite locals
|
|
5584
|
-
return
|
|
6301
|
+
return this._getCommandAndAncestors().reduce(
|
|
5585
6302
|
(combinedOptions, cmd) => Object.assign(combinedOptions, cmd.opts()),
|
|
5586
6303
|
{}
|
|
5587
6304
|
);
|
|
@@ -5772,7 +6489,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
5772
6489
|
_excessArguments(receivedArgs) {
|
|
5773
6490
|
if (this._allowExcessArguments) return;
|
|
5774
6491
|
|
|
5775
|
-
const expected = this.
|
|
6492
|
+
const expected = this.registeredArguments.length;
|
|
5776
6493
|
const s = (expected === 1) ? '' : 's';
|
|
5777
6494
|
const forSubcommand = this.parent ? ` for '${this.name()}'` : '';
|
|
5778
6495
|
const message = `error: too many arguments${forSubcommand}. Expected ${expected} argument${s} but got ${receivedArgs.length}.`;
|
|
@@ -5804,17 +6521,16 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
5804
6521
|
}
|
|
5805
6522
|
|
|
5806
6523
|
/**
|
|
5807
|
-
*
|
|
6524
|
+
* Get or set the program version.
|
|
5808
6525
|
*
|
|
5809
|
-
* This method auto-registers the "-V, --version"
|
|
5810
|
-
* which will print the version number when passed.
|
|
6526
|
+
* This method auto-registers the "-V, --version" option which will print the version number.
|
|
5811
6527
|
*
|
|
5812
|
-
* You can optionally supply the
|
|
6528
|
+
* You can optionally supply the flags and description to override the defaults.
|
|
5813
6529
|
*
|
|
5814
|
-
* @param {string} str
|
|
6530
|
+
* @param {string} [str]
|
|
5815
6531
|
* @param {string} [flags]
|
|
5816
6532
|
* @param {string} [description]
|
|
5817
|
-
* @return {this | string} `this` command for chaining, or version string if no arguments
|
|
6533
|
+
* @return {this | string | undefined} `this` command for chaining, or version string if no arguments
|
|
5818
6534
|
*/
|
|
5819
6535
|
|
|
5820
6536
|
version(str, flags, description) {
|
|
@@ -5823,7 +6539,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
5823
6539
|
flags = flags || '-V, --version';
|
|
5824
6540
|
description = description || 'output the version number';
|
|
5825
6541
|
const versionOption = this.createOption(flags, description);
|
|
5826
|
-
this._versionOptionName = versionOption.attributeName();
|
|
6542
|
+
this._versionOptionName = versionOption.attributeName(); // [sic] not defined in constructor, partly legacy, partly only needed at root
|
|
5827
6543
|
this.options.push(versionOption);
|
|
5828
6544
|
this.on('option:' + versionOption.name(), () => {
|
|
5829
6545
|
this._outputConfiguration.writeOut(`${str}\n`);
|
|
@@ -5913,13 +6629,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
5913
6629
|
if (str === undefined) {
|
|
5914
6630
|
if (this._usage) return this._usage;
|
|
5915
6631
|
|
|
5916
|
-
const args = this.
|
|
6632
|
+
const args = this.registeredArguments.map((arg) => {
|
|
5917
6633
|
return humanReadableArgName(arg);
|
|
5918
6634
|
});
|
|
5919
6635
|
return [].concat(
|
|
5920
6636
|
(this.options.length || this._hasHelpOption ? '[options]' : []),
|
|
5921
6637
|
(this.commands.length ? '[command]' : []),
|
|
5922
|
-
(this.
|
|
6638
|
+
(this.registeredArguments.length ? args : [])
|
|
5923
6639
|
).join(' ');
|
|
5924
6640
|
}
|
|
5925
6641
|
|
|
@@ -5968,7 +6684,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
5968
6684
|
* program.executableDir('subcommands');
|
|
5969
6685
|
*
|
|
5970
6686
|
* @param {string} [path]
|
|
5971
|
-
* @return {string|Command}
|
|
6687
|
+
* @return {string|null|Command}
|
|
5972
6688
|
*/
|
|
5973
6689
|
|
|
5974
6690
|
executableDir(path) {
|
|
@@ -6026,7 +6742,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
6026
6742
|
}
|
|
6027
6743
|
const context = this._getHelpContext(contextOptions);
|
|
6028
6744
|
|
|
6029
|
-
|
|
6745
|
+
this._getCommandAndAncestors().reverse().forEach(command => command.emit('beforeAllHelp', context));
|
|
6030
6746
|
this.emit('beforeHelp', context);
|
|
6031
6747
|
|
|
6032
6748
|
let helpInformation = this.helpInformation(context);
|
|
@@ -6038,9 +6754,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
6038
6754
|
}
|
|
6039
6755
|
context.write(helpInformation);
|
|
6040
6756
|
|
|
6041
|
-
|
|
6757
|
+
if (this._helpLongFlag) {
|
|
6758
|
+
this.emit(this._helpLongFlag); // deprecated
|
|
6759
|
+
}
|
|
6042
6760
|
this.emit('afterHelp', context);
|
|
6043
|
-
|
|
6761
|
+
this._getCommandAndAncestors().forEach(command => command.emit('afterAllHelp', context));
|
|
6044
6762
|
}
|
|
6045
6763
|
|
|
6046
6764
|
/**
|
|
@@ -6183,20 +6901,6 @@ function incrementNodeInspectorPort(args) {
|
|
|
6183
6901
|
});
|
|
6184
6902
|
}
|
|
6185
6903
|
|
|
6186
|
-
/**
|
|
6187
|
-
* @param {Command} startCommand
|
|
6188
|
-
* @returns {Command[]}
|
|
6189
|
-
* @api private
|
|
6190
|
-
*/
|
|
6191
|
-
|
|
6192
|
-
function getCommandAndParents(startCommand) {
|
|
6193
|
-
const result = [];
|
|
6194
|
-
for (let command = startCommand; command; command = command.parent) {
|
|
6195
|
-
result.push(command);
|
|
6196
|
-
}
|
|
6197
|
-
return result;
|
|
6198
|
-
}
|
|
6199
|
-
|
|
6200
6904
|
command.Command = Command$1;
|
|
6201
6905
|
|
|
6202
6906
|
(function (module, exports) {
|
|
@@ -6206,27 +6910,26 @@ command.Command = Command$1;
|
|
|
6206
6910
|
const { Help } = help;
|
|
6207
6911
|
const { Option } = option;
|
|
6208
6912
|
|
|
6209
|
-
// @ts-check
|
|
6210
|
-
|
|
6211
6913
|
/**
|
|
6212
6914
|
* Expose the root command.
|
|
6213
6915
|
*/
|
|
6214
6916
|
|
|
6215
6917
|
exports = module.exports = new Command();
|
|
6216
6918
|
exports.program = exports; // More explicit access to global command.
|
|
6217
|
-
//
|
|
6919
|
+
// createArgument, createCommand, and createOption are implicitly available as they are methods on program.
|
|
6218
6920
|
|
|
6219
6921
|
/**
|
|
6220
6922
|
* Expose classes
|
|
6221
6923
|
*/
|
|
6222
6924
|
|
|
6223
|
-
exports.Argument = Argument;
|
|
6224
6925
|
exports.Command = Command;
|
|
6225
|
-
exports.
|
|
6926
|
+
exports.Option = Option;
|
|
6927
|
+
exports.Argument = Argument;
|
|
6226
6928
|
exports.Help = Help;
|
|
6929
|
+
|
|
6930
|
+
exports.CommanderError = CommanderError;
|
|
6227
6931
|
exports.InvalidArgumentError = InvalidArgumentError;
|
|
6228
|
-
exports.InvalidOptionArgumentError = InvalidArgumentError; // Deprecated
|
|
6229
|
-
exports.Option = Option;
|
|
6932
|
+
exports.InvalidOptionArgumentError = InvalidArgumentError; // Deprecated
|
|
6230
6933
|
} (commander$1, commander$1.exports));
|
|
6231
6934
|
|
|
6232
6935
|
var commanderExports = commander$1.exports;
|
|
@@ -8404,339 +9107,389 @@ function stripAnsi(string) {
|
|
|
8404
9107
|
return string.replace(regex, '');
|
|
8405
9108
|
}
|
|
8406
9109
|
|
|
8407
|
-
var
|
|
8408
|
-
|
|
8409
|
-
var clone$1 = {exports: {}};
|
|
9110
|
+
var eastasianwidth = {exports: {}};
|
|
8410
9111
|
|
|
8411
9112
|
(function (module) {
|
|
8412
|
-
var
|
|
9113
|
+
var eaw = {};
|
|
8413
9114
|
|
|
8414
|
-
|
|
8415
|
-
|
|
8416
|
-
|
|
8417
|
-
* This function supports circular references by default, but if you are certain
|
|
8418
|
-
* there are no circular references in your object, you can save some CPU time
|
|
8419
|
-
* by calling clone(obj, false).
|
|
8420
|
-
*
|
|
8421
|
-
* Caution: if `circular` is false and `parent` contains circular references,
|
|
8422
|
-
* your program may enter an infinite loop and crash.
|
|
8423
|
-
*
|
|
8424
|
-
* @param `parent` - the object to be cloned
|
|
8425
|
-
* @param `circular` - set to true if the object to be cloned may contain
|
|
8426
|
-
* circular references. (optional - true by default)
|
|
8427
|
-
* @param `depth` - set to a number if the object is only to be cloned to
|
|
8428
|
-
* a particular depth. (optional - defaults to Infinity)
|
|
8429
|
-
* @param `prototype` - sets the prototype to be used when cloning an object.
|
|
8430
|
-
* (optional - defaults to parent prototype).
|
|
8431
|
-
*/
|
|
8432
|
-
function clone(parent, circular, depth, prototype) {
|
|
8433
|
-
if (typeof circular === 'object') {
|
|
8434
|
-
depth = circular.depth;
|
|
8435
|
-
prototype = circular.prototype;
|
|
8436
|
-
circular.filter;
|
|
8437
|
-
circular = circular.circular;
|
|
8438
|
-
}
|
|
8439
|
-
// maintain two arrays for circular references, where corresponding parents
|
|
8440
|
-
// and children have the same index
|
|
8441
|
-
var allParents = [];
|
|
8442
|
-
var allChildren = [];
|
|
9115
|
+
{
|
|
9116
|
+
module.exports = eaw;
|
|
9117
|
+
}
|
|
8443
9118
|
|
|
8444
|
-
|
|
9119
|
+
eaw.eastAsianWidth = function(character) {
|
|
9120
|
+
var x = character.charCodeAt(0);
|
|
9121
|
+
var y = (character.length == 2) ? character.charCodeAt(1) : 0;
|
|
9122
|
+
var codePoint = x;
|
|
9123
|
+
if ((0xD800 <= x && x <= 0xDBFF) && (0xDC00 <= y && y <= 0xDFFF)) {
|
|
9124
|
+
x &= 0x3FF;
|
|
9125
|
+
y &= 0x3FF;
|
|
9126
|
+
codePoint = (x << 10) | y;
|
|
9127
|
+
codePoint += 0x10000;
|
|
9128
|
+
}
|
|
8445
9129
|
|
|
8446
|
-
if (
|
|
8447
|
-
|
|
9130
|
+
if ((0x3000 == codePoint) ||
|
|
9131
|
+
(0xFF01 <= codePoint && codePoint <= 0xFF60) ||
|
|
9132
|
+
(0xFFE0 <= codePoint && codePoint <= 0xFFE6)) {
|
|
9133
|
+
return 'F';
|
|
9134
|
+
}
|
|
9135
|
+
if ((0x20A9 == codePoint) ||
|
|
9136
|
+
(0xFF61 <= codePoint && codePoint <= 0xFFBE) ||
|
|
9137
|
+
(0xFFC2 <= codePoint && codePoint <= 0xFFC7) ||
|
|
9138
|
+
(0xFFCA <= codePoint && codePoint <= 0xFFCF) ||
|
|
9139
|
+
(0xFFD2 <= codePoint && codePoint <= 0xFFD7) ||
|
|
9140
|
+
(0xFFDA <= codePoint && codePoint <= 0xFFDC) ||
|
|
9141
|
+
(0xFFE8 <= codePoint && codePoint <= 0xFFEE)) {
|
|
9142
|
+
return 'H';
|
|
9143
|
+
}
|
|
9144
|
+
if ((0x1100 <= codePoint && codePoint <= 0x115F) ||
|
|
9145
|
+
(0x11A3 <= codePoint && codePoint <= 0x11A7) ||
|
|
9146
|
+
(0x11FA <= codePoint && codePoint <= 0x11FF) ||
|
|
9147
|
+
(0x2329 <= codePoint && codePoint <= 0x232A) ||
|
|
9148
|
+
(0x2E80 <= codePoint && codePoint <= 0x2E99) ||
|
|
9149
|
+
(0x2E9B <= codePoint && codePoint <= 0x2EF3) ||
|
|
9150
|
+
(0x2F00 <= codePoint && codePoint <= 0x2FD5) ||
|
|
9151
|
+
(0x2FF0 <= codePoint && codePoint <= 0x2FFB) ||
|
|
9152
|
+
(0x3001 <= codePoint && codePoint <= 0x303E) ||
|
|
9153
|
+
(0x3041 <= codePoint && codePoint <= 0x3096) ||
|
|
9154
|
+
(0x3099 <= codePoint && codePoint <= 0x30FF) ||
|
|
9155
|
+
(0x3105 <= codePoint && codePoint <= 0x312D) ||
|
|
9156
|
+
(0x3131 <= codePoint && codePoint <= 0x318E) ||
|
|
9157
|
+
(0x3190 <= codePoint && codePoint <= 0x31BA) ||
|
|
9158
|
+
(0x31C0 <= codePoint && codePoint <= 0x31E3) ||
|
|
9159
|
+
(0x31F0 <= codePoint && codePoint <= 0x321E) ||
|
|
9160
|
+
(0x3220 <= codePoint && codePoint <= 0x3247) ||
|
|
9161
|
+
(0x3250 <= codePoint && codePoint <= 0x32FE) ||
|
|
9162
|
+
(0x3300 <= codePoint && codePoint <= 0x4DBF) ||
|
|
9163
|
+
(0x4E00 <= codePoint && codePoint <= 0xA48C) ||
|
|
9164
|
+
(0xA490 <= codePoint && codePoint <= 0xA4C6) ||
|
|
9165
|
+
(0xA960 <= codePoint && codePoint <= 0xA97C) ||
|
|
9166
|
+
(0xAC00 <= codePoint && codePoint <= 0xD7A3) ||
|
|
9167
|
+
(0xD7B0 <= codePoint && codePoint <= 0xD7C6) ||
|
|
9168
|
+
(0xD7CB <= codePoint && codePoint <= 0xD7FB) ||
|
|
9169
|
+
(0xF900 <= codePoint && codePoint <= 0xFAFF) ||
|
|
9170
|
+
(0xFE10 <= codePoint && codePoint <= 0xFE19) ||
|
|
9171
|
+
(0xFE30 <= codePoint && codePoint <= 0xFE52) ||
|
|
9172
|
+
(0xFE54 <= codePoint && codePoint <= 0xFE66) ||
|
|
9173
|
+
(0xFE68 <= codePoint && codePoint <= 0xFE6B) ||
|
|
9174
|
+
(0x1B000 <= codePoint && codePoint <= 0x1B001) ||
|
|
9175
|
+
(0x1F200 <= codePoint && codePoint <= 0x1F202) ||
|
|
9176
|
+
(0x1F210 <= codePoint && codePoint <= 0x1F23A) ||
|
|
9177
|
+
(0x1F240 <= codePoint && codePoint <= 0x1F248) ||
|
|
9178
|
+
(0x1F250 <= codePoint && codePoint <= 0x1F251) ||
|
|
9179
|
+
(0x20000 <= codePoint && codePoint <= 0x2F73F) ||
|
|
9180
|
+
(0x2B740 <= codePoint && codePoint <= 0x2FFFD) ||
|
|
9181
|
+
(0x30000 <= codePoint && codePoint <= 0x3FFFD)) {
|
|
9182
|
+
return 'W';
|
|
9183
|
+
}
|
|
9184
|
+
if ((0x0020 <= codePoint && codePoint <= 0x007E) ||
|
|
9185
|
+
(0x00A2 <= codePoint && codePoint <= 0x00A3) ||
|
|
9186
|
+
(0x00A5 <= codePoint && codePoint <= 0x00A6) ||
|
|
9187
|
+
(0x00AC == codePoint) ||
|
|
9188
|
+
(0x00AF == codePoint) ||
|
|
9189
|
+
(0x27E6 <= codePoint && codePoint <= 0x27ED) ||
|
|
9190
|
+
(0x2985 <= codePoint && codePoint <= 0x2986)) {
|
|
9191
|
+
return 'Na';
|
|
9192
|
+
}
|
|
9193
|
+
if ((0x00A1 == codePoint) ||
|
|
9194
|
+
(0x00A4 == codePoint) ||
|
|
9195
|
+
(0x00A7 <= codePoint && codePoint <= 0x00A8) ||
|
|
9196
|
+
(0x00AA == codePoint) ||
|
|
9197
|
+
(0x00AD <= codePoint && codePoint <= 0x00AE) ||
|
|
9198
|
+
(0x00B0 <= codePoint && codePoint <= 0x00B4) ||
|
|
9199
|
+
(0x00B6 <= codePoint && codePoint <= 0x00BA) ||
|
|
9200
|
+
(0x00BC <= codePoint && codePoint <= 0x00BF) ||
|
|
9201
|
+
(0x00C6 == codePoint) ||
|
|
9202
|
+
(0x00D0 == codePoint) ||
|
|
9203
|
+
(0x00D7 <= codePoint && codePoint <= 0x00D8) ||
|
|
9204
|
+
(0x00DE <= codePoint && codePoint <= 0x00E1) ||
|
|
9205
|
+
(0x00E6 == codePoint) ||
|
|
9206
|
+
(0x00E8 <= codePoint && codePoint <= 0x00EA) ||
|
|
9207
|
+
(0x00EC <= codePoint && codePoint <= 0x00ED) ||
|
|
9208
|
+
(0x00F0 == codePoint) ||
|
|
9209
|
+
(0x00F2 <= codePoint && codePoint <= 0x00F3) ||
|
|
9210
|
+
(0x00F7 <= codePoint && codePoint <= 0x00FA) ||
|
|
9211
|
+
(0x00FC == codePoint) ||
|
|
9212
|
+
(0x00FE == codePoint) ||
|
|
9213
|
+
(0x0101 == codePoint) ||
|
|
9214
|
+
(0x0111 == codePoint) ||
|
|
9215
|
+
(0x0113 == codePoint) ||
|
|
9216
|
+
(0x011B == codePoint) ||
|
|
9217
|
+
(0x0126 <= codePoint && codePoint <= 0x0127) ||
|
|
9218
|
+
(0x012B == codePoint) ||
|
|
9219
|
+
(0x0131 <= codePoint && codePoint <= 0x0133) ||
|
|
9220
|
+
(0x0138 == codePoint) ||
|
|
9221
|
+
(0x013F <= codePoint && codePoint <= 0x0142) ||
|
|
9222
|
+
(0x0144 == codePoint) ||
|
|
9223
|
+
(0x0148 <= codePoint && codePoint <= 0x014B) ||
|
|
9224
|
+
(0x014D == codePoint) ||
|
|
9225
|
+
(0x0152 <= codePoint && codePoint <= 0x0153) ||
|
|
9226
|
+
(0x0166 <= codePoint && codePoint <= 0x0167) ||
|
|
9227
|
+
(0x016B == codePoint) ||
|
|
9228
|
+
(0x01CE == codePoint) ||
|
|
9229
|
+
(0x01D0 == codePoint) ||
|
|
9230
|
+
(0x01D2 == codePoint) ||
|
|
9231
|
+
(0x01D4 == codePoint) ||
|
|
9232
|
+
(0x01D6 == codePoint) ||
|
|
9233
|
+
(0x01D8 == codePoint) ||
|
|
9234
|
+
(0x01DA == codePoint) ||
|
|
9235
|
+
(0x01DC == codePoint) ||
|
|
9236
|
+
(0x0251 == codePoint) ||
|
|
9237
|
+
(0x0261 == codePoint) ||
|
|
9238
|
+
(0x02C4 == codePoint) ||
|
|
9239
|
+
(0x02C7 == codePoint) ||
|
|
9240
|
+
(0x02C9 <= codePoint && codePoint <= 0x02CB) ||
|
|
9241
|
+
(0x02CD == codePoint) ||
|
|
9242
|
+
(0x02D0 == codePoint) ||
|
|
9243
|
+
(0x02D8 <= codePoint && codePoint <= 0x02DB) ||
|
|
9244
|
+
(0x02DD == codePoint) ||
|
|
9245
|
+
(0x02DF == codePoint) ||
|
|
9246
|
+
(0x0300 <= codePoint && codePoint <= 0x036F) ||
|
|
9247
|
+
(0x0391 <= codePoint && codePoint <= 0x03A1) ||
|
|
9248
|
+
(0x03A3 <= codePoint && codePoint <= 0x03A9) ||
|
|
9249
|
+
(0x03B1 <= codePoint && codePoint <= 0x03C1) ||
|
|
9250
|
+
(0x03C3 <= codePoint && codePoint <= 0x03C9) ||
|
|
9251
|
+
(0x0401 == codePoint) ||
|
|
9252
|
+
(0x0410 <= codePoint && codePoint <= 0x044F) ||
|
|
9253
|
+
(0x0451 == codePoint) ||
|
|
9254
|
+
(0x2010 == codePoint) ||
|
|
9255
|
+
(0x2013 <= codePoint && codePoint <= 0x2016) ||
|
|
9256
|
+
(0x2018 <= codePoint && codePoint <= 0x2019) ||
|
|
9257
|
+
(0x201C <= codePoint && codePoint <= 0x201D) ||
|
|
9258
|
+
(0x2020 <= codePoint && codePoint <= 0x2022) ||
|
|
9259
|
+
(0x2024 <= codePoint && codePoint <= 0x2027) ||
|
|
9260
|
+
(0x2030 == codePoint) ||
|
|
9261
|
+
(0x2032 <= codePoint && codePoint <= 0x2033) ||
|
|
9262
|
+
(0x2035 == codePoint) ||
|
|
9263
|
+
(0x203B == codePoint) ||
|
|
9264
|
+
(0x203E == codePoint) ||
|
|
9265
|
+
(0x2074 == codePoint) ||
|
|
9266
|
+
(0x207F == codePoint) ||
|
|
9267
|
+
(0x2081 <= codePoint && codePoint <= 0x2084) ||
|
|
9268
|
+
(0x20AC == codePoint) ||
|
|
9269
|
+
(0x2103 == codePoint) ||
|
|
9270
|
+
(0x2105 == codePoint) ||
|
|
9271
|
+
(0x2109 == codePoint) ||
|
|
9272
|
+
(0x2113 == codePoint) ||
|
|
9273
|
+
(0x2116 == codePoint) ||
|
|
9274
|
+
(0x2121 <= codePoint && codePoint <= 0x2122) ||
|
|
9275
|
+
(0x2126 == codePoint) ||
|
|
9276
|
+
(0x212B == codePoint) ||
|
|
9277
|
+
(0x2153 <= codePoint && codePoint <= 0x2154) ||
|
|
9278
|
+
(0x215B <= codePoint && codePoint <= 0x215E) ||
|
|
9279
|
+
(0x2160 <= codePoint && codePoint <= 0x216B) ||
|
|
9280
|
+
(0x2170 <= codePoint && codePoint <= 0x2179) ||
|
|
9281
|
+
(0x2189 == codePoint) ||
|
|
9282
|
+
(0x2190 <= codePoint && codePoint <= 0x2199) ||
|
|
9283
|
+
(0x21B8 <= codePoint && codePoint <= 0x21B9) ||
|
|
9284
|
+
(0x21D2 == codePoint) ||
|
|
9285
|
+
(0x21D4 == codePoint) ||
|
|
9286
|
+
(0x21E7 == codePoint) ||
|
|
9287
|
+
(0x2200 == codePoint) ||
|
|
9288
|
+
(0x2202 <= codePoint && codePoint <= 0x2203) ||
|
|
9289
|
+
(0x2207 <= codePoint && codePoint <= 0x2208) ||
|
|
9290
|
+
(0x220B == codePoint) ||
|
|
9291
|
+
(0x220F == codePoint) ||
|
|
9292
|
+
(0x2211 == codePoint) ||
|
|
9293
|
+
(0x2215 == codePoint) ||
|
|
9294
|
+
(0x221A == codePoint) ||
|
|
9295
|
+
(0x221D <= codePoint && codePoint <= 0x2220) ||
|
|
9296
|
+
(0x2223 == codePoint) ||
|
|
9297
|
+
(0x2225 == codePoint) ||
|
|
9298
|
+
(0x2227 <= codePoint && codePoint <= 0x222C) ||
|
|
9299
|
+
(0x222E == codePoint) ||
|
|
9300
|
+
(0x2234 <= codePoint && codePoint <= 0x2237) ||
|
|
9301
|
+
(0x223C <= codePoint && codePoint <= 0x223D) ||
|
|
9302
|
+
(0x2248 == codePoint) ||
|
|
9303
|
+
(0x224C == codePoint) ||
|
|
9304
|
+
(0x2252 == codePoint) ||
|
|
9305
|
+
(0x2260 <= codePoint && codePoint <= 0x2261) ||
|
|
9306
|
+
(0x2264 <= codePoint && codePoint <= 0x2267) ||
|
|
9307
|
+
(0x226A <= codePoint && codePoint <= 0x226B) ||
|
|
9308
|
+
(0x226E <= codePoint && codePoint <= 0x226F) ||
|
|
9309
|
+
(0x2282 <= codePoint && codePoint <= 0x2283) ||
|
|
9310
|
+
(0x2286 <= codePoint && codePoint <= 0x2287) ||
|
|
9311
|
+
(0x2295 == codePoint) ||
|
|
9312
|
+
(0x2299 == codePoint) ||
|
|
9313
|
+
(0x22A5 == codePoint) ||
|
|
9314
|
+
(0x22BF == codePoint) ||
|
|
9315
|
+
(0x2312 == codePoint) ||
|
|
9316
|
+
(0x2460 <= codePoint && codePoint <= 0x24E9) ||
|
|
9317
|
+
(0x24EB <= codePoint && codePoint <= 0x254B) ||
|
|
9318
|
+
(0x2550 <= codePoint && codePoint <= 0x2573) ||
|
|
9319
|
+
(0x2580 <= codePoint && codePoint <= 0x258F) ||
|
|
9320
|
+
(0x2592 <= codePoint && codePoint <= 0x2595) ||
|
|
9321
|
+
(0x25A0 <= codePoint && codePoint <= 0x25A1) ||
|
|
9322
|
+
(0x25A3 <= codePoint && codePoint <= 0x25A9) ||
|
|
9323
|
+
(0x25B2 <= codePoint && codePoint <= 0x25B3) ||
|
|
9324
|
+
(0x25B6 <= codePoint && codePoint <= 0x25B7) ||
|
|
9325
|
+
(0x25BC <= codePoint && codePoint <= 0x25BD) ||
|
|
9326
|
+
(0x25C0 <= codePoint && codePoint <= 0x25C1) ||
|
|
9327
|
+
(0x25C6 <= codePoint && codePoint <= 0x25C8) ||
|
|
9328
|
+
(0x25CB == codePoint) ||
|
|
9329
|
+
(0x25CE <= codePoint && codePoint <= 0x25D1) ||
|
|
9330
|
+
(0x25E2 <= codePoint && codePoint <= 0x25E5) ||
|
|
9331
|
+
(0x25EF == codePoint) ||
|
|
9332
|
+
(0x2605 <= codePoint && codePoint <= 0x2606) ||
|
|
9333
|
+
(0x2609 == codePoint) ||
|
|
9334
|
+
(0x260E <= codePoint && codePoint <= 0x260F) ||
|
|
9335
|
+
(0x2614 <= codePoint && codePoint <= 0x2615) ||
|
|
9336
|
+
(0x261C == codePoint) ||
|
|
9337
|
+
(0x261E == codePoint) ||
|
|
9338
|
+
(0x2640 == codePoint) ||
|
|
9339
|
+
(0x2642 == codePoint) ||
|
|
9340
|
+
(0x2660 <= codePoint && codePoint <= 0x2661) ||
|
|
9341
|
+
(0x2663 <= codePoint && codePoint <= 0x2665) ||
|
|
9342
|
+
(0x2667 <= codePoint && codePoint <= 0x266A) ||
|
|
9343
|
+
(0x266C <= codePoint && codePoint <= 0x266D) ||
|
|
9344
|
+
(0x266F == codePoint) ||
|
|
9345
|
+
(0x269E <= codePoint && codePoint <= 0x269F) ||
|
|
9346
|
+
(0x26BE <= codePoint && codePoint <= 0x26BF) ||
|
|
9347
|
+
(0x26C4 <= codePoint && codePoint <= 0x26CD) ||
|
|
9348
|
+
(0x26CF <= codePoint && codePoint <= 0x26E1) ||
|
|
9349
|
+
(0x26E3 == codePoint) ||
|
|
9350
|
+
(0x26E8 <= codePoint && codePoint <= 0x26FF) ||
|
|
9351
|
+
(0x273D == codePoint) ||
|
|
9352
|
+
(0x2757 == codePoint) ||
|
|
9353
|
+
(0x2776 <= codePoint && codePoint <= 0x277F) ||
|
|
9354
|
+
(0x2B55 <= codePoint && codePoint <= 0x2B59) ||
|
|
9355
|
+
(0x3248 <= codePoint && codePoint <= 0x324F) ||
|
|
9356
|
+
(0xE000 <= codePoint && codePoint <= 0xF8FF) ||
|
|
9357
|
+
(0xFE00 <= codePoint && codePoint <= 0xFE0F) ||
|
|
9358
|
+
(0xFFFD == codePoint) ||
|
|
9359
|
+
(0x1F100 <= codePoint && codePoint <= 0x1F10A) ||
|
|
9360
|
+
(0x1F110 <= codePoint && codePoint <= 0x1F12D) ||
|
|
9361
|
+
(0x1F130 <= codePoint && codePoint <= 0x1F169) ||
|
|
9362
|
+
(0x1F170 <= codePoint && codePoint <= 0x1F19A) ||
|
|
9363
|
+
(0xE0100 <= codePoint && codePoint <= 0xE01EF) ||
|
|
9364
|
+
(0xF0000 <= codePoint && codePoint <= 0xFFFFD) ||
|
|
9365
|
+
(0x100000 <= codePoint && codePoint <= 0x10FFFD)) {
|
|
9366
|
+
return 'A';
|
|
9367
|
+
}
|
|
8448
9368
|
|
|
8449
|
-
|
|
8450
|
-
|
|
9369
|
+
return 'N';
|
|
9370
|
+
};
|
|
8451
9371
|
|
|
8452
|
-
|
|
8453
|
-
|
|
8454
|
-
|
|
8455
|
-
|
|
8456
|
-
|
|
9372
|
+
eaw.characterLength = function(character) {
|
|
9373
|
+
var code = this.eastAsianWidth(character);
|
|
9374
|
+
if (code == 'F' || code == 'W' || code == 'A') {
|
|
9375
|
+
return 2;
|
|
9376
|
+
} else {
|
|
9377
|
+
return 1;
|
|
9378
|
+
}
|
|
9379
|
+
};
|
|
8457
9380
|
|
|
8458
|
-
|
|
8459
|
-
|
|
9381
|
+
// Split a string considering surrogate-pairs.
|
|
9382
|
+
function stringToArray(string) {
|
|
9383
|
+
return string.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
|
|
9384
|
+
}
|
|
8460
9385
|
|
|
8461
|
-
|
|
8462
|
-
|
|
8463
|
-
|
|
8464
|
-
|
|
8465
|
-
|
|
8466
|
-
|
|
8467
|
-
|
|
8468
|
-
|
|
8469
|
-
} else if (clone.__isRegExp(parent)) {
|
|
8470
|
-
child = new RegExp(parent.source, __getRegExpFlags(parent));
|
|
8471
|
-
if (parent.lastIndex) child.lastIndex = parent.lastIndex;
|
|
8472
|
-
} else if (clone.__isDate(parent)) {
|
|
8473
|
-
child = new Date(parent.getTime());
|
|
8474
|
-
} else if (useBuffer && Buffer.isBuffer(parent)) {
|
|
8475
|
-
if (Buffer.allocUnsafe) {
|
|
8476
|
-
// Node.js >= 4.5.0
|
|
8477
|
-
child = Buffer.allocUnsafe(parent.length);
|
|
8478
|
-
} else {
|
|
8479
|
-
// Older Node.js versions
|
|
8480
|
-
child = new Buffer(parent.length);
|
|
8481
|
-
}
|
|
8482
|
-
parent.copy(child);
|
|
8483
|
-
return child;
|
|
8484
|
-
} else {
|
|
8485
|
-
if (typeof prototype == 'undefined') {
|
|
8486
|
-
proto = Object.getPrototypeOf(parent);
|
|
8487
|
-
child = Object.create(proto);
|
|
8488
|
-
}
|
|
8489
|
-
else {
|
|
8490
|
-
child = Object.create(prototype);
|
|
8491
|
-
proto = prototype;
|
|
8492
|
-
}
|
|
8493
|
-
}
|
|
8494
|
-
|
|
8495
|
-
if (circular) {
|
|
8496
|
-
var index = allParents.indexOf(parent);
|
|
9386
|
+
eaw.length = function(string) {
|
|
9387
|
+
var characters = stringToArray(string);
|
|
9388
|
+
var len = 0;
|
|
9389
|
+
for (var i = 0; i < characters.length; i++) {
|
|
9390
|
+
len = len + this.characterLength(characters[i]);
|
|
9391
|
+
}
|
|
9392
|
+
return len;
|
|
9393
|
+
};
|
|
8497
9394
|
|
|
8498
|
-
|
|
8499
|
-
|
|
8500
|
-
|
|
8501
|
-
|
|
8502
|
-
|
|
9395
|
+
eaw.slice = function(text, start, end) {
|
|
9396
|
+
textLen = eaw.length(text);
|
|
9397
|
+
start = start ? start : 0;
|
|
9398
|
+
end = end ? end : 1;
|
|
9399
|
+
if (start < 0) {
|
|
9400
|
+
start = textLen + start;
|
|
9401
|
+
}
|
|
9402
|
+
if (end < 0) {
|
|
9403
|
+
end = textLen + end;
|
|
9404
|
+
}
|
|
9405
|
+
var result = '';
|
|
9406
|
+
var eawLen = 0;
|
|
9407
|
+
var chars = stringToArray(text);
|
|
9408
|
+
for (var i = 0; i < chars.length; i++) {
|
|
9409
|
+
var char = chars[i];
|
|
9410
|
+
var charLen = eaw.length(char);
|
|
9411
|
+
if (eawLen >= start - (charLen == 2 ? 1 : 0)) {
|
|
9412
|
+
if (eawLen + charLen <= end) {
|
|
9413
|
+
result += char;
|
|
9414
|
+
} else {
|
|
9415
|
+
break;
|
|
9416
|
+
}
|
|
8503
9417
|
}
|
|
9418
|
+
eawLen += charLen;
|
|
9419
|
+
}
|
|
9420
|
+
return result;
|
|
9421
|
+
};
|
|
9422
|
+
} (eastasianwidth));
|
|
8504
9423
|
|
|
8505
|
-
|
|
8506
|
-
|
|
8507
|
-
if (proto) {
|
|
8508
|
-
attrs = Object.getOwnPropertyDescriptor(proto, i);
|
|
8509
|
-
}
|
|
8510
|
-
|
|
8511
|
-
if (attrs && attrs.set == null) {
|
|
8512
|
-
continue;
|
|
8513
|
-
}
|
|
8514
|
-
child[i] = _clone(parent[i], depth - 1);
|
|
8515
|
-
}
|
|
9424
|
+
var eastasianwidthExports = eastasianwidth.exports;
|
|
9425
|
+
var eastAsianWidth = /*@__PURE__*/getDefaultExportFromCjs(eastasianwidthExports);
|
|
8516
9426
|
|
|
8517
|
-
|
|
8518
|
-
|
|
9427
|
+
var emojiRegex = () => {
|
|
9428
|
+
// https://mths.be/emoji
|
|
9429
|
+
return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
|
|
9430
|
+
};
|
|
8519
9431
|
|
|
8520
|
-
|
|
9432
|
+
function stringWidth(string, options) {
|
|
9433
|
+
if (typeof string !== 'string' || string.length === 0) {
|
|
9434
|
+
return 0;
|
|
8521
9435
|
}
|
|
8522
9436
|
|
|
8523
|
-
|
|
8524
|
-
|
|
8525
|
-
|
|
8526
|
-
|
|
8527
|
-
* USE WITH CAUTION! This may not behave as you wish if you do not know how this
|
|
8528
|
-
* works.
|
|
8529
|
-
*/
|
|
8530
|
-
clone.clonePrototype = function clonePrototype(parent) {
|
|
8531
|
-
if (parent === null)
|
|
8532
|
-
return null;
|
|
8533
|
-
|
|
8534
|
-
var c = function () {};
|
|
8535
|
-
c.prototype = parent;
|
|
8536
|
-
return new c();
|
|
9437
|
+
options = {
|
|
9438
|
+
ambiguousIsNarrow: true,
|
|
9439
|
+
countAnsiEscapeCodes: false,
|
|
9440
|
+
...options,
|
|
8537
9441
|
};
|
|
8538
9442
|
|
|
8539
|
-
|
|
8540
|
-
|
|
8541
|
-
|
|
8542
|
-
return Object.prototype.toString.call(o);
|
|
8543
|
-
} clone.__objToStr = __objToStr;
|
|
8544
|
-
|
|
8545
|
-
function __isDate(o) {
|
|
8546
|
-
return typeof o === 'object' && __objToStr(o) === '[object Date]';
|
|
8547
|
-
} clone.__isDate = __isDate;
|
|
8548
|
-
|
|
8549
|
-
function __isArray(o) {
|
|
8550
|
-
return typeof o === 'object' && __objToStr(o) === '[object Array]';
|
|
8551
|
-
} clone.__isArray = __isArray;
|
|
8552
|
-
|
|
8553
|
-
function __isRegExp(o) {
|
|
8554
|
-
return typeof o === 'object' && __objToStr(o) === '[object RegExp]';
|
|
8555
|
-
} clone.__isRegExp = __isRegExp;
|
|
8556
|
-
|
|
8557
|
-
function __getRegExpFlags(re) {
|
|
8558
|
-
var flags = '';
|
|
8559
|
-
if (re.global) flags += 'g';
|
|
8560
|
-
if (re.ignoreCase) flags += 'i';
|
|
8561
|
-
if (re.multiline) flags += 'm';
|
|
8562
|
-
return flags;
|
|
8563
|
-
} clone.__getRegExpFlags = __getRegExpFlags;
|
|
8564
|
-
|
|
8565
|
-
return clone;
|
|
8566
|
-
})();
|
|
8567
|
-
|
|
8568
|
-
if (module.exports) {
|
|
8569
|
-
module.exports = clone;
|
|
8570
|
-
}
|
|
8571
|
-
} (clone$1));
|
|
8572
|
-
|
|
8573
|
-
var cloneExports = clone$1.exports;
|
|
9443
|
+
if (!options.countAnsiEscapeCodes) {
|
|
9444
|
+
string = stripAnsi(string);
|
|
9445
|
+
}
|
|
8574
9446
|
|
|
8575
|
-
|
|
9447
|
+
if (string.length === 0) {
|
|
9448
|
+
return 0;
|
|
9449
|
+
}
|
|
8576
9450
|
|
|
8577
|
-
|
|
8578
|
-
|
|
9451
|
+
const ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2;
|
|
9452
|
+
let width = 0;
|
|
8579
9453
|
|
|
8580
|
-
|
|
8581
|
-
|
|
8582
|
-
options[key] = clone(defaults[key]);
|
|
8583
|
-
}
|
|
8584
|
-
});
|
|
9454
|
+
for (const {segment: character} of new Intl.Segmenter().segment(string)) {
|
|
9455
|
+
const codePoint = character.codePointAt(0);
|
|
8585
9456
|
|
|
8586
|
-
|
|
8587
|
-
|
|
9457
|
+
// Ignore control characters
|
|
9458
|
+
if (codePoint <= 0x1F || (codePoint >= 0x7F && codePoint <= 0x9F)) {
|
|
9459
|
+
continue;
|
|
9460
|
+
}
|
|
8588
9461
|
|
|
8589
|
-
|
|
8590
|
-
|
|
8591
|
-
|
|
8592
|
-
|
|
8593
|
-
[ 0x0610, 0x0615 ], [ 0x064B, 0x065E ], [ 0x0670, 0x0670 ],
|
|
8594
|
-
[ 0x06D6, 0x06E4 ], [ 0x06E7, 0x06E8 ], [ 0x06EA, 0x06ED ],
|
|
8595
|
-
[ 0x070F, 0x070F ], [ 0x0711, 0x0711 ], [ 0x0730, 0x074A ],
|
|
8596
|
-
[ 0x07A6, 0x07B0 ], [ 0x07EB, 0x07F3 ], [ 0x0901, 0x0902 ],
|
|
8597
|
-
[ 0x093C, 0x093C ], [ 0x0941, 0x0948 ], [ 0x094D, 0x094D ],
|
|
8598
|
-
[ 0x0951, 0x0954 ], [ 0x0962, 0x0963 ], [ 0x0981, 0x0981 ],
|
|
8599
|
-
[ 0x09BC, 0x09BC ], [ 0x09C1, 0x09C4 ], [ 0x09CD, 0x09CD ],
|
|
8600
|
-
[ 0x09E2, 0x09E3 ], [ 0x0A01, 0x0A02 ], [ 0x0A3C, 0x0A3C ],
|
|
8601
|
-
[ 0x0A41, 0x0A42 ], [ 0x0A47, 0x0A48 ], [ 0x0A4B, 0x0A4D ],
|
|
8602
|
-
[ 0x0A70, 0x0A71 ], [ 0x0A81, 0x0A82 ], [ 0x0ABC, 0x0ABC ],
|
|
8603
|
-
[ 0x0AC1, 0x0AC5 ], [ 0x0AC7, 0x0AC8 ], [ 0x0ACD, 0x0ACD ],
|
|
8604
|
-
[ 0x0AE2, 0x0AE3 ], [ 0x0B01, 0x0B01 ], [ 0x0B3C, 0x0B3C ],
|
|
8605
|
-
[ 0x0B3F, 0x0B3F ], [ 0x0B41, 0x0B43 ], [ 0x0B4D, 0x0B4D ],
|
|
8606
|
-
[ 0x0B56, 0x0B56 ], [ 0x0B82, 0x0B82 ], [ 0x0BC0, 0x0BC0 ],
|
|
8607
|
-
[ 0x0BCD, 0x0BCD ], [ 0x0C3E, 0x0C40 ], [ 0x0C46, 0x0C48 ],
|
|
8608
|
-
[ 0x0C4A, 0x0C4D ], [ 0x0C55, 0x0C56 ], [ 0x0CBC, 0x0CBC ],
|
|
8609
|
-
[ 0x0CBF, 0x0CBF ], [ 0x0CC6, 0x0CC6 ], [ 0x0CCC, 0x0CCD ],
|
|
8610
|
-
[ 0x0CE2, 0x0CE3 ], [ 0x0D41, 0x0D43 ], [ 0x0D4D, 0x0D4D ],
|
|
8611
|
-
[ 0x0DCA, 0x0DCA ], [ 0x0DD2, 0x0DD4 ], [ 0x0DD6, 0x0DD6 ],
|
|
8612
|
-
[ 0x0E31, 0x0E31 ], [ 0x0E34, 0x0E3A ], [ 0x0E47, 0x0E4E ],
|
|
8613
|
-
[ 0x0EB1, 0x0EB1 ], [ 0x0EB4, 0x0EB9 ], [ 0x0EBB, 0x0EBC ],
|
|
8614
|
-
[ 0x0EC8, 0x0ECD ], [ 0x0F18, 0x0F19 ], [ 0x0F35, 0x0F35 ],
|
|
8615
|
-
[ 0x0F37, 0x0F37 ], [ 0x0F39, 0x0F39 ], [ 0x0F71, 0x0F7E ],
|
|
8616
|
-
[ 0x0F80, 0x0F84 ], [ 0x0F86, 0x0F87 ], [ 0x0F90, 0x0F97 ],
|
|
8617
|
-
[ 0x0F99, 0x0FBC ], [ 0x0FC6, 0x0FC6 ], [ 0x102D, 0x1030 ],
|
|
8618
|
-
[ 0x1032, 0x1032 ], [ 0x1036, 0x1037 ], [ 0x1039, 0x1039 ],
|
|
8619
|
-
[ 0x1058, 0x1059 ], [ 0x1160, 0x11FF ], [ 0x135F, 0x135F ],
|
|
8620
|
-
[ 0x1712, 0x1714 ], [ 0x1732, 0x1734 ], [ 0x1752, 0x1753 ],
|
|
8621
|
-
[ 0x1772, 0x1773 ], [ 0x17B4, 0x17B5 ], [ 0x17B7, 0x17BD ],
|
|
8622
|
-
[ 0x17C6, 0x17C6 ], [ 0x17C9, 0x17D3 ], [ 0x17DD, 0x17DD ],
|
|
8623
|
-
[ 0x180B, 0x180D ], [ 0x18A9, 0x18A9 ], [ 0x1920, 0x1922 ],
|
|
8624
|
-
[ 0x1927, 0x1928 ], [ 0x1932, 0x1932 ], [ 0x1939, 0x193B ],
|
|
8625
|
-
[ 0x1A17, 0x1A18 ], [ 0x1B00, 0x1B03 ], [ 0x1B34, 0x1B34 ],
|
|
8626
|
-
[ 0x1B36, 0x1B3A ], [ 0x1B3C, 0x1B3C ], [ 0x1B42, 0x1B42 ],
|
|
8627
|
-
[ 0x1B6B, 0x1B73 ], [ 0x1DC0, 0x1DCA ], [ 0x1DFE, 0x1DFF ],
|
|
8628
|
-
[ 0x200B, 0x200F ], [ 0x202A, 0x202E ], [ 0x2060, 0x2063 ],
|
|
8629
|
-
[ 0x206A, 0x206F ], [ 0x20D0, 0x20EF ], [ 0x302A, 0x302F ],
|
|
8630
|
-
[ 0x3099, 0x309A ], [ 0xA806, 0xA806 ], [ 0xA80B, 0xA80B ],
|
|
8631
|
-
[ 0xA825, 0xA826 ], [ 0xFB1E, 0xFB1E ], [ 0xFE00, 0xFE0F ],
|
|
8632
|
-
[ 0xFE20, 0xFE23 ], [ 0xFEFF, 0xFEFF ], [ 0xFFF9, 0xFFFB ],
|
|
8633
|
-
[ 0x10A01, 0x10A03 ], [ 0x10A05, 0x10A06 ], [ 0x10A0C, 0x10A0F ],
|
|
8634
|
-
[ 0x10A38, 0x10A3A ], [ 0x10A3F, 0x10A3F ], [ 0x1D167, 0x1D169 ],
|
|
8635
|
-
[ 0x1D173, 0x1D182 ], [ 0x1D185, 0x1D18B ], [ 0x1D1AA, 0x1D1AD ],
|
|
8636
|
-
[ 0x1D242, 0x1D244 ], [ 0xE0001, 0xE0001 ], [ 0xE0020, 0xE007F ],
|
|
8637
|
-
[ 0xE0100, 0xE01EF ]
|
|
8638
|
-
];
|
|
9462
|
+
// Ignore combining characters
|
|
9463
|
+
if (codePoint >= 0x3_00 && codePoint <= 0x3_6F) {
|
|
9464
|
+
continue;
|
|
9465
|
+
}
|
|
8639
9466
|
|
|
8640
|
-
|
|
8641
|
-
|
|
9467
|
+
if (emojiRegex().test(character)) {
|
|
9468
|
+
width += 2;
|
|
9469
|
+
continue;
|
|
9470
|
+
}
|
|
8642
9471
|
|
|
8643
|
-
|
|
8644
|
-
|
|
8645
|
-
|
|
8646
|
-
|
|
9472
|
+
const code = eastAsianWidth.eastAsianWidth(character);
|
|
9473
|
+
switch (code) {
|
|
9474
|
+
case 'F':
|
|
9475
|
+
case 'W': {
|
|
9476
|
+
width += 2;
|
|
9477
|
+
break;
|
|
9478
|
+
}
|
|
8647
9479
|
|
|
8648
|
-
|
|
8649
|
-
|
|
8650
|
-
|
|
9480
|
+
case 'A': {
|
|
9481
|
+
width += ambiguousCharacterWidth;
|
|
9482
|
+
break;
|
|
9483
|
+
}
|
|
8651
9484
|
|
|
8652
|
-
|
|
8653
|
-
|
|
8654
|
-
|
|
8655
|
-
|
|
8656
|
-
|
|
8657
|
-
};
|
|
9485
|
+
default: {
|
|
9486
|
+
width += 1;
|
|
9487
|
+
}
|
|
9488
|
+
}
|
|
9489
|
+
}
|
|
8658
9490
|
|
|
8659
|
-
|
|
8660
|
-
|
|
8661
|
-
* character as follows:
|
|
8662
|
-
* - The null character (U+0000) has a column width of 0.
|
|
8663
|
-
* - Other C0/C1 control characters and DEL will lead to a return value
|
|
8664
|
-
* of -1.
|
|
8665
|
-
* - Non-spacing and enclosing combining characters (general category
|
|
8666
|
-
* code Mn or Me in the
|
|
8667
|
-
* Unicode database) have a column width of 0.
|
|
8668
|
-
* - SOFT HYPHEN (U+00AD) has a column width of 1.
|
|
8669
|
-
* - Other format characters (general category code Cf in the Unicode
|
|
8670
|
-
* database) and ZERO WIDTH
|
|
8671
|
-
* SPACE (U+200B) have a column width of 0.
|
|
8672
|
-
* - Hangul Jamo medial vowels and final consonants (U+1160-U+11FF)
|
|
8673
|
-
* have a column width of 0.
|
|
8674
|
-
* - Spacing characters in the East Asian Wide (W) or East Asian
|
|
8675
|
-
* Full-width (F) category as
|
|
8676
|
-
* defined in Unicode Technical Report #11 have a column width of 2.
|
|
8677
|
-
* - All remaining characters (including all printable ISO 8859-1 and
|
|
8678
|
-
* WGL4 characters, Unicode control characters, etc.) have a column
|
|
8679
|
-
* width of 1.
|
|
8680
|
-
* This implementation assumes that characters are encoded in ISO 10646.
|
|
8681
|
-
*/
|
|
8682
|
-
|
|
8683
|
-
function wcswidth(str, opts) {
|
|
8684
|
-
if (typeof str !== 'string') return wcwidth(str, opts)
|
|
8685
|
-
|
|
8686
|
-
var s = 0;
|
|
8687
|
-
for (var i = 0; i < str.length; i++) {
|
|
8688
|
-
var n = wcwidth(str.charCodeAt(i), opts);
|
|
8689
|
-
if (n < 0) return -1
|
|
8690
|
-
s += n;
|
|
8691
|
-
}
|
|
8692
|
-
|
|
8693
|
-
return s
|
|
8694
|
-
}
|
|
8695
|
-
|
|
8696
|
-
function wcwidth(ucs, opts) {
|
|
8697
|
-
// test for 8-bit control characters
|
|
8698
|
-
if (ucs === 0) return opts.nul
|
|
8699
|
-
if (ucs < 32 || (ucs >= 0x7f && ucs < 0xa0)) return opts.control
|
|
8700
|
-
|
|
8701
|
-
// binary search in table of non-spacing characters
|
|
8702
|
-
if (bisearch(ucs)) return 0
|
|
8703
|
-
|
|
8704
|
-
// if we arrive here, ucs is not a combining or C0/C1 control character
|
|
8705
|
-
return 1 +
|
|
8706
|
-
(ucs >= 0x1100 &&
|
|
8707
|
-
(ucs <= 0x115f || // Hangul Jamo init. consonants
|
|
8708
|
-
ucs == 0x2329 || ucs == 0x232a ||
|
|
8709
|
-
(ucs >= 0x2e80 && ucs <= 0xa4cf &&
|
|
8710
|
-
ucs != 0x303f) || // CJK ... Yi
|
|
8711
|
-
(ucs >= 0xac00 && ucs <= 0xd7a3) || // Hangul Syllables
|
|
8712
|
-
(ucs >= 0xf900 && ucs <= 0xfaff) || // CJK Compatibility Ideographs
|
|
8713
|
-
(ucs >= 0xfe10 && ucs <= 0xfe19) || // Vertical forms
|
|
8714
|
-
(ucs >= 0xfe30 && ucs <= 0xfe6f) || // CJK Compatibility Forms
|
|
8715
|
-
(ucs >= 0xff00 && ucs <= 0xff60) || // Fullwidth Forms
|
|
8716
|
-
(ucs >= 0xffe0 && ucs <= 0xffe6) ||
|
|
8717
|
-
(ucs >= 0x20000 && ucs <= 0x2fffd) ||
|
|
8718
|
-
(ucs >= 0x30000 && ucs <= 0x3fffd)));
|
|
8719
|
-
}
|
|
8720
|
-
|
|
8721
|
-
function bisearch(ucs) {
|
|
8722
|
-
var min = 0;
|
|
8723
|
-
var max = combining.length - 1;
|
|
8724
|
-
var mid;
|
|
8725
|
-
|
|
8726
|
-
if (ucs < combining[0][0] || ucs > combining[max][1]) return false
|
|
8727
|
-
|
|
8728
|
-
while (max >= min) {
|
|
8729
|
-
mid = Math.floor((min + max) / 2);
|
|
8730
|
-
if (ucs > combining[mid][1]) min = mid + 1;
|
|
8731
|
-
else if (ucs < combining[mid][0]) max = mid - 1;
|
|
8732
|
-
else return true
|
|
8733
|
-
}
|
|
8734
|
-
|
|
8735
|
-
return false
|
|
8736
|
-
}
|
|
8737
|
-
|
|
8738
|
-
var wcwidthExports = wcwidth$2.exports;
|
|
8739
|
-
var wcwidth$1 = /*@__PURE__*/getDefaultExportFromCjs(wcwidthExports);
|
|
9491
|
+
return width;
|
|
9492
|
+
}
|
|
8740
9493
|
|
|
8741
9494
|
function isInteractive({stream = process.stdout} = {}) {
|
|
8742
9495
|
return Boolean(
|
|
@@ -12631,11 +13384,11 @@ class Ora {
|
|
|
12631
13384
|
}
|
|
12632
13385
|
|
|
12633
13386
|
this.#indent = indent;
|
|
12634
|
-
this
|
|
13387
|
+
this.#updateLineCount();
|
|
12635
13388
|
}
|
|
12636
13389
|
|
|
12637
13390
|
get interval() {
|
|
12638
|
-
return this.#initialInterval
|
|
13391
|
+
return this.#initialInterval ?? this.#spinner.interval ?? 100;
|
|
12639
13392
|
}
|
|
12640
13393
|
|
|
12641
13394
|
get spinner() {
|
|
@@ -12668,35 +13421,34 @@ class Ora {
|
|
|
12668
13421
|
return this.#text;
|
|
12669
13422
|
}
|
|
12670
13423
|
|
|
12671
|
-
set text(value) {
|
|
12672
|
-
this.#text = value
|
|
12673
|
-
this
|
|
13424
|
+
set text(value = '') {
|
|
13425
|
+
this.#text = value;
|
|
13426
|
+
this.#updateLineCount();
|
|
12674
13427
|
}
|
|
12675
13428
|
|
|
12676
13429
|
get prefixText() {
|
|
12677
13430
|
return this.#prefixText;
|
|
12678
13431
|
}
|
|
12679
13432
|
|
|
12680
|
-
set prefixText(value) {
|
|
12681
|
-
this.#prefixText = value
|
|
12682
|
-
this
|
|
13433
|
+
set prefixText(value = '') {
|
|
13434
|
+
this.#prefixText = value;
|
|
13435
|
+
this.#updateLineCount();
|
|
12683
13436
|
}
|
|
12684
13437
|
|
|
12685
13438
|
get suffixText() {
|
|
12686
13439
|
return this.#suffixText;
|
|
12687
13440
|
}
|
|
12688
13441
|
|
|
12689
|
-
set suffixText(value) {
|
|
12690
|
-
this.#suffixText = value
|
|
12691
|
-
this
|
|
13442
|
+
set suffixText(value = '') {
|
|
13443
|
+
this.#suffixText = value;
|
|
13444
|
+
this.#updateLineCount();
|
|
12692
13445
|
}
|
|
12693
13446
|
|
|
12694
13447
|
get isSpinning() {
|
|
12695
13448
|
return this.#id !== undefined;
|
|
12696
13449
|
}
|
|
12697
13450
|
|
|
12698
|
-
|
|
12699
|
-
getFullPrefixText(prefixText = this.#prefixText, postfix = ' ') {
|
|
13451
|
+
#getFullPrefixText(prefixText = this.#prefixText, postfix = ' ') {
|
|
12700
13452
|
if (typeof prefixText === 'string' && prefixText !== '') {
|
|
12701
13453
|
return prefixText + postfix;
|
|
12702
13454
|
}
|
|
@@ -12708,7 +13460,7 @@ class Ora {
|
|
|
12708
13460
|
return '';
|
|
12709
13461
|
}
|
|
12710
13462
|
|
|
12711
|
-
getFullSuffixText(suffixText = this.#suffixText, prefix = ' ') {
|
|
13463
|
+
#getFullSuffixText(suffixText = this.#suffixText, prefix = ' ') {
|
|
12712
13464
|
if (typeof suffixText === 'string' && suffixText !== '') {
|
|
12713
13465
|
return prefix + suffixText;
|
|
12714
13466
|
}
|
|
@@ -12720,15 +13472,15 @@ class Ora {
|
|
|
12720
13472
|
return '';
|
|
12721
13473
|
}
|
|
12722
13474
|
|
|
12723
|
-
updateLineCount() {
|
|
12724
|
-
const columns = this.#stream.columns
|
|
12725
|
-
const fullPrefixText = this
|
|
12726
|
-
const fullSuffixText = this
|
|
13475
|
+
#updateLineCount() {
|
|
13476
|
+
const columns = this.#stream.columns ?? 80;
|
|
13477
|
+
const fullPrefixText = this.#getFullPrefixText(this.#prefixText, '-');
|
|
13478
|
+
const fullSuffixText = this.#getFullSuffixText(this.#suffixText, '-');
|
|
12727
13479
|
const fullText = ' '.repeat(this.#indent) + fullPrefixText + '--' + this.#text + '--' + fullSuffixText;
|
|
12728
13480
|
|
|
12729
13481
|
this.#lineCount = 0;
|
|
12730
13482
|
for (const line of stripAnsi(fullText).split('\n')) {
|
|
12731
|
-
this.#lineCount += Math.max(1, Math.ceil(
|
|
13483
|
+
this.#lineCount += Math.max(1, Math.ceil(stringWidth(line, {countAnsiEscapeCodes: true}) / columns));
|
|
12732
13484
|
}
|
|
12733
13485
|
}
|
|
12734
13486
|
|
|
@@ -12887,16 +13639,16 @@ class Ora {
|
|
|
12887
13639
|
return this;
|
|
12888
13640
|
}
|
|
12889
13641
|
|
|
12890
|
-
const prefixText = options.prefixText
|
|
12891
|
-
const fullPrefixText = this
|
|
13642
|
+
const prefixText = options.prefixText ?? this.#prefixText;
|
|
13643
|
+
const fullPrefixText = this.#getFullPrefixText(prefixText, ' ');
|
|
12892
13644
|
|
|
12893
|
-
const symbolText = options.symbol
|
|
13645
|
+
const symbolText = options.symbol ?? ' ';
|
|
12894
13646
|
|
|
12895
|
-
const text = options.text
|
|
13647
|
+
const text = options.text ?? this.text;
|
|
12896
13648
|
const fullText = (typeof text === 'string') ? ' ' + text : '';
|
|
12897
13649
|
|
|
12898
|
-
const suffixText = options.suffixText
|
|
12899
|
-
const fullSuffixText = this
|
|
13650
|
+
const suffixText = options.suffixText ?? this.#suffixText;
|
|
13651
|
+
const fullSuffixText = this.#getFullSuffixText(suffixText, ' ');
|
|
12900
13652
|
|
|
12901
13653
|
const textToWrite = fullPrefixText + symbolText + fullText + fullSuffixText + '\n';
|
|
12902
13654
|
|
|
@@ -12917,7 +13669,183 @@ var src$1 = {};
|
|
|
12917
13669
|
|
|
12918
13670
|
var src = {exports: {}};
|
|
12919
13671
|
|
|
12920
|
-
var
|
|
13672
|
+
var node = {exports: {}};
|
|
13673
|
+
|
|
13674
|
+
var hasFlag;
|
|
13675
|
+
var hasRequiredHasFlag;
|
|
13676
|
+
|
|
13677
|
+
function requireHasFlag () {
|
|
13678
|
+
if (hasRequiredHasFlag) return hasFlag;
|
|
13679
|
+
hasRequiredHasFlag = 1;
|
|
13680
|
+
|
|
13681
|
+
hasFlag = (flag, argv = process.argv) => {
|
|
13682
|
+
const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
|
|
13683
|
+
const position = argv.indexOf(prefix + flag);
|
|
13684
|
+
const terminatorPosition = argv.indexOf('--');
|
|
13685
|
+
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
13686
|
+
};
|
|
13687
|
+
return hasFlag;
|
|
13688
|
+
}
|
|
13689
|
+
|
|
13690
|
+
var supportsColor_1;
|
|
13691
|
+
var hasRequiredSupportsColor;
|
|
13692
|
+
|
|
13693
|
+
function requireSupportsColor () {
|
|
13694
|
+
if (hasRequiredSupportsColor) return supportsColor_1;
|
|
13695
|
+
hasRequiredSupportsColor = 1;
|
|
13696
|
+
const os = require$$0$5;
|
|
13697
|
+
const tty = require$$1$2;
|
|
13698
|
+
const hasFlag = requireHasFlag();
|
|
13699
|
+
|
|
13700
|
+
const {env} = process;
|
|
13701
|
+
|
|
13702
|
+
let flagForceColor;
|
|
13703
|
+
if (hasFlag('no-color') ||
|
|
13704
|
+
hasFlag('no-colors') ||
|
|
13705
|
+
hasFlag('color=false') ||
|
|
13706
|
+
hasFlag('color=never')) {
|
|
13707
|
+
flagForceColor = 0;
|
|
13708
|
+
} else if (hasFlag('color') ||
|
|
13709
|
+
hasFlag('colors') ||
|
|
13710
|
+
hasFlag('color=true') ||
|
|
13711
|
+
hasFlag('color=always')) {
|
|
13712
|
+
flagForceColor = 1;
|
|
13713
|
+
}
|
|
13714
|
+
|
|
13715
|
+
function envForceColor() {
|
|
13716
|
+
if ('FORCE_COLOR' in env) {
|
|
13717
|
+
if (env.FORCE_COLOR === 'true') {
|
|
13718
|
+
return 1;
|
|
13719
|
+
}
|
|
13720
|
+
|
|
13721
|
+
if (env.FORCE_COLOR === 'false') {
|
|
13722
|
+
return 0;
|
|
13723
|
+
}
|
|
13724
|
+
|
|
13725
|
+
return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
13726
|
+
}
|
|
13727
|
+
}
|
|
13728
|
+
|
|
13729
|
+
function translateLevel(level) {
|
|
13730
|
+
if (level === 0) {
|
|
13731
|
+
return false;
|
|
13732
|
+
}
|
|
13733
|
+
|
|
13734
|
+
return {
|
|
13735
|
+
level,
|
|
13736
|
+
hasBasic: true,
|
|
13737
|
+
has256: level >= 2,
|
|
13738
|
+
has16m: level >= 3
|
|
13739
|
+
};
|
|
13740
|
+
}
|
|
13741
|
+
|
|
13742
|
+
function supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {
|
|
13743
|
+
const noFlagForceColor = envForceColor();
|
|
13744
|
+
if (noFlagForceColor !== undefined) {
|
|
13745
|
+
flagForceColor = noFlagForceColor;
|
|
13746
|
+
}
|
|
13747
|
+
|
|
13748
|
+
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
13749
|
+
|
|
13750
|
+
if (forceColor === 0) {
|
|
13751
|
+
return 0;
|
|
13752
|
+
}
|
|
13753
|
+
|
|
13754
|
+
if (sniffFlags) {
|
|
13755
|
+
if (hasFlag('color=16m') ||
|
|
13756
|
+
hasFlag('color=full') ||
|
|
13757
|
+
hasFlag('color=truecolor')) {
|
|
13758
|
+
return 3;
|
|
13759
|
+
}
|
|
13760
|
+
|
|
13761
|
+
if (hasFlag('color=256')) {
|
|
13762
|
+
return 2;
|
|
13763
|
+
}
|
|
13764
|
+
}
|
|
13765
|
+
|
|
13766
|
+
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
|
13767
|
+
return 0;
|
|
13768
|
+
}
|
|
13769
|
+
|
|
13770
|
+
const min = forceColor || 0;
|
|
13771
|
+
|
|
13772
|
+
if (env.TERM === 'dumb') {
|
|
13773
|
+
return min;
|
|
13774
|
+
}
|
|
13775
|
+
|
|
13776
|
+
if (process.platform === 'win32') {
|
|
13777
|
+
// Windows 10 build 10586 is the first Windows release that supports 256 colors.
|
|
13778
|
+
// Windows 10 build 14931 is the first release that supports 16m/TrueColor.
|
|
13779
|
+
const osRelease = os.release().split('.');
|
|
13780
|
+
if (
|
|
13781
|
+
Number(osRelease[0]) >= 10 &&
|
|
13782
|
+
Number(osRelease[2]) >= 10586
|
|
13783
|
+
) {
|
|
13784
|
+
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
13785
|
+
}
|
|
13786
|
+
|
|
13787
|
+
return 1;
|
|
13788
|
+
}
|
|
13789
|
+
|
|
13790
|
+
if ('CI' in env) {
|
|
13791
|
+
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
|
|
13792
|
+
return 1;
|
|
13793
|
+
}
|
|
13794
|
+
|
|
13795
|
+
return min;
|
|
13796
|
+
}
|
|
13797
|
+
|
|
13798
|
+
if ('TEAMCITY_VERSION' in env) {
|
|
13799
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
13800
|
+
}
|
|
13801
|
+
|
|
13802
|
+
if (env.COLORTERM === 'truecolor') {
|
|
13803
|
+
return 3;
|
|
13804
|
+
}
|
|
13805
|
+
|
|
13806
|
+
if ('TERM_PROGRAM' in env) {
|
|
13807
|
+
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
|
13808
|
+
|
|
13809
|
+
switch (env.TERM_PROGRAM) {
|
|
13810
|
+
case 'iTerm.app':
|
|
13811
|
+
return version >= 3 ? 3 : 2;
|
|
13812
|
+
case 'Apple_Terminal':
|
|
13813
|
+
return 2;
|
|
13814
|
+
// No default
|
|
13815
|
+
}
|
|
13816
|
+
}
|
|
13817
|
+
|
|
13818
|
+
if (/-256(color)?$/i.test(env.TERM)) {
|
|
13819
|
+
return 2;
|
|
13820
|
+
}
|
|
13821
|
+
|
|
13822
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
13823
|
+
return 1;
|
|
13824
|
+
}
|
|
13825
|
+
|
|
13826
|
+
if ('COLORTERM' in env) {
|
|
13827
|
+
return 1;
|
|
13828
|
+
}
|
|
13829
|
+
|
|
13830
|
+
return min;
|
|
13831
|
+
}
|
|
13832
|
+
|
|
13833
|
+
function getSupportLevel(stream, options = {}) {
|
|
13834
|
+
const level = supportsColor(stream, {
|
|
13835
|
+
streamIsTTY: stream && stream.isTTY,
|
|
13836
|
+
...options
|
|
13837
|
+
});
|
|
13838
|
+
|
|
13839
|
+
return translateLevel(level);
|
|
13840
|
+
}
|
|
13841
|
+
|
|
13842
|
+
supportsColor_1 = {
|
|
13843
|
+
supportsColor: getSupportLevel,
|
|
13844
|
+
stdout: getSupportLevel({isTTY: tty.isatty(1)}),
|
|
13845
|
+
stderr: getSupportLevel({isTTY: tty.isatty(2)})
|
|
13846
|
+
};
|
|
13847
|
+
return supportsColor_1;
|
|
13848
|
+
}
|
|
12921
13849
|
|
|
12922
13850
|
/**
|
|
12923
13851
|
* Helpers.
|
|
@@ -13372,478 +14300,21 @@ function requireCommon () {
|
|
|
13372
14300
|
return common$1;
|
|
13373
14301
|
}
|
|
13374
14302
|
|
|
13375
|
-
|
|
14303
|
+
/**
|
|
14304
|
+
* Module dependencies.
|
|
14305
|
+
*/
|
|
13376
14306
|
|
|
13377
|
-
var
|
|
14307
|
+
var hasRequiredNode;
|
|
13378
14308
|
|
|
13379
|
-
function
|
|
13380
|
-
if (
|
|
13381
|
-
|
|
14309
|
+
function requireNode () {
|
|
14310
|
+
if (hasRequiredNode) return node.exports;
|
|
14311
|
+
hasRequiredNode = 1;
|
|
13382
14312
|
(function (module, exports) {
|
|
14313
|
+
const tty = require$$1$2;
|
|
14314
|
+
const util = require$$1$1;
|
|
14315
|
+
|
|
13383
14316
|
/**
|
|
13384
|
-
* This is the
|
|
13385
|
-
*/
|
|
13386
|
-
|
|
13387
|
-
exports.formatArgs = formatArgs;
|
|
13388
|
-
exports.save = save;
|
|
13389
|
-
exports.load = load;
|
|
13390
|
-
exports.useColors = useColors;
|
|
13391
|
-
exports.storage = localstorage();
|
|
13392
|
-
exports.destroy = (() => {
|
|
13393
|
-
let warned = false;
|
|
13394
|
-
|
|
13395
|
-
return () => {
|
|
13396
|
-
if (!warned) {
|
|
13397
|
-
warned = true;
|
|
13398
|
-
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
|
13399
|
-
}
|
|
13400
|
-
};
|
|
13401
|
-
})();
|
|
13402
|
-
|
|
13403
|
-
/**
|
|
13404
|
-
* Colors.
|
|
13405
|
-
*/
|
|
13406
|
-
|
|
13407
|
-
exports.colors = [
|
|
13408
|
-
'#0000CC',
|
|
13409
|
-
'#0000FF',
|
|
13410
|
-
'#0033CC',
|
|
13411
|
-
'#0033FF',
|
|
13412
|
-
'#0066CC',
|
|
13413
|
-
'#0066FF',
|
|
13414
|
-
'#0099CC',
|
|
13415
|
-
'#0099FF',
|
|
13416
|
-
'#00CC00',
|
|
13417
|
-
'#00CC33',
|
|
13418
|
-
'#00CC66',
|
|
13419
|
-
'#00CC99',
|
|
13420
|
-
'#00CCCC',
|
|
13421
|
-
'#00CCFF',
|
|
13422
|
-
'#3300CC',
|
|
13423
|
-
'#3300FF',
|
|
13424
|
-
'#3333CC',
|
|
13425
|
-
'#3333FF',
|
|
13426
|
-
'#3366CC',
|
|
13427
|
-
'#3366FF',
|
|
13428
|
-
'#3399CC',
|
|
13429
|
-
'#3399FF',
|
|
13430
|
-
'#33CC00',
|
|
13431
|
-
'#33CC33',
|
|
13432
|
-
'#33CC66',
|
|
13433
|
-
'#33CC99',
|
|
13434
|
-
'#33CCCC',
|
|
13435
|
-
'#33CCFF',
|
|
13436
|
-
'#6600CC',
|
|
13437
|
-
'#6600FF',
|
|
13438
|
-
'#6633CC',
|
|
13439
|
-
'#6633FF',
|
|
13440
|
-
'#66CC00',
|
|
13441
|
-
'#66CC33',
|
|
13442
|
-
'#9900CC',
|
|
13443
|
-
'#9900FF',
|
|
13444
|
-
'#9933CC',
|
|
13445
|
-
'#9933FF',
|
|
13446
|
-
'#99CC00',
|
|
13447
|
-
'#99CC33',
|
|
13448
|
-
'#CC0000',
|
|
13449
|
-
'#CC0033',
|
|
13450
|
-
'#CC0066',
|
|
13451
|
-
'#CC0099',
|
|
13452
|
-
'#CC00CC',
|
|
13453
|
-
'#CC00FF',
|
|
13454
|
-
'#CC3300',
|
|
13455
|
-
'#CC3333',
|
|
13456
|
-
'#CC3366',
|
|
13457
|
-
'#CC3399',
|
|
13458
|
-
'#CC33CC',
|
|
13459
|
-
'#CC33FF',
|
|
13460
|
-
'#CC6600',
|
|
13461
|
-
'#CC6633',
|
|
13462
|
-
'#CC9900',
|
|
13463
|
-
'#CC9933',
|
|
13464
|
-
'#CCCC00',
|
|
13465
|
-
'#CCCC33',
|
|
13466
|
-
'#FF0000',
|
|
13467
|
-
'#FF0033',
|
|
13468
|
-
'#FF0066',
|
|
13469
|
-
'#FF0099',
|
|
13470
|
-
'#FF00CC',
|
|
13471
|
-
'#FF00FF',
|
|
13472
|
-
'#FF3300',
|
|
13473
|
-
'#FF3333',
|
|
13474
|
-
'#FF3366',
|
|
13475
|
-
'#FF3399',
|
|
13476
|
-
'#FF33CC',
|
|
13477
|
-
'#FF33FF',
|
|
13478
|
-
'#FF6600',
|
|
13479
|
-
'#FF6633',
|
|
13480
|
-
'#FF9900',
|
|
13481
|
-
'#FF9933',
|
|
13482
|
-
'#FFCC00',
|
|
13483
|
-
'#FFCC33'
|
|
13484
|
-
];
|
|
13485
|
-
|
|
13486
|
-
/**
|
|
13487
|
-
* Currently only WebKit-based Web Inspectors, Firefox >= v31,
|
|
13488
|
-
* and the Firebug extension (any Firefox version) are known
|
|
13489
|
-
* to support "%c" CSS customizations.
|
|
13490
|
-
*
|
|
13491
|
-
* TODO: add a `localStorage` variable to explicitly enable/disable colors
|
|
13492
|
-
*/
|
|
13493
|
-
|
|
13494
|
-
// eslint-disable-next-line complexity
|
|
13495
|
-
function useColors() {
|
|
13496
|
-
// NB: In an Electron preload script, document will be defined but not fully
|
|
13497
|
-
// initialized. Since we know we're in Chrome, we'll just detect this case
|
|
13498
|
-
// explicitly
|
|
13499
|
-
if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
|
|
13500
|
-
return true;
|
|
13501
|
-
}
|
|
13502
|
-
|
|
13503
|
-
// Internet Explorer and Edge do not support colors.
|
|
13504
|
-
if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
|
13505
|
-
return false;
|
|
13506
|
-
}
|
|
13507
|
-
|
|
13508
|
-
// Is webkit? http://stackoverflow.com/a/16459606/376773
|
|
13509
|
-
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
|
|
13510
|
-
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
|
|
13511
|
-
// Is firebug? http://stackoverflow.com/a/398120/376773
|
|
13512
|
-
(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
|
|
13513
|
-
// Is firefox >= v31?
|
|
13514
|
-
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
13515
|
-
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
|
|
13516
|
-
// Double check webkit in userAgent just in case we are in a worker
|
|
13517
|
-
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
|
|
13518
|
-
}
|
|
13519
|
-
|
|
13520
|
-
/**
|
|
13521
|
-
* Colorize log arguments if enabled.
|
|
13522
|
-
*
|
|
13523
|
-
* @api public
|
|
13524
|
-
*/
|
|
13525
|
-
|
|
13526
|
-
function formatArgs(args) {
|
|
13527
|
-
args[0] = (this.useColors ? '%c' : '') +
|
|
13528
|
-
this.namespace +
|
|
13529
|
-
(this.useColors ? ' %c' : ' ') +
|
|
13530
|
-
args[0] +
|
|
13531
|
-
(this.useColors ? '%c ' : ' ') +
|
|
13532
|
-
'+' + module.exports.humanize(this.diff);
|
|
13533
|
-
|
|
13534
|
-
if (!this.useColors) {
|
|
13535
|
-
return;
|
|
13536
|
-
}
|
|
13537
|
-
|
|
13538
|
-
const c = 'color: ' + this.color;
|
|
13539
|
-
args.splice(1, 0, c, 'color: inherit');
|
|
13540
|
-
|
|
13541
|
-
// The final "%c" is somewhat tricky, because there could be other
|
|
13542
|
-
// arguments passed either before or after the %c, so we need to
|
|
13543
|
-
// figure out the correct index to insert the CSS into
|
|
13544
|
-
let index = 0;
|
|
13545
|
-
let lastC = 0;
|
|
13546
|
-
args[0].replace(/%[a-zA-Z%]/g, match => {
|
|
13547
|
-
if (match === '%%') {
|
|
13548
|
-
return;
|
|
13549
|
-
}
|
|
13550
|
-
index++;
|
|
13551
|
-
if (match === '%c') {
|
|
13552
|
-
// We only are interested in the *last* %c
|
|
13553
|
-
// (the user may have provided their own)
|
|
13554
|
-
lastC = index;
|
|
13555
|
-
}
|
|
13556
|
-
});
|
|
13557
|
-
|
|
13558
|
-
args.splice(lastC, 0, c);
|
|
13559
|
-
}
|
|
13560
|
-
|
|
13561
|
-
/**
|
|
13562
|
-
* Invokes `console.debug()` when available.
|
|
13563
|
-
* No-op when `console.debug` is not a "function".
|
|
13564
|
-
* If `console.debug` is not available, falls back
|
|
13565
|
-
* to `console.log`.
|
|
13566
|
-
*
|
|
13567
|
-
* @api public
|
|
13568
|
-
*/
|
|
13569
|
-
exports.log = console.debug || console.log || (() => {});
|
|
13570
|
-
|
|
13571
|
-
/**
|
|
13572
|
-
* Save `namespaces`.
|
|
13573
|
-
*
|
|
13574
|
-
* @param {String} namespaces
|
|
13575
|
-
* @api private
|
|
13576
|
-
*/
|
|
13577
|
-
function save(namespaces) {
|
|
13578
|
-
try {
|
|
13579
|
-
if (namespaces) {
|
|
13580
|
-
exports.storage.setItem('debug', namespaces);
|
|
13581
|
-
} else {
|
|
13582
|
-
exports.storage.removeItem('debug');
|
|
13583
|
-
}
|
|
13584
|
-
} catch (error) {
|
|
13585
|
-
// Swallow
|
|
13586
|
-
// XXX (@Qix-) should we be logging these?
|
|
13587
|
-
}
|
|
13588
|
-
}
|
|
13589
|
-
|
|
13590
|
-
/**
|
|
13591
|
-
* Load `namespaces`.
|
|
13592
|
-
*
|
|
13593
|
-
* @return {String} returns the previously persisted debug modes
|
|
13594
|
-
* @api private
|
|
13595
|
-
*/
|
|
13596
|
-
function load() {
|
|
13597
|
-
let r;
|
|
13598
|
-
try {
|
|
13599
|
-
r = exports.storage.getItem('debug');
|
|
13600
|
-
} catch (error) {
|
|
13601
|
-
// Swallow
|
|
13602
|
-
// XXX (@Qix-) should we be logging these?
|
|
13603
|
-
}
|
|
13604
|
-
|
|
13605
|
-
// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
|
|
13606
|
-
if (!r && typeof process !== 'undefined' && 'env' in process) {
|
|
13607
|
-
r = process.env.DEBUG;
|
|
13608
|
-
}
|
|
13609
|
-
|
|
13610
|
-
return r;
|
|
13611
|
-
}
|
|
13612
|
-
|
|
13613
|
-
/**
|
|
13614
|
-
* Localstorage attempts to return the localstorage.
|
|
13615
|
-
*
|
|
13616
|
-
* This is necessary because safari throws
|
|
13617
|
-
* when a user disables cookies/localstorage
|
|
13618
|
-
* and you attempt to access it.
|
|
13619
|
-
*
|
|
13620
|
-
* @return {LocalStorage}
|
|
13621
|
-
* @api private
|
|
13622
|
-
*/
|
|
13623
|
-
|
|
13624
|
-
function localstorage() {
|
|
13625
|
-
try {
|
|
13626
|
-
// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
|
|
13627
|
-
// The Browser also has localStorage in the global context.
|
|
13628
|
-
return localStorage;
|
|
13629
|
-
} catch (error) {
|
|
13630
|
-
// Swallow
|
|
13631
|
-
// XXX (@Qix-) should we be logging these?
|
|
13632
|
-
}
|
|
13633
|
-
}
|
|
13634
|
-
|
|
13635
|
-
module.exports = requireCommon()(exports);
|
|
13636
|
-
|
|
13637
|
-
const {formatters} = module.exports;
|
|
13638
|
-
|
|
13639
|
-
/**
|
|
13640
|
-
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
|
|
13641
|
-
*/
|
|
13642
|
-
|
|
13643
|
-
formatters.j = function (v) {
|
|
13644
|
-
try {
|
|
13645
|
-
return JSON.stringify(v);
|
|
13646
|
-
} catch (error) {
|
|
13647
|
-
return '[UnexpectedJSONParseError]: ' + error.message;
|
|
13648
|
-
}
|
|
13649
|
-
};
|
|
13650
|
-
} (browser, browser.exports));
|
|
13651
|
-
return browser.exports;
|
|
13652
|
-
}
|
|
13653
|
-
|
|
13654
|
-
var node = {exports: {}};
|
|
13655
|
-
|
|
13656
|
-
var hasFlag;
|
|
13657
|
-
var hasRequiredHasFlag;
|
|
13658
|
-
|
|
13659
|
-
function requireHasFlag () {
|
|
13660
|
-
if (hasRequiredHasFlag) return hasFlag;
|
|
13661
|
-
hasRequiredHasFlag = 1;
|
|
13662
|
-
|
|
13663
|
-
hasFlag = (flag, argv = process.argv) => {
|
|
13664
|
-
const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
|
|
13665
|
-
const position = argv.indexOf(prefix + flag);
|
|
13666
|
-
const terminatorPosition = argv.indexOf('--');
|
|
13667
|
-
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
13668
|
-
};
|
|
13669
|
-
return hasFlag;
|
|
13670
|
-
}
|
|
13671
|
-
|
|
13672
|
-
var supportsColor_1;
|
|
13673
|
-
var hasRequiredSupportsColor;
|
|
13674
|
-
|
|
13675
|
-
function requireSupportsColor () {
|
|
13676
|
-
if (hasRequiredSupportsColor) return supportsColor_1;
|
|
13677
|
-
hasRequiredSupportsColor = 1;
|
|
13678
|
-
const os = require$$0$5;
|
|
13679
|
-
const tty = require$$1$2;
|
|
13680
|
-
const hasFlag = requireHasFlag();
|
|
13681
|
-
|
|
13682
|
-
const {env} = process;
|
|
13683
|
-
|
|
13684
|
-
let flagForceColor;
|
|
13685
|
-
if (hasFlag('no-color') ||
|
|
13686
|
-
hasFlag('no-colors') ||
|
|
13687
|
-
hasFlag('color=false') ||
|
|
13688
|
-
hasFlag('color=never')) {
|
|
13689
|
-
flagForceColor = 0;
|
|
13690
|
-
} else if (hasFlag('color') ||
|
|
13691
|
-
hasFlag('colors') ||
|
|
13692
|
-
hasFlag('color=true') ||
|
|
13693
|
-
hasFlag('color=always')) {
|
|
13694
|
-
flagForceColor = 1;
|
|
13695
|
-
}
|
|
13696
|
-
|
|
13697
|
-
function envForceColor() {
|
|
13698
|
-
if ('FORCE_COLOR' in env) {
|
|
13699
|
-
if (env.FORCE_COLOR === 'true') {
|
|
13700
|
-
return 1;
|
|
13701
|
-
}
|
|
13702
|
-
|
|
13703
|
-
if (env.FORCE_COLOR === 'false') {
|
|
13704
|
-
return 0;
|
|
13705
|
-
}
|
|
13706
|
-
|
|
13707
|
-
return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
13708
|
-
}
|
|
13709
|
-
}
|
|
13710
|
-
|
|
13711
|
-
function translateLevel(level) {
|
|
13712
|
-
if (level === 0) {
|
|
13713
|
-
return false;
|
|
13714
|
-
}
|
|
13715
|
-
|
|
13716
|
-
return {
|
|
13717
|
-
level,
|
|
13718
|
-
hasBasic: true,
|
|
13719
|
-
has256: level >= 2,
|
|
13720
|
-
has16m: level >= 3
|
|
13721
|
-
};
|
|
13722
|
-
}
|
|
13723
|
-
|
|
13724
|
-
function supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {
|
|
13725
|
-
const noFlagForceColor = envForceColor();
|
|
13726
|
-
if (noFlagForceColor !== undefined) {
|
|
13727
|
-
flagForceColor = noFlagForceColor;
|
|
13728
|
-
}
|
|
13729
|
-
|
|
13730
|
-
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
13731
|
-
|
|
13732
|
-
if (forceColor === 0) {
|
|
13733
|
-
return 0;
|
|
13734
|
-
}
|
|
13735
|
-
|
|
13736
|
-
if (sniffFlags) {
|
|
13737
|
-
if (hasFlag('color=16m') ||
|
|
13738
|
-
hasFlag('color=full') ||
|
|
13739
|
-
hasFlag('color=truecolor')) {
|
|
13740
|
-
return 3;
|
|
13741
|
-
}
|
|
13742
|
-
|
|
13743
|
-
if (hasFlag('color=256')) {
|
|
13744
|
-
return 2;
|
|
13745
|
-
}
|
|
13746
|
-
}
|
|
13747
|
-
|
|
13748
|
-
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
|
13749
|
-
return 0;
|
|
13750
|
-
}
|
|
13751
|
-
|
|
13752
|
-
const min = forceColor || 0;
|
|
13753
|
-
|
|
13754
|
-
if (env.TERM === 'dumb') {
|
|
13755
|
-
return min;
|
|
13756
|
-
}
|
|
13757
|
-
|
|
13758
|
-
if (process.platform === 'win32') {
|
|
13759
|
-
// Windows 10 build 10586 is the first Windows release that supports 256 colors.
|
|
13760
|
-
// Windows 10 build 14931 is the first release that supports 16m/TrueColor.
|
|
13761
|
-
const osRelease = os.release().split('.');
|
|
13762
|
-
if (
|
|
13763
|
-
Number(osRelease[0]) >= 10 &&
|
|
13764
|
-
Number(osRelease[2]) >= 10586
|
|
13765
|
-
) {
|
|
13766
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
13767
|
-
}
|
|
13768
|
-
|
|
13769
|
-
return 1;
|
|
13770
|
-
}
|
|
13771
|
-
|
|
13772
|
-
if ('CI' in env) {
|
|
13773
|
-
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
|
|
13774
|
-
return 1;
|
|
13775
|
-
}
|
|
13776
|
-
|
|
13777
|
-
return min;
|
|
13778
|
-
}
|
|
13779
|
-
|
|
13780
|
-
if ('TEAMCITY_VERSION' in env) {
|
|
13781
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
13782
|
-
}
|
|
13783
|
-
|
|
13784
|
-
if (env.COLORTERM === 'truecolor') {
|
|
13785
|
-
return 3;
|
|
13786
|
-
}
|
|
13787
|
-
|
|
13788
|
-
if ('TERM_PROGRAM' in env) {
|
|
13789
|
-
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
|
13790
|
-
|
|
13791
|
-
switch (env.TERM_PROGRAM) {
|
|
13792
|
-
case 'iTerm.app':
|
|
13793
|
-
return version >= 3 ? 3 : 2;
|
|
13794
|
-
case 'Apple_Terminal':
|
|
13795
|
-
return 2;
|
|
13796
|
-
// No default
|
|
13797
|
-
}
|
|
13798
|
-
}
|
|
13799
|
-
|
|
13800
|
-
if (/-256(color)?$/i.test(env.TERM)) {
|
|
13801
|
-
return 2;
|
|
13802
|
-
}
|
|
13803
|
-
|
|
13804
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
13805
|
-
return 1;
|
|
13806
|
-
}
|
|
13807
|
-
|
|
13808
|
-
if ('COLORTERM' in env) {
|
|
13809
|
-
return 1;
|
|
13810
|
-
}
|
|
13811
|
-
|
|
13812
|
-
return min;
|
|
13813
|
-
}
|
|
13814
|
-
|
|
13815
|
-
function getSupportLevel(stream, options = {}) {
|
|
13816
|
-
const level = supportsColor(stream, {
|
|
13817
|
-
streamIsTTY: stream && stream.isTTY,
|
|
13818
|
-
...options
|
|
13819
|
-
});
|
|
13820
|
-
|
|
13821
|
-
return translateLevel(level);
|
|
13822
|
-
}
|
|
13823
|
-
|
|
13824
|
-
supportsColor_1 = {
|
|
13825
|
-
supportsColor: getSupportLevel,
|
|
13826
|
-
stdout: getSupportLevel({isTTY: tty.isatty(1)}),
|
|
13827
|
-
stderr: getSupportLevel({isTTY: tty.isatty(2)})
|
|
13828
|
-
};
|
|
13829
|
-
return supportsColor_1;
|
|
13830
|
-
}
|
|
13831
|
-
|
|
13832
|
-
/**
|
|
13833
|
-
* Module dependencies.
|
|
13834
|
-
*/
|
|
13835
|
-
|
|
13836
|
-
var hasRequiredNode;
|
|
13837
|
-
|
|
13838
|
-
function requireNode () {
|
|
13839
|
-
if (hasRequiredNode) return node.exports;
|
|
13840
|
-
hasRequiredNode = 1;
|
|
13841
|
-
(function (module, exports) {
|
|
13842
|
-
const tty = require$$1$2;
|
|
13843
|
-
const util = require$$1$1;
|
|
13844
|
-
|
|
13845
|
-
/**
|
|
13846
|
-
* This is the Node.js implementation of `debug()`.
|
|
14317
|
+
* This is the Node.js implementation of `debug()`.
|
|
13847
14318
|
*/
|
|
13848
14319
|
|
|
13849
14320
|
exports.init = init;
|
|
@@ -13953,83 +14424,352 @@ function requireNode () {
|
|
|
13953
14424
|
}
|
|
13954
14425
|
|
|
13955
14426
|
/**
|
|
13956
|
-
* Build up the default `inspectOpts` object from the environment variables.
|
|
14427
|
+
* Build up the default `inspectOpts` object from the environment variables.
|
|
14428
|
+
*
|
|
14429
|
+
* $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
|
|
14430
|
+
*/
|
|
14431
|
+
|
|
14432
|
+
exports.inspectOpts = Object.keys(process.env).filter(key => {
|
|
14433
|
+
return /^debug_/i.test(key);
|
|
14434
|
+
}).reduce((obj, key) => {
|
|
14435
|
+
// Camel-case
|
|
14436
|
+
const prop = key
|
|
14437
|
+
.substring(6)
|
|
14438
|
+
.toLowerCase()
|
|
14439
|
+
.replace(/_([a-z])/g, (_, k) => {
|
|
14440
|
+
return k.toUpperCase();
|
|
14441
|
+
});
|
|
14442
|
+
|
|
14443
|
+
// Coerce string value into JS value
|
|
14444
|
+
let val = process.env[key];
|
|
14445
|
+
if (/^(yes|on|true|enabled)$/i.test(val)) {
|
|
14446
|
+
val = true;
|
|
14447
|
+
} else if (/^(no|off|false|disabled)$/i.test(val)) {
|
|
14448
|
+
val = false;
|
|
14449
|
+
} else if (val === 'null') {
|
|
14450
|
+
val = null;
|
|
14451
|
+
} else {
|
|
14452
|
+
val = Number(val);
|
|
14453
|
+
}
|
|
14454
|
+
|
|
14455
|
+
obj[prop] = val;
|
|
14456
|
+
return obj;
|
|
14457
|
+
}, {});
|
|
14458
|
+
|
|
14459
|
+
/**
|
|
14460
|
+
* Is stdout a TTY? Colored output is enabled when `true`.
|
|
14461
|
+
*/
|
|
14462
|
+
|
|
14463
|
+
function useColors() {
|
|
14464
|
+
return 'colors' in exports.inspectOpts ?
|
|
14465
|
+
Boolean(exports.inspectOpts.colors) :
|
|
14466
|
+
tty.isatty(process.stderr.fd);
|
|
14467
|
+
}
|
|
14468
|
+
|
|
14469
|
+
/**
|
|
14470
|
+
* Adds ANSI color escape codes if enabled.
|
|
14471
|
+
*
|
|
14472
|
+
* @api public
|
|
14473
|
+
*/
|
|
14474
|
+
|
|
14475
|
+
function formatArgs(args) {
|
|
14476
|
+
const {namespace: name, useColors} = this;
|
|
14477
|
+
|
|
14478
|
+
if (useColors) {
|
|
14479
|
+
const c = this.color;
|
|
14480
|
+
const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
|
|
14481
|
+
const prefix = ` ${colorCode};1m${name} \u001B[0m`;
|
|
14482
|
+
|
|
14483
|
+
args[0] = prefix + args[0].split('\n').join('\n' + prefix);
|
|
14484
|
+
args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
|
|
14485
|
+
} else {
|
|
14486
|
+
args[0] = getDate() + name + ' ' + args[0];
|
|
14487
|
+
}
|
|
14488
|
+
}
|
|
14489
|
+
|
|
14490
|
+
function getDate() {
|
|
14491
|
+
if (exports.inspectOpts.hideDate) {
|
|
14492
|
+
return '';
|
|
14493
|
+
}
|
|
14494
|
+
return new Date().toISOString() + ' ';
|
|
14495
|
+
}
|
|
14496
|
+
|
|
14497
|
+
/**
|
|
14498
|
+
* Invokes `util.format()` with the specified arguments and writes to stderr.
|
|
14499
|
+
*/
|
|
14500
|
+
|
|
14501
|
+
function log(...args) {
|
|
14502
|
+
return process.stderr.write(util.format(...args) + '\n');
|
|
14503
|
+
}
|
|
14504
|
+
|
|
14505
|
+
/**
|
|
14506
|
+
* Save `namespaces`.
|
|
14507
|
+
*
|
|
14508
|
+
* @param {String} namespaces
|
|
14509
|
+
* @api private
|
|
14510
|
+
*/
|
|
14511
|
+
function save(namespaces) {
|
|
14512
|
+
if (namespaces) {
|
|
14513
|
+
process.env.DEBUG = namespaces;
|
|
14514
|
+
} else {
|
|
14515
|
+
// If you set a process.env field to null or undefined, it gets cast to the
|
|
14516
|
+
// string 'null' or 'undefined'. Just delete instead.
|
|
14517
|
+
delete process.env.DEBUG;
|
|
14518
|
+
}
|
|
14519
|
+
}
|
|
14520
|
+
|
|
14521
|
+
/**
|
|
14522
|
+
* Load `namespaces`.
|
|
14523
|
+
*
|
|
14524
|
+
* @return {String} returns the previously persisted debug modes
|
|
14525
|
+
* @api private
|
|
14526
|
+
*/
|
|
14527
|
+
|
|
14528
|
+
function load() {
|
|
14529
|
+
return process.env.DEBUG;
|
|
14530
|
+
}
|
|
14531
|
+
|
|
14532
|
+
/**
|
|
14533
|
+
* Init logic for `debug` instances.
|
|
14534
|
+
*
|
|
14535
|
+
* Create a new `inspectOpts` object in case `useColors` is set
|
|
14536
|
+
* differently for a particular `debug` instance.
|
|
14537
|
+
*/
|
|
14538
|
+
|
|
14539
|
+
function init(debug) {
|
|
14540
|
+
debug.inspectOpts = {};
|
|
14541
|
+
|
|
14542
|
+
const keys = Object.keys(exports.inspectOpts);
|
|
14543
|
+
for (let i = 0; i < keys.length; i++) {
|
|
14544
|
+
debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
|
|
14545
|
+
}
|
|
14546
|
+
}
|
|
14547
|
+
|
|
14548
|
+
module.exports = requireCommon()(exports);
|
|
14549
|
+
|
|
14550
|
+
const {formatters} = module.exports;
|
|
14551
|
+
|
|
14552
|
+
/**
|
|
14553
|
+
* Map %o to `util.inspect()`, all on a single line.
|
|
14554
|
+
*/
|
|
14555
|
+
|
|
14556
|
+
formatters.o = function (v) {
|
|
14557
|
+
this.inspectOpts.colors = this.useColors;
|
|
14558
|
+
return util.inspect(v, this.inspectOpts)
|
|
14559
|
+
.split('\n')
|
|
14560
|
+
.map(str => str.trim())
|
|
14561
|
+
.join(' ');
|
|
14562
|
+
};
|
|
14563
|
+
|
|
14564
|
+
/**
|
|
14565
|
+
* Map %O to `util.inspect()`, allowing multiple lines if needed.
|
|
14566
|
+
*/
|
|
14567
|
+
|
|
14568
|
+
formatters.O = function (v) {
|
|
14569
|
+
this.inspectOpts.colors = this.useColors;
|
|
14570
|
+
return util.inspect(v, this.inspectOpts);
|
|
14571
|
+
};
|
|
14572
|
+
} (node, node.exports));
|
|
14573
|
+
return node.exports;
|
|
14574
|
+
}
|
|
14575
|
+
|
|
14576
|
+
var browser = {exports: {}};
|
|
14577
|
+
|
|
14578
|
+
/* eslint-env browser */
|
|
14579
|
+
|
|
14580
|
+
var hasRequiredBrowser;
|
|
14581
|
+
|
|
14582
|
+
function requireBrowser () {
|
|
14583
|
+
if (hasRequiredBrowser) return browser.exports;
|
|
14584
|
+
hasRequiredBrowser = 1;
|
|
14585
|
+
(function (module, exports) {
|
|
14586
|
+
/**
|
|
14587
|
+
* This is the web browser implementation of `debug()`.
|
|
14588
|
+
*/
|
|
14589
|
+
|
|
14590
|
+
exports.formatArgs = formatArgs;
|
|
14591
|
+
exports.save = save;
|
|
14592
|
+
exports.load = load;
|
|
14593
|
+
exports.useColors = useColors;
|
|
14594
|
+
exports.storage = localstorage();
|
|
14595
|
+
exports.destroy = (() => {
|
|
14596
|
+
let warned = false;
|
|
14597
|
+
|
|
14598
|
+
return () => {
|
|
14599
|
+
if (!warned) {
|
|
14600
|
+
warned = true;
|
|
14601
|
+
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
|
14602
|
+
}
|
|
14603
|
+
};
|
|
14604
|
+
})();
|
|
14605
|
+
|
|
14606
|
+
/**
|
|
14607
|
+
* Colors.
|
|
14608
|
+
*/
|
|
14609
|
+
|
|
14610
|
+
exports.colors = [
|
|
14611
|
+
'#0000CC',
|
|
14612
|
+
'#0000FF',
|
|
14613
|
+
'#0033CC',
|
|
14614
|
+
'#0033FF',
|
|
14615
|
+
'#0066CC',
|
|
14616
|
+
'#0066FF',
|
|
14617
|
+
'#0099CC',
|
|
14618
|
+
'#0099FF',
|
|
14619
|
+
'#00CC00',
|
|
14620
|
+
'#00CC33',
|
|
14621
|
+
'#00CC66',
|
|
14622
|
+
'#00CC99',
|
|
14623
|
+
'#00CCCC',
|
|
14624
|
+
'#00CCFF',
|
|
14625
|
+
'#3300CC',
|
|
14626
|
+
'#3300FF',
|
|
14627
|
+
'#3333CC',
|
|
14628
|
+
'#3333FF',
|
|
14629
|
+
'#3366CC',
|
|
14630
|
+
'#3366FF',
|
|
14631
|
+
'#3399CC',
|
|
14632
|
+
'#3399FF',
|
|
14633
|
+
'#33CC00',
|
|
14634
|
+
'#33CC33',
|
|
14635
|
+
'#33CC66',
|
|
14636
|
+
'#33CC99',
|
|
14637
|
+
'#33CCCC',
|
|
14638
|
+
'#33CCFF',
|
|
14639
|
+
'#6600CC',
|
|
14640
|
+
'#6600FF',
|
|
14641
|
+
'#6633CC',
|
|
14642
|
+
'#6633FF',
|
|
14643
|
+
'#66CC00',
|
|
14644
|
+
'#66CC33',
|
|
14645
|
+
'#9900CC',
|
|
14646
|
+
'#9900FF',
|
|
14647
|
+
'#9933CC',
|
|
14648
|
+
'#9933FF',
|
|
14649
|
+
'#99CC00',
|
|
14650
|
+
'#99CC33',
|
|
14651
|
+
'#CC0000',
|
|
14652
|
+
'#CC0033',
|
|
14653
|
+
'#CC0066',
|
|
14654
|
+
'#CC0099',
|
|
14655
|
+
'#CC00CC',
|
|
14656
|
+
'#CC00FF',
|
|
14657
|
+
'#CC3300',
|
|
14658
|
+
'#CC3333',
|
|
14659
|
+
'#CC3366',
|
|
14660
|
+
'#CC3399',
|
|
14661
|
+
'#CC33CC',
|
|
14662
|
+
'#CC33FF',
|
|
14663
|
+
'#CC6600',
|
|
14664
|
+
'#CC6633',
|
|
14665
|
+
'#CC9900',
|
|
14666
|
+
'#CC9933',
|
|
14667
|
+
'#CCCC00',
|
|
14668
|
+
'#CCCC33',
|
|
14669
|
+
'#FF0000',
|
|
14670
|
+
'#FF0033',
|
|
14671
|
+
'#FF0066',
|
|
14672
|
+
'#FF0099',
|
|
14673
|
+
'#FF00CC',
|
|
14674
|
+
'#FF00FF',
|
|
14675
|
+
'#FF3300',
|
|
14676
|
+
'#FF3333',
|
|
14677
|
+
'#FF3366',
|
|
14678
|
+
'#FF3399',
|
|
14679
|
+
'#FF33CC',
|
|
14680
|
+
'#FF33FF',
|
|
14681
|
+
'#FF6600',
|
|
14682
|
+
'#FF6633',
|
|
14683
|
+
'#FF9900',
|
|
14684
|
+
'#FF9933',
|
|
14685
|
+
'#FFCC00',
|
|
14686
|
+
'#FFCC33'
|
|
14687
|
+
];
|
|
14688
|
+
|
|
14689
|
+
/**
|
|
14690
|
+
* Currently only WebKit-based Web Inspectors, Firefox >= v31,
|
|
14691
|
+
* and the Firebug extension (any Firefox version) are known
|
|
14692
|
+
* to support "%c" CSS customizations.
|
|
13957
14693
|
*
|
|
13958
|
-
*
|
|
14694
|
+
* TODO: add a `localStorage` variable to explicitly enable/disable colors
|
|
13959
14695
|
*/
|
|
13960
14696
|
|
|
13961
|
-
|
|
13962
|
-
|
|
13963
|
-
|
|
13964
|
-
//
|
|
13965
|
-
|
|
13966
|
-
|
|
13967
|
-
|
|
13968
|
-
.replace(/_([a-z])/g, (_, k) => {
|
|
13969
|
-
return k.toUpperCase();
|
|
13970
|
-
});
|
|
13971
|
-
|
|
13972
|
-
// Coerce string value into JS value
|
|
13973
|
-
let val = process.env[key];
|
|
13974
|
-
if (/^(yes|on|true|enabled)$/i.test(val)) {
|
|
13975
|
-
val = true;
|
|
13976
|
-
} else if (/^(no|off|false|disabled)$/i.test(val)) {
|
|
13977
|
-
val = false;
|
|
13978
|
-
} else if (val === 'null') {
|
|
13979
|
-
val = null;
|
|
13980
|
-
} else {
|
|
13981
|
-
val = Number(val);
|
|
14697
|
+
// eslint-disable-next-line complexity
|
|
14698
|
+
function useColors() {
|
|
14699
|
+
// NB: In an Electron preload script, document will be defined but not fully
|
|
14700
|
+
// initialized. Since we know we're in Chrome, we'll just detect this case
|
|
14701
|
+
// explicitly
|
|
14702
|
+
if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
|
|
14703
|
+
return true;
|
|
13982
14704
|
}
|
|
13983
14705
|
|
|
13984
|
-
|
|
13985
|
-
|
|
13986
|
-
|
|
13987
|
-
|
|
13988
|
-
/**
|
|
13989
|
-
* Is stdout a TTY? Colored output is enabled when `true`.
|
|
13990
|
-
*/
|
|
14706
|
+
// Internet Explorer and Edge do not support colors.
|
|
14707
|
+
if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
|
14708
|
+
return false;
|
|
14709
|
+
}
|
|
13991
14710
|
|
|
13992
|
-
|
|
13993
|
-
|
|
13994
|
-
|
|
13995
|
-
|
|
14711
|
+
// Is webkit? http://stackoverflow.com/a/16459606/376773
|
|
14712
|
+
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
|
|
14713
|
+
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
|
|
14714
|
+
// Is firebug? http://stackoverflow.com/a/398120/376773
|
|
14715
|
+
(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
|
|
14716
|
+
// Is firefox >= v31?
|
|
14717
|
+
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
14718
|
+
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
|
|
14719
|
+
// Double check webkit in userAgent just in case we are in a worker
|
|
14720
|
+
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
|
|
13996
14721
|
}
|
|
13997
14722
|
|
|
13998
14723
|
/**
|
|
13999
|
-
*
|
|
14724
|
+
* Colorize log arguments if enabled.
|
|
14000
14725
|
*
|
|
14001
14726
|
* @api public
|
|
14002
14727
|
*/
|
|
14003
14728
|
|
|
14004
14729
|
function formatArgs(args) {
|
|
14005
|
-
|
|
14006
|
-
|
|
14007
|
-
|
|
14008
|
-
|
|
14009
|
-
|
|
14010
|
-
|
|
14730
|
+
args[0] = (this.useColors ? '%c' : '') +
|
|
14731
|
+
this.namespace +
|
|
14732
|
+
(this.useColors ? ' %c' : ' ') +
|
|
14733
|
+
args[0] +
|
|
14734
|
+
(this.useColors ? '%c ' : ' ') +
|
|
14735
|
+
'+' + module.exports.humanize(this.diff);
|
|
14011
14736
|
|
|
14012
|
-
|
|
14013
|
-
|
|
14014
|
-
} else {
|
|
14015
|
-
args[0] = getDate() + name + ' ' + args[0];
|
|
14737
|
+
if (!this.useColors) {
|
|
14738
|
+
return;
|
|
14016
14739
|
}
|
|
14017
|
-
}
|
|
14018
14740
|
|
|
14019
|
-
|
|
14020
|
-
|
|
14021
|
-
|
|
14022
|
-
|
|
14023
|
-
|
|
14741
|
+
const c = 'color: ' + this.color;
|
|
14742
|
+
args.splice(1, 0, c, 'color: inherit');
|
|
14743
|
+
|
|
14744
|
+
// The final "%c" is somewhat tricky, because there could be other
|
|
14745
|
+
// arguments passed either before or after the %c, so we need to
|
|
14746
|
+
// figure out the correct index to insert the CSS into
|
|
14747
|
+
let index = 0;
|
|
14748
|
+
let lastC = 0;
|
|
14749
|
+
args[0].replace(/%[a-zA-Z%]/g, match => {
|
|
14750
|
+
if (match === '%%') {
|
|
14751
|
+
return;
|
|
14752
|
+
}
|
|
14753
|
+
index++;
|
|
14754
|
+
if (match === '%c') {
|
|
14755
|
+
// We only are interested in the *last* %c
|
|
14756
|
+
// (the user may have provided their own)
|
|
14757
|
+
lastC = index;
|
|
14758
|
+
}
|
|
14759
|
+
});
|
|
14760
|
+
|
|
14761
|
+
args.splice(lastC, 0, c);
|
|
14024
14762
|
}
|
|
14025
14763
|
|
|
14026
14764
|
/**
|
|
14027
|
-
* Invokes `
|
|
14765
|
+
* Invokes `console.debug()` when available.
|
|
14766
|
+
* No-op when `console.debug` is not a "function".
|
|
14767
|
+
* If `console.debug` is not available, falls back
|
|
14768
|
+
* to `console.log`.
|
|
14769
|
+
*
|
|
14770
|
+
* @api public
|
|
14028
14771
|
*/
|
|
14029
|
-
|
|
14030
|
-
function log(...args) {
|
|
14031
|
-
return process.stderr.write(util.format(...args) + '\n');
|
|
14032
|
-
}
|
|
14772
|
+
exports.log = console.debug || console.log || (() => {});
|
|
14033
14773
|
|
|
14034
14774
|
/**
|
|
14035
14775
|
* Save `namespaces`.
|
|
@@ -14038,12 +14778,15 @@ function requireNode () {
|
|
|
14038
14778
|
* @api private
|
|
14039
14779
|
*/
|
|
14040
14780
|
function save(namespaces) {
|
|
14041
|
-
|
|
14042
|
-
|
|
14043
|
-
|
|
14044
|
-
|
|
14045
|
-
|
|
14046
|
-
|
|
14781
|
+
try {
|
|
14782
|
+
if (namespaces) {
|
|
14783
|
+
exports.storage.setItem('debug', namespaces);
|
|
14784
|
+
} else {
|
|
14785
|
+
exports.storage.removeItem('debug');
|
|
14786
|
+
}
|
|
14787
|
+
} catch (error) {
|
|
14788
|
+
// Swallow
|
|
14789
|
+
// XXX (@Qix-) should we be logging these?
|
|
14047
14790
|
}
|
|
14048
14791
|
}
|
|
14049
14792
|
|
|
@@ -14053,24 +14796,42 @@ function requireNode () {
|
|
|
14053
14796
|
* @return {String} returns the previously persisted debug modes
|
|
14054
14797
|
* @api private
|
|
14055
14798
|
*/
|
|
14056
|
-
|
|
14057
14799
|
function load() {
|
|
14058
|
-
|
|
14800
|
+
let r;
|
|
14801
|
+
try {
|
|
14802
|
+
r = exports.storage.getItem('debug');
|
|
14803
|
+
} catch (error) {
|
|
14804
|
+
// Swallow
|
|
14805
|
+
// XXX (@Qix-) should we be logging these?
|
|
14806
|
+
}
|
|
14807
|
+
|
|
14808
|
+
// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
|
|
14809
|
+
if (!r && typeof process !== 'undefined' && 'env' in process) {
|
|
14810
|
+
r = process.env.DEBUG;
|
|
14811
|
+
}
|
|
14812
|
+
|
|
14813
|
+
return r;
|
|
14059
14814
|
}
|
|
14060
14815
|
|
|
14061
14816
|
/**
|
|
14062
|
-
*
|
|
14817
|
+
* Localstorage attempts to return the localstorage.
|
|
14063
14818
|
*
|
|
14064
|
-
*
|
|
14065
|
-
*
|
|
14819
|
+
* This is necessary because safari throws
|
|
14820
|
+
* when a user disables cookies/localstorage
|
|
14821
|
+
* and you attempt to access it.
|
|
14822
|
+
*
|
|
14823
|
+
* @return {LocalStorage}
|
|
14824
|
+
* @api private
|
|
14066
14825
|
*/
|
|
14067
14826
|
|
|
14068
|
-
function
|
|
14069
|
-
|
|
14070
|
-
|
|
14071
|
-
|
|
14072
|
-
|
|
14073
|
-
|
|
14827
|
+
function localstorage() {
|
|
14828
|
+
try {
|
|
14829
|
+
// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
|
|
14830
|
+
// The Browser also has localStorage in the global context.
|
|
14831
|
+
return localStorage;
|
|
14832
|
+
} catch (error) {
|
|
14833
|
+
// Swallow
|
|
14834
|
+
// XXX (@Qix-) should we be logging these?
|
|
14074
14835
|
}
|
|
14075
14836
|
}
|
|
14076
14837
|
|
|
@@ -14079,27 +14840,18 @@ function requireNode () {
|
|
|
14079
14840
|
const {formatters} = module.exports;
|
|
14080
14841
|
|
|
14081
14842
|
/**
|
|
14082
|
-
* Map %
|
|
14083
|
-
*/
|
|
14084
|
-
|
|
14085
|
-
formatters.o = function (v) {
|
|
14086
|
-
this.inspectOpts.colors = this.useColors;
|
|
14087
|
-
return util.inspect(v, this.inspectOpts)
|
|
14088
|
-
.split('\n')
|
|
14089
|
-
.map(str => str.trim())
|
|
14090
|
-
.join(' ');
|
|
14091
|
-
};
|
|
14092
|
-
|
|
14093
|
-
/**
|
|
14094
|
-
* Map %O to `util.inspect()`, allowing multiple lines if needed.
|
|
14843
|
+
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
|
|
14095
14844
|
*/
|
|
14096
14845
|
|
|
14097
|
-
formatters.
|
|
14098
|
-
|
|
14099
|
-
|
|
14846
|
+
formatters.j = function (v) {
|
|
14847
|
+
try {
|
|
14848
|
+
return JSON.stringify(v);
|
|
14849
|
+
} catch (error) {
|
|
14850
|
+
return '[UnexpectedJSONParseError]: ' + error.message;
|
|
14851
|
+
}
|
|
14100
14852
|
};
|
|
14101
|
-
} (
|
|
14102
|
-
return
|
|
14853
|
+
} (browser, browser.exports));
|
|
14854
|
+
return browser.exports;
|
|
14103
14855
|
}
|
|
14104
14856
|
|
|
14105
14857
|
/**
|
|
@@ -14307,6 +15059,13 @@ var __async = (__this, __arguments, generator) => {
|
|
|
14307
15059
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
14308
15060
|
});
|
|
14309
15061
|
};
|
|
15062
|
+
|
|
15063
|
+
// src/lib/args/pathspec.ts
|
|
15064
|
+
function pathspec(...paths) {
|
|
15065
|
+
const key = new String(paths);
|
|
15066
|
+
cache.set(key, paths);
|
|
15067
|
+
return key;
|
|
15068
|
+
}
|
|
14310
15069
|
function isPathSpec(path) {
|
|
14311
15070
|
return path instanceof String && cache.has(path);
|
|
14312
15071
|
}
|
|
@@ -16109,7 +16868,7 @@ function parseLogOptions(opt = {}, customArgs = []) {
|
|
|
16109
16868
|
suffix.push(`${opt.from || ""}${rangeOperator}${opt.to || ""}`);
|
|
16110
16869
|
}
|
|
16111
16870
|
if (filterString(opt.file)) {
|
|
16112
|
-
|
|
16871
|
+
command.push("--follow", pathspec(opt.file));
|
|
16113
16872
|
}
|
|
16114
16873
|
appendTaskOptions(userOptions(opt), command);
|
|
16115
16874
|
return {
|
|
@@ -16146,6 +16905,7 @@ var excludeOptions;
|
|
|
16146
16905
|
var init_log = __esm({
|
|
16147
16906
|
"src/lib/tasks/log.ts"() {
|
|
16148
16907
|
init_log_format();
|
|
16908
|
+
init_pathspec();
|
|
16149
16909
|
init_parse_list_log_summary();
|
|
16150
16910
|
init_utils();
|
|
16151
16911
|
init_task();
|
|
@@ -18243,6 +19003,7 @@ const NANO_TYPE_MAP = {
|
|
|
18243
19003
|
nano: "nano",
|
|
18244
19004
|
frontend: "frontend",
|
|
18245
19005
|
extension: "extension",
|
|
19006
|
+
widget: "widget",
|
|
18246
19007
|
editor: "frontend",
|
|
18247
19008
|
molecules: "frontend",
|
|
18248
19009
|
};
|
|
@@ -18531,7 +19292,11 @@ const currentNodeVersion = async (debug) => {
|
|
|
18531
19292
|
});
|
|
18532
19293
|
|
|
18533
19294
|
if (!nodeVersionFileContent) {
|
|
18534
|
-
return {
|
|
19295
|
+
return {
|
|
19296
|
+
error: "No file or content found in the .nvmrc file.",
|
|
19297
|
+
status: STATUSES.FAIL,
|
|
19298
|
+
fix,
|
|
19299
|
+
};
|
|
18535
19300
|
}
|
|
18536
19301
|
|
|
18537
19302
|
const [major = 0, minor = 0, patch = 0] = getSemVer(nodeVersionFileContent);
|
|
@@ -18554,7 +19319,7 @@ const currentNodeVersion = async (debug) => {
|
|
|
18554
19319
|
|
|
18555
19320
|
const ESLINT_DESTINATION_DIRECTORY = path$1.resolve("./");
|
|
18556
19321
|
|
|
18557
|
-
const NANOS_TO_OVERRIDE = ["nano", "extension"];
|
|
19322
|
+
const NANOS_TO_OVERRIDE$1 = ["nano", "extension", "widget"];
|
|
18558
19323
|
|
|
18559
19324
|
const eslint = async (debug) => {
|
|
18560
19325
|
const { type, repoName } = await getNanoType();
|
|
@@ -18565,7 +19330,7 @@ const eslint = async (debug) => {
|
|
|
18565
19330
|
return { isSuccess: true, status: STATUSES.SKIPPED };
|
|
18566
19331
|
}
|
|
18567
19332
|
|
|
18568
|
-
const eslintCommonSource = NANOS_TO_OVERRIDE.includes(type) ? type : "common";
|
|
19333
|
+
const eslintCommonSource = NANOS_TO_OVERRIDE$1.includes(type) ? type : "common";
|
|
18569
19334
|
|
|
18570
19335
|
const eslintSourceDirectory = path$1.resolve(
|
|
18571
19336
|
`./node_modules/@bigbinary/neeto-audit-frontend/common/eslint/${eslintCommonSource}`
|
|
@@ -18671,6 +19436,8 @@ const husky = async (debug) => {
|
|
|
18671
19436
|
|
|
18672
19437
|
const PRETTIER_DESTINATION_PATH = path$1.resolve("./");
|
|
18673
19438
|
|
|
19439
|
+
const NANOS_TO_OVERRIDE = ["extension", "widget"];
|
|
19440
|
+
|
|
18674
19441
|
const prettier = async (debug) => {
|
|
18675
19442
|
const { type, repoName } = await getNanoType();
|
|
18676
19443
|
|
|
@@ -18680,7 +19447,9 @@ const prettier = async (debug) => {
|
|
|
18680
19447
|
return { isSuccess: true, status: STATUSES.SKIPPED };
|
|
18681
19448
|
}
|
|
18682
19449
|
|
|
18683
|
-
const prettierCommonSource = type
|
|
19450
|
+
const prettierCommonSource = NANOS_TO_OVERRIDE.includes(type)
|
|
19451
|
+
? type
|
|
19452
|
+
: "common";
|
|
18684
19453
|
|
|
18685
19454
|
const prettierSourceDirectory = path$1.resolve(
|
|
18686
19455
|
`./node_modules/@bigbinary/neeto-audit-frontend/common/prettier/${prettierCommonSource}`
|
|
@@ -18727,7 +19496,11 @@ const DEV_DEPENDENCIES$4 = {
|
|
|
18727
19496
|
"@babel/runtime": "7.22.6",
|
|
18728
19497
|
"@bigbinary/babel-preset-neeto": "1.0.3",
|
|
18729
19498
|
"@bigbinary/eslint-plugin-neeto": "1.1.2",
|
|
18730
|
-
"@bigbinary/neeto-audit-frontend": "
|
|
19499
|
+
"@bigbinary/neeto-audit-frontend": "2.0.2",
|
|
19500
|
+
"@bigbinary/neeto-cist": "1.0.0",
|
|
19501
|
+
"@bigbinary/neeto-commons-frontend": "2.0.99",
|
|
19502
|
+
"@bigbinary/neeto-icons": "1.13.0",
|
|
19503
|
+
"@bigbinary/neetoui": "5.0.15",
|
|
18731
19504
|
autoprefixer: "10.4.14",
|
|
18732
19505
|
"babel-loader": "9.1.3",
|
|
18733
19506
|
"babel-plugin-istanbul": "6.1.1",
|
|
@@ -18766,10 +19539,8 @@ var common = {
|
|
|
18766
19539
|
};
|
|
18767
19540
|
|
|
18768
19541
|
const DEPENDENCIES$3 = {
|
|
18769
|
-
"@
|
|
18770
|
-
"@
|
|
18771
|
-
"@bigbinary/neetoui": "5.0.15",
|
|
18772
|
-
"@honeybadger-io/react": "2.0.1",
|
|
19542
|
+
"@honeybadger-io/js": "6.5.3",
|
|
19543
|
+
"@honeybadger-io/react": "6.1.9",
|
|
18773
19544
|
antd: "4.24.10",
|
|
18774
19545
|
axios: "1.4.0",
|
|
18775
19546
|
i18next: "23.2.11",
|
|
@@ -18797,13 +19568,11 @@ var extension = {
|
|
|
18797
19568
|
const DEPENDENCIES$2 = {};
|
|
18798
19569
|
|
|
18799
19570
|
const DEV_DEPENDENCIES$2 = {
|
|
18800
|
-
"@bigbinary/neeto-commons-frontend": "2.0.99",
|
|
18801
19571
|
"@bigbinary/neeto-filters-frontend": "2.12.1",
|
|
18802
19572
|
"@bigbinary/neeto-molecules": "1.0.34",
|
|
18803
|
-
"@bigbinary/neeto-icons": "1.13.0",
|
|
18804
|
-
"@bigbinary/neetoui": "5.0.15",
|
|
18805
19573
|
"@faker-js/faker": "8.0.2",
|
|
18806
|
-
"@honeybadger-io/
|
|
19574
|
+
"@honeybadger-io/js": "6.5.3",
|
|
19575
|
+
"@honeybadger-io/react": "6.1.9",
|
|
18807
19576
|
"@rollup/plugin-alias": "5.0.0",
|
|
18808
19577
|
"@rollup/plugin-babel": "6.0.3",
|
|
18809
19578
|
"@rollup/plugin-commonjs": "25.0.3",
|
|
@@ -18844,7 +19613,8 @@ const PEER_DEPENDENCIES$2 = {
|
|
|
18844
19613
|
"@bigbinary/neeto-icons": "^1.9.22",
|
|
18845
19614
|
"@bigbinary/neeto-molecules": "^1.0.9",
|
|
18846
19615
|
"@bigbinary/neetoui": "^5.0.4",
|
|
18847
|
-
"@honeybadger-io/
|
|
19616
|
+
"@honeybadger-io/js": "^6.5.3",
|
|
19617
|
+
"@honeybadger-io/react": "^6.1.9",
|
|
18848
19618
|
axios: "^0.27.2",
|
|
18849
19619
|
classnames: "^2.3.2",
|
|
18850
19620
|
formik: "^2.2.9",
|
|
@@ -18871,13 +19641,11 @@ var frontend = {
|
|
|
18871
19641
|
const DEPENDENCIES$1 = {};
|
|
18872
19642
|
|
|
18873
19643
|
const DEV_DEPENDENCIES$1 = {
|
|
18874
|
-
"@bigbinary/neeto-commons-frontend": "2.0.99",
|
|
18875
19644
|
"@bigbinary/neeto-filters-frontend": "2.12.1",
|
|
18876
19645
|
"@bigbinary/neeto-molecules": "1.0.34",
|
|
18877
|
-
"@bigbinary/neeto-icons": "1.13.0",
|
|
18878
|
-
"@bigbinary/neetoui": "5.0.15",
|
|
18879
19646
|
"@faker-js/faker": "8.0.2",
|
|
18880
|
-
"@honeybadger-io/
|
|
19647
|
+
"@honeybadger-io/js": "6.5.3",
|
|
19648
|
+
"@honeybadger-io/react": "6.1.9",
|
|
18881
19649
|
"@rollup/plugin-alias": "5.0.0",
|
|
18882
19650
|
"@rollup/plugin-babel": "6.0.3",
|
|
18883
19651
|
"@rollup/plugin-commonjs": "25.0.3",
|
|
@@ -18918,7 +19686,8 @@ const PEER_DEPENDENCIES$1 = {
|
|
|
18918
19686
|
"@bigbinary/neeto-icons": "^1.9.22",
|
|
18919
19687
|
"@bigbinary/neeto-molecules": "^1.0.9",
|
|
18920
19688
|
"@bigbinary/neetoui": "^5.0.4",
|
|
18921
|
-
"@honeybadger-io/
|
|
19689
|
+
"@honeybadger-io/js": "^6.5.3",
|
|
19690
|
+
"@honeybadger-io/react": "^6.1.9",
|
|
18922
19691
|
axios: "^0.27.2",
|
|
18923
19692
|
classnames: "^2.3.2",
|
|
18924
19693
|
formik: "^2.2.9",
|
|
@@ -18975,15 +19744,15 @@ const getOutdatedPackages = (recommendedVersions, packageJson) =>
|
|
|
18975
19744
|
recommendedList
|
|
18976
19745
|
);
|
|
18977
19746
|
|
|
18978
|
-
const outdatedPackages = pickBy$1(not, packages);
|
|
19747
|
+
const outdatedPackages = pickBy$1(not$1, packages);
|
|
18979
19748
|
|
|
18980
19749
|
return { type, outdatedPackages: Object.keys(outdatedPackages) };
|
|
18981
19750
|
});
|
|
18982
19751
|
|
|
18983
19752
|
const sortByKey = (object) =>
|
|
18984
|
-
map(
|
|
19753
|
+
map$1(
|
|
18985
19754
|
(value) =>
|
|
18986
|
-
is$
|
|
19755
|
+
is$2(Object, value) && !Array.isArray(value)
|
|
18987
19756
|
? fromPairs$1(toPairs$1(value).sort())
|
|
18988
19757
|
: value,
|
|
18989
19758
|
object
|
|
@@ -19009,6 +19778,10 @@ const recommendedPackageVersions = async (debug) => {
|
|
|
19009
19778
|
|
|
19010
19779
|
const { type } = await getNanoType();
|
|
19011
19780
|
|
|
19781
|
+
if (type === NANO_TYPE_MAP.widget) {
|
|
19782
|
+
return { isSuccess: true, status: STATUSES.SKIPPED };
|
|
19783
|
+
}
|
|
19784
|
+
|
|
19012
19785
|
const recommendedVersions = mergeDeepRight$1(
|
|
19013
19786
|
recommendedDependencies["common"],
|
|
19014
19787
|
recommendedDependencies[type]
|