jscrewit 2.33.1 → 2.34.0
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/Features.md +4 -4
- package/api-doc/README.md +1 -1
- package/api-doc/interfaces/FeatureAll.md +79 -104
- package/api-doc/interfaces/FeatureConstructor.md +83 -112
- package/lib/feature-all.d.ts +10 -34
- package/lib/jscrewit.js +223 -233
- package/lib/jscrewit.min.js +2 -2
- package/package.json +2 -4
- package/readme.md +1 -1
- package/ui/ui.js +1 -1
- package/api-doc/.nojekyll +0 -1
package/lib/jscrewit.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// JScrewIt 2.
|
|
1
|
+
// JScrewIt 2.34.0 – https://jscrew.it
|
|
2
2
|
|
|
3
3
|
(function () {
|
|
4
4
|
'use strict';
|
|
@@ -310,18 +310,12 @@
|
|
|
310
310
|
return unionMask;
|
|
311
311
|
}
|
|
312
312
|
|
|
313
|
-
var keyFor = function (mask) { return "_"
|
|
313
|
+
var keyFor = function (mask) { return "_".concat(mask); };
|
|
314
314
|
var MaskIndex = /** @class */ (function () {
|
|
315
315
|
function MaskIndex() {
|
|
316
316
|
this._index = Object.create(null);
|
|
317
317
|
this._size = 0;
|
|
318
318
|
}
|
|
319
|
-
/** Determines whether the current collection contains an entry for a specified mask. */
|
|
320
|
-
MaskIndex.prototype.has = function (mask) {
|
|
321
|
-
var key = keyFor(mask);
|
|
322
|
-
var returnValue = key in this._index;
|
|
323
|
-
return returnValue;
|
|
324
|
-
};
|
|
325
319
|
Object.defineProperty(MaskIndex.prototype, "size", {
|
|
326
320
|
/* The number of entries in the current collection. */
|
|
327
321
|
get: function () {
|
|
@@ -330,6 +324,12 @@
|
|
|
330
324
|
enumerable: false,
|
|
331
325
|
configurable: true
|
|
332
326
|
});
|
|
327
|
+
/** Determines whether the current collection contains an entry for a specified mask. */
|
|
328
|
+
MaskIndex.prototype.has = function (mask) {
|
|
329
|
+
var key = keyFor(mask);
|
|
330
|
+
var returnValue = key in this._index;
|
|
331
|
+
return returnValue;
|
|
332
|
+
};
|
|
333
333
|
MaskIndex.prototype._setEntry = function (mask, value) {
|
|
334
334
|
var key = keyFor(mask);
|
|
335
335
|
var _index = this._index;
|
|
@@ -634,8 +634,8 @@
|
|
|
634
634
|
name: undefined,
|
|
635
635
|
toString: function () {
|
|
636
636
|
var _a;
|
|
637
|
-
var name = (_a = this.name) !== null && _a !== void 0 ? _a : "<"
|
|
638
|
-
var str = "[Feature "
|
|
637
|
+
var name = (_a = this.name) !== null && _a !== void 0 ? _a : "<".concat(this.canonicalNames.join(', '), ">");
|
|
638
|
+
var str = "[Feature ".concat(name, "]");
|
|
639
639
|
return str;
|
|
640
640
|
},
|
|
641
641
|
};
|
|
@@ -871,12 +871,12 @@
|
|
|
871
871
|
return false;
|
|
872
872
|
}
|
|
873
873
|
var str = parts.length && (!compact || isMultiline()) ?
|
|
874
|
-
intro
|
|
875
|
-
""
|
|
874
|
+
"".concat(intro, "\n").concat(indent(parts.join("".concat(partSeparator, "\n"))), "\n").concat(outro) :
|
|
875
|
+
"".concat(intro).concat(preSeparator).concat(parts.join("".concat(partSeparator, " "))).concat(outro);
|
|
876
876
|
return str;
|
|
877
877
|
}
|
|
878
878
|
function throwUnknownFeatureError(name) {
|
|
879
|
-
throw new _Error("Unknown feature "
|
|
879
|
+
throw new _Error("Unknown feature ".concat(_JSON_stringify(name)));
|
|
880
880
|
}
|
|
881
881
|
function wrapCheck(check) {
|
|
882
882
|
var wrappedCheck = function () { return !!check(); };
|
|
@@ -1722,6 +1722,7 @@
|
|
|
1722
1722
|
includes:
|
|
1723
1723
|
[
|
|
1724
1724
|
'ARROW',
|
|
1725
|
+
'AT',
|
|
1725
1726
|
'ATOB',
|
|
1726
1727
|
'BARPROP',
|
|
1727
1728
|
'ESC_HTML_QUOT_ONLY',
|
|
@@ -1843,15 +1844,26 @@
|
|
|
1843
1844
|
FF_ESR:
|
|
1844
1845
|
{
|
|
1845
1846
|
description: describeEngine('the current version of Firefox ESR'),
|
|
1846
|
-
aliasFor: '
|
|
1847
|
+
aliasFor: 'FF_90',
|
|
1847
1848
|
},
|
|
1848
|
-
|
|
1849
|
+
FF_PREV:
|
|
1850
|
+
{
|
|
1851
|
+
description: describeEngine('the previous to current version of Firefox'),
|
|
1852
|
+
aliasFor: 'FF_90',
|
|
1853
|
+
},
|
|
1854
|
+
FF:
|
|
1855
|
+
{
|
|
1856
|
+
description: describeEngine('the current stable version of Firefox'),
|
|
1857
|
+
aliasFor: 'FF_90',
|
|
1858
|
+
},
|
|
1859
|
+
FF_90:
|
|
1849
1860
|
{
|
|
1850
1861
|
families: ['Firefox'],
|
|
1851
|
-
versions: [['
|
|
1862
|
+
versions: [['90']],
|
|
1852
1863
|
includes:
|
|
1853
1864
|
[
|
|
1854
1865
|
'ARROW',
|
|
1866
|
+
'AT',
|
|
1855
1867
|
'ATOB',
|
|
1856
1868
|
'BARPROP',
|
|
1857
1869
|
'ESC_HTML_QUOT_ONLY',
|
|
@@ -1868,12 +1880,12 @@
|
|
|
1868
1880
|
'HISTORY',
|
|
1869
1881
|
'HTMLDOCUMENT',
|
|
1870
1882
|
'INCR_CHAR',
|
|
1883
|
+
'INTL',
|
|
1871
1884
|
'LOCALE_INFINITY',
|
|
1872
1885
|
'LOCALE_NUMERALS_EXT',
|
|
1873
1886
|
'LOCATION',
|
|
1874
1887
|
'NAME',
|
|
1875
1888
|
'NO_OLD_SAFARI_ARRAY_ITERATOR',
|
|
1876
|
-
'PLAIN_INTL',
|
|
1877
1889
|
'REGEXP_STRING_ITERATOR',
|
|
1878
1890
|
'SHORT_LOCALES',
|
|
1879
1891
|
'STATUS',
|
|
@@ -1882,28 +1894,6 @@
|
|
|
1882
1894
|
attributes:
|
|
1883
1895
|
{ 'char-increment-restriction': null, 'unstable': null, 'web-worker-restriction': null },
|
|
1884
1896
|
},
|
|
1885
|
-
FF_83:
|
|
1886
|
-
{
|
|
1887
|
-
inherits: 'FF_78',
|
|
1888
|
-
versions: [['83',, '89']],
|
|
1889
|
-
includes: { INTL: true, PLAIN_INTL: false },
|
|
1890
|
-
},
|
|
1891
|
-
FF_PREV:
|
|
1892
|
-
{
|
|
1893
|
-
description: describeEngine('the previous to current version of Firefox'),
|
|
1894
|
-
aliasFor: 'FF_90',
|
|
1895
|
-
},
|
|
1896
|
-
FF:
|
|
1897
|
-
{
|
|
1898
|
-
description: describeEngine('the current stable version of Firefox'),
|
|
1899
|
-
aliasFor: 'FF_90',
|
|
1900
|
-
},
|
|
1901
|
-
FF_90:
|
|
1902
|
-
{
|
|
1903
|
-
inherits: 'FF_83',
|
|
1904
|
-
versions: [['90']],
|
|
1905
|
-
includes: { AT: true },
|
|
1906
|
-
},
|
|
1907
1897
|
IE_9:
|
|
1908
1898
|
{
|
|
1909
1899
|
families: ['Internet Explorer'],
|
|
@@ -2129,16 +2119,22 @@
|
|
|
2129
2119
|
versions: [['14.0.1',, '14.0.3']],
|
|
2130
2120
|
includes: { INTL: true, PLAIN_INTL: false },
|
|
2131
2121
|
},
|
|
2122
|
+
SAFARI_14_1:
|
|
2123
|
+
{
|
|
2124
|
+
inherits: 'SAFARI_14_0_1',
|
|
2125
|
+
versions: [['14.1',, '15.3']],
|
|
2126
|
+
includes: { CONSOLE: false },
|
|
2127
|
+
},
|
|
2132
2128
|
SAFARI:
|
|
2133
2129
|
{
|
|
2134
2130
|
description: describeEngine('the current stable version of Safari'),
|
|
2135
|
-
aliasFor: '
|
|
2131
|
+
aliasFor: 'SAFARI_15_4',
|
|
2136
2132
|
},
|
|
2137
|
-
|
|
2133
|
+
SAFARI_15_4:
|
|
2138
2134
|
{
|
|
2139
|
-
inherits: '
|
|
2140
|
-
versions: [['
|
|
2141
|
-
includes: {
|
|
2135
|
+
inherits: 'SAFARI_14_1',
|
|
2136
|
+
versions: [['15.4']],
|
|
2137
|
+
includes: { AT: true },
|
|
2142
2138
|
},
|
|
2143
2139
|
};
|
|
2144
2140
|
(function ()
|
|
@@ -2324,13 +2320,13 @@
|
|
|
2324
2320
|
function evalExpr$1(expr) {
|
|
2325
2321
|
var value = tryEvalExpr(expr);
|
|
2326
2322
|
if (value === INVALID_EXPR)
|
|
2327
|
-
throw SyntaxError("Invalid expression "
|
|
2323
|
+
throw SyntaxError("Invalid expression ".concat(expr));
|
|
2328
2324
|
return value;
|
|
2329
2325
|
}
|
|
2330
2326
|
function tryEvalExpr(expr) {
|
|
2331
2327
|
var fn;
|
|
2332
2328
|
try {
|
|
2333
|
-
fn = Function("return("
|
|
2329
|
+
fn = Function("return(".concat(expr, ");"));
|
|
2334
2330
|
}
|
|
2335
2331
|
catch (_a) {
|
|
2336
2332
|
return INVALID_EXPR;
|
|
@@ -2379,9 +2375,9 @@
|
|
|
2379
2375
|
}
|
|
2380
2376
|
}
|
|
2381
2377
|
};
|
|
2382
|
-
var isCombined = function (replacement, value) { return !value !== tryEvalExpr("!"
|
|
2383
|
-
var isPrefixed = function (replacement, value) { return "0"
|
|
2384
|
-
var isWeak$1 = function (replacement, value) { return ""
|
|
2378
|
+
var isCombined = function (replacement, value) { return !value !== tryEvalExpr("!".concat(replacement)); };
|
|
2379
|
+
var isPrefixed = function (replacement, value) { return "0".concat(value) !== tryEvalExpr("0+".concat(replacement)); };
|
|
2380
|
+
var isWeak$1 = function (replacement, value) { return "".concat(value) !== tryEvalExpr("\"\"+".concat(replacement)); };
|
|
2385
2381
|
|
|
2386
2382
|
function createTypeSet() {
|
|
2387
2383
|
var types = [];
|
|
@@ -2417,7 +2413,7 @@
|
|
|
2417
2413
|
createTypeSet(SolutionType.UNDEFINED),
|
|
2418
2414
|
createTypeSet(SolutionType.WEAK_ALGEBRAIC),
|
|
2419
2415
|
],
|
|
2420
|
-
replace: function (r1, r2, r3) { return r1
|
|
2416
|
+
replace: function (r1, r2, r3) { return "".concat(r1, "+(").concat(r2, "+[").concat(r3, "])"); },
|
|
2421
2417
|
solutionType: SolutionType.PREFIXED_STRING,
|
|
2422
2418
|
},
|
|
2423
2419
|
{
|
|
@@ -2426,7 +2422,7 @@
|
|
|
2426
2422
|
createTypeSet(SolutionType.UNDEFINED),
|
|
2427
2423
|
createTypeSet(SolutionType.WEAK_PREFIXED_STRING),
|
|
2428
2424
|
],
|
|
2429
|
-
replace: function (r1, r2, r3) { return r1
|
|
2425
|
+
replace: function (r1, r2, r3) { return "".concat(r1, "+(").concat(r2, "+(").concat(r3, "))"); },
|
|
2430
2426
|
solutionType: SolutionType.PREFIXED_STRING,
|
|
2431
2427
|
},
|
|
2432
2428
|
{
|
|
@@ -2435,7 +2431,7 @@
|
|
|
2435
2431
|
createTypeSet(SolutionType.UNDEFINED),
|
|
2436
2432
|
createTypeSet(SolutionType.OBJECT, SolutionType.STRING, SolutionType.COMBINED_STRING),
|
|
2437
2433
|
],
|
|
2438
|
-
replace: function (r1, r2, r3) { return r1
|
|
2434
|
+
replace: function (r1, r2, r3) { return "".concat(r1, "+(").concat(r2, "+").concat(r3, ")"); },
|
|
2439
2435
|
solutionType: SolutionType.PREFIXED_STRING,
|
|
2440
2436
|
},
|
|
2441
2437
|
{
|
|
@@ -2443,7 +2439,7 @@
|
|
|
2443
2439
|
createTypeSet(SolutionType.UNDEFINED),
|
|
2444
2440
|
createTypeSet(SolutionType.UNDEFINED),
|
|
2445
2441
|
],
|
|
2446
|
-
replace: function (r1, r2) { return "[]+"
|
|
2442
|
+
replace: function (r1, r2) { return "[]+".concat(r1, "+").concat(r2); },
|
|
2447
2443
|
solutionType: SolutionType.COMBINED_STRING,
|
|
2448
2444
|
},
|
|
2449
2445
|
{
|
|
@@ -2451,7 +2447,7 @@
|
|
|
2451
2447
|
createTypeSet(SolutionType.UNDEFINED),
|
|
2452
2448
|
createTypeSet(SolutionType.ALGEBRAIC, SolutionType.WEAK_ALGEBRAIC),
|
|
2453
2449
|
],
|
|
2454
|
-
replace: function (r1, r2) { return r1
|
|
2450
|
+
replace: function (r1, r2) { return "".concat(r1, "+[").concat(r2, "]"); },
|
|
2455
2451
|
solutionType: SolutionType.PREFIXED_STRING,
|
|
2456
2452
|
},
|
|
2457
2453
|
{
|
|
@@ -2459,7 +2455,7 @@
|
|
|
2459
2455
|
createTypeSet(SolutionType.UNDEFINED),
|
|
2460
2456
|
createTypeSet(SolutionType.PREFIXED_STRING),
|
|
2461
2457
|
],
|
|
2462
|
-
replace: function (r1, r2) { return r1
|
|
2458
|
+
replace: function (r1, r2) { return "".concat(r1, "+(").concat(r2, ")"); },
|
|
2463
2459
|
solutionType: SolutionType.PREFIXED_STRING,
|
|
2464
2460
|
},
|
|
2465
2461
|
{
|
|
@@ -2473,7 +2469,7 @@
|
|
|
2473
2469
|
createTypeSet(SolutionType.ALGEBRAIC),
|
|
2474
2470
|
createTypeSet(SolutionType.UNDEFINED, SolutionType.ALGEBRAIC, SolutionType.PREFIXED_STRING),
|
|
2475
2471
|
],
|
|
2476
|
-
replace: function (r1, r2) { return "["
|
|
2472
|
+
replace: function (r1, r2) { return "[".concat(r1, "]+").concat(r2); },
|
|
2477
2473
|
solutionType: SolutionType.COMBINED_STRING,
|
|
2478
2474
|
},
|
|
2479
2475
|
{
|
|
@@ -2481,7 +2477,7 @@
|
|
|
2481
2477
|
createTypeSet(SolutionType.ALGEBRAIC),
|
|
2482
2478
|
createTypeSet(SolutionType.WEAK_ALGEBRAIC),
|
|
2483
2479
|
],
|
|
2484
|
-
replace: function (r1, r2) { return r1
|
|
2480
|
+
replace: function (r1, r2) { return "".concat(r1, "+[").concat(r2, "]"); },
|
|
2485
2481
|
solutionType: SolutionType.PREFIXED_STRING,
|
|
2486
2482
|
},
|
|
2487
2483
|
{
|
|
@@ -2495,7 +2491,7 @@
|
|
|
2495
2491
|
createTypeSet(SolutionType.WEAK_ALGEBRAIC),
|
|
2496
2492
|
createTypeSet(SolutionType.UNDEFINED, SolutionType.ALGEBRAIC, SolutionType.PREFIXED_STRING),
|
|
2497
2493
|
],
|
|
2498
|
-
replace: function (r1, r2) { return "["
|
|
2494
|
+
replace: function (r1, r2) { return "[".concat(r1, "]+").concat(r2); },
|
|
2499
2495
|
solutionType: SolutionType.COMBINED_STRING,
|
|
2500
2496
|
},
|
|
2501
2497
|
{
|
|
@@ -2503,7 +2499,7 @@
|
|
|
2503
2499
|
createTypeSet(SolutionType.WEAK_ALGEBRAIC),
|
|
2504
2500
|
createTypeSet(SolutionType.WEAK_ALGEBRAIC),
|
|
2505
2501
|
],
|
|
2506
|
-
replace: function (r1, r2) { return r1
|
|
2502
|
+
replace: function (r1, r2) { return "".concat(r1, "+[").concat(r2, "]"); },
|
|
2507
2503
|
solutionType: SolutionType.WEAK_PREFIXED_STRING,
|
|
2508
2504
|
},
|
|
2509
2505
|
{
|
|
@@ -2576,14 +2572,6 @@
|
|
|
2576
2572
|
_this._solutions = [];
|
|
2577
2573
|
return _this;
|
|
2578
2574
|
}
|
|
2579
|
-
DynamicSolution.prototype.append = function (solution) {
|
|
2580
|
-
this._replacement = undefined;
|
|
2581
|
-
this._solutions.push(solution);
|
|
2582
|
-
};
|
|
2583
|
-
DynamicSolution.prototype.prepend = function (solution) {
|
|
2584
|
-
this._replacement = undefined;
|
|
2585
|
-
this._solutions.unshift(solution);
|
|
2586
|
-
};
|
|
2587
2575
|
Object.defineProperty(DynamicSolution.prototype, "replacement", {
|
|
2588
2576
|
get: function () {
|
|
2589
2577
|
var _a;
|
|
@@ -2626,6 +2614,14 @@
|
|
|
2626
2614
|
enumerable: false,
|
|
2627
2615
|
configurable: true
|
|
2628
2616
|
});
|
|
2617
|
+
DynamicSolution.prototype.append = function (solution) {
|
|
2618
|
+
this._replacement = undefined;
|
|
2619
|
+
this._solutions.push(solution);
|
|
2620
|
+
};
|
|
2621
|
+
DynamicSolution.prototype.prepend = function (solution) {
|
|
2622
|
+
this._replacement = undefined;
|
|
2623
|
+
this._solutions.unshift(solution);
|
|
2624
|
+
};
|
|
2629
2625
|
return DynamicSolution;
|
|
2630
2626
|
}(AbstractSolution));
|
|
2631
2627
|
var LazySolution = /** @class */ (function (_super) {
|
|
@@ -2647,7 +2643,7 @@
|
|
|
2647
2643
|
attributes.enumerable = true;
|
|
2648
2644
|
Object.defineProperty(this, 'replacement', attributes);
|
|
2649
2645
|
};
|
|
2650
|
-
return LazySolution;
|
|
2646
|
+
return (LazySolution);
|
|
2651
2647
|
}(AbstractSolution));
|
|
2652
2648
|
var SimpleSolution = /** @class */ (function (_super) {
|
|
2653
2649
|
__extends(SimpleSolution, _super);
|
|
@@ -2682,7 +2678,7 @@
|
|
|
2682
2678
|
}
|
|
2683
2679
|
var getAppendableReplacement = function (_a) {
|
|
2684
2680
|
var replacement = _a.replacement, type = _a.type;
|
|
2685
|
-
return isWeak(type) ? "+("
|
|
2681
|
+
return isWeak(type) ? "+(".concat(replacement, ")") : "+".concat(replacement);
|
|
2686
2682
|
};
|
|
2687
2683
|
var getReplacement = function (_a) {
|
|
2688
2684
|
var replacement = _a.replacement;
|
|
@@ -4678,16 +4674,6 @@
|
|
|
4678
4674
|
}
|
|
4679
4675
|
)();
|
|
4680
4676
|
|
|
4681
|
-
var APPEND_LENGTH_OF_DIGIT_0 = 6;
|
|
4682
|
-
var APPEND_LENGTH_OF_DOT = 73;
|
|
4683
|
-
var APPEND_LENGTH_OF_FALSE = 4;
|
|
4684
|
-
var APPEND_LENGTH_OF_EMPTY = 3; // Append length of the empty array.
|
|
4685
|
-
var APPEND_LENGTH_OF_MINUS = 136;
|
|
4686
|
-
var APPEND_LENGTH_OF_PLUS_SIGN = 71;
|
|
4687
|
-
var APPEND_LENGTH_OF_SMALL_E = 26;
|
|
4688
|
-
|
|
4689
|
-
var APPEND_LENGTH_OF_DIGITS = [APPEND_LENGTH_OF_DIGIT_0, 8, 12, 17, 22, 27, 32, 37, 42, 47];
|
|
4690
|
-
|
|
4691
4677
|
// Recognized syntax elements include:
|
|
4692
4678
|
//
|
|
4693
4679
|
// • The boolean literals "true" and "false"
|
|
@@ -5278,29 +5264,15 @@
|
|
|
5278
5264
|
|
|
5279
5265
|
var expressParseCached$1 = expressParseCached;
|
|
5280
5266
|
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
return definitionCache[cacheKey];
|
|
5289
|
-
var definition;
|
|
5290
|
-
for (var entryIndex = entries.length; entryIndex--;)
|
|
5291
|
-
{
|
|
5292
|
-
var entry = entries[entryIndex];
|
|
5293
|
-
if (this.hasFeatures(entry.mask))
|
|
5294
|
-
{
|
|
5295
|
-
definition = entry.definition;
|
|
5296
|
-
break;
|
|
5297
|
-
}
|
|
5298
|
-
}
|
|
5299
|
-
definitionCache[cacheKey] = definition;
|
|
5300
|
-
return definition;
|
|
5301
|
-
}
|
|
5267
|
+
var APPEND_LENGTH_OF_DIGIT_0 = 6;
|
|
5268
|
+
var APPEND_LENGTH_OF_DOT = 73;
|
|
5269
|
+
var APPEND_LENGTH_OF_FALSE = 4;
|
|
5270
|
+
var APPEND_LENGTH_OF_EMPTY = 3; // Append length of the empty array.
|
|
5271
|
+
var APPEND_LENGTH_OF_MINUS = 136;
|
|
5272
|
+
var APPEND_LENGTH_OF_PLUS_SIGN = 71;
|
|
5273
|
+
var APPEND_LENGTH_OF_SMALL_E = 26;
|
|
5302
5274
|
|
|
5303
|
-
var
|
|
5275
|
+
var APPEND_LENGTH_OF_DIGITS = [APPEND_LENGTH_OF_DIGIT_0, 8, 12, 17, 22, 27, 32, 37, 42, 47];
|
|
5304
5276
|
|
|
5305
5277
|
var SCREW_NORMAL = 0;
|
|
5306
5278
|
var SCREW_AS_STRING = 1;
|
|
@@ -5460,6 +5432,129 @@
|
|
|
5460
5432
|
);
|
|
5461
5433
|
}
|
|
5462
5434
|
|
|
5435
|
+
function findDefinition(entries)
|
|
5436
|
+
{
|
|
5437
|
+
var cacheKey = entries.cacheKey;
|
|
5438
|
+
if (cacheKey === undefined)
|
|
5439
|
+
entries.cacheKey = cacheKey = ++lastCacheKey;
|
|
5440
|
+
var definitionCache = this._definitionCache;
|
|
5441
|
+
if (cacheKey in definitionCache)
|
|
5442
|
+
return definitionCache[cacheKey];
|
|
5443
|
+
var definition;
|
|
5444
|
+
for (var entryIndex = entries.length; entryIndex--;)
|
|
5445
|
+
{
|
|
5446
|
+
var entry = entries[entryIndex];
|
|
5447
|
+
if (this.hasFeatures(entry.mask))
|
|
5448
|
+
{
|
|
5449
|
+
definition = entry.definition;
|
|
5450
|
+
break;
|
|
5451
|
+
}
|
|
5452
|
+
}
|
|
5453
|
+
definitionCache[cacheKey] = definition;
|
|
5454
|
+
return definition;
|
|
5455
|
+
}
|
|
5456
|
+
|
|
5457
|
+
var lastCacheKey = 0;
|
|
5458
|
+
|
|
5459
|
+
function evalNumber(preMantissa, lastDigit, exp)
|
|
5460
|
+
{
|
|
5461
|
+
var value = +(preMantissa + lastDigit + 'e' + exp);
|
|
5462
|
+
return value;
|
|
5463
|
+
}
|
|
5464
|
+
|
|
5465
|
+
function formatPositiveNumber(number)
|
|
5466
|
+
{
|
|
5467
|
+
function getMantissa()
|
|
5468
|
+
{
|
|
5469
|
+
var lastDigitIndex = usefulDigits - 1;
|
|
5470
|
+
var preMantissa = digits.slice(0, lastDigitIndex);
|
|
5471
|
+
var lastDigit = +digits[lastDigitIndex];
|
|
5472
|
+
var value = evalNumber(preMantissa, lastDigit, exp);
|
|
5473
|
+
for (;;)
|
|
5474
|
+
{
|
|
5475
|
+
var decreasedLastDigit = lastDigit - 1;
|
|
5476
|
+
var newValue = evalNumber(preMantissa, decreasedLastDigit, exp);
|
|
5477
|
+
if (newValue !== value)
|
|
5478
|
+
break;
|
|
5479
|
+
lastDigit = decreasedLastDigit;
|
|
5480
|
+
}
|
|
5481
|
+
var mantissa = preMantissa + lastDigit;
|
|
5482
|
+
return mantissa;
|
|
5483
|
+
}
|
|
5484
|
+
|
|
5485
|
+
var str;
|
|
5486
|
+
var match = /^(\d+)(?:\.(\d+))?(?:e(.+))?$/.exec(number);
|
|
5487
|
+
var digitsAfterDot = match[2] || '';
|
|
5488
|
+
var digits = (match[1] + digitsAfterDot).replace(/^0+/, '');
|
|
5489
|
+
var usefulDigits = digits.search(/0*$/);
|
|
5490
|
+
var exp = (match[3] | 0) - digitsAfterDot.length + digits.length - usefulDigits;
|
|
5491
|
+
var mantissa = getMantissa();
|
|
5492
|
+
if (exp >= 0)
|
|
5493
|
+
{
|
|
5494
|
+
if (exp < 10)
|
|
5495
|
+
str = mantissa + extraZeros(exp);
|
|
5496
|
+
else if (exp % 100 === 99 && (exp > 99 || mantissa[1]))
|
|
5497
|
+
str = mantissa.replace(/.$/, '.$&e') + (exp + 1);
|
|
5498
|
+
else
|
|
5499
|
+
str = mantissa + 'e' + exp;
|
|
5500
|
+
}
|
|
5501
|
+
else
|
|
5502
|
+
{
|
|
5503
|
+
if (exp >= -mantissa.length)
|
|
5504
|
+
str = mantissa.slice(0, exp) + '.' + mantissa.slice(exp);
|
|
5505
|
+
else
|
|
5506
|
+
{
|
|
5507
|
+
var extraZeroCount = -mantissa.length - exp;
|
|
5508
|
+
var extraLength = APPEND_LENGTH_OF_DOT + APPEND_LENGTH_OF_DIGIT_0 * extraZeroCount;
|
|
5509
|
+
str =
|
|
5510
|
+
replaceNegativeExponential(mantissa, exp, extraLength) ||
|
|
5511
|
+
'.' + extraZeros(extraZeroCount) + mantissa;
|
|
5512
|
+
}
|
|
5513
|
+
}
|
|
5514
|
+
return str;
|
|
5515
|
+
}
|
|
5516
|
+
|
|
5517
|
+
function getMultiDigitLength(str)
|
|
5518
|
+
{
|
|
5519
|
+
var appendLength = 0;
|
|
5520
|
+
_Array_prototype_forEach_call
|
|
5521
|
+
(
|
|
5522
|
+
str,
|
|
5523
|
+
function (digit)
|
|
5524
|
+
{
|
|
5525
|
+
var digitAppendLength = APPEND_LENGTH_OF_DIGITS[digit];
|
|
5526
|
+
appendLength += digitAppendLength;
|
|
5527
|
+
}
|
|
5528
|
+
);
|
|
5529
|
+
return appendLength;
|
|
5530
|
+
}
|
|
5531
|
+
|
|
5532
|
+
function replaceNegativeExponential(mantissa, exp, rivalExtraLength)
|
|
5533
|
+
{
|
|
5534
|
+
var extraZeroCount;
|
|
5535
|
+
if (exp % 100 > 7 - 100)
|
|
5536
|
+
{
|
|
5537
|
+
if (exp % 10 > -7)
|
|
5538
|
+
extraZeroCount = 0;
|
|
5539
|
+
else
|
|
5540
|
+
extraZeroCount = 10 + exp % 10;
|
|
5541
|
+
}
|
|
5542
|
+
else
|
|
5543
|
+
extraZeroCount = 100 + exp % 100;
|
|
5544
|
+
mantissa += extraZeros(extraZeroCount);
|
|
5545
|
+
exp -= extraZeroCount;
|
|
5546
|
+
var extraLength =
|
|
5547
|
+
APPEND_LENGTH_OF_DIGIT_0 * extraZeroCount +
|
|
5548
|
+
APPEND_LENGTH_OF_SMALL_E +
|
|
5549
|
+
APPEND_LENGTH_OF_MINUS +
|
|
5550
|
+
getMultiDigitLength(_String$1(-exp));
|
|
5551
|
+
if (extraLength < rivalExtraLength)
|
|
5552
|
+
{
|
|
5553
|
+
var str = mantissa + 'e' + exp;
|
|
5554
|
+
return str;
|
|
5555
|
+
}
|
|
5556
|
+
}
|
|
5557
|
+
|
|
5463
5558
|
function findBase64AlphabetDefinition(encoder, element)
|
|
5464
5559
|
{
|
|
5465
5560
|
var definition;
|
|
@@ -5677,12 +5772,6 @@
|
|
|
5677
5772
|
return solution;
|
|
5678
5773
|
}
|
|
5679
5774
|
|
|
5680
|
-
function evalNumber(preMantissa, lastDigit, exp)
|
|
5681
|
-
{
|
|
5682
|
-
var value = +(preMantissa + lastDigit + 'e' + exp);
|
|
5683
|
-
return value;
|
|
5684
|
-
}
|
|
5685
|
-
|
|
5686
5775
|
function findOptimalSolution(encoder, source, entries, defaultSolutionType)
|
|
5687
5776
|
{
|
|
5688
5777
|
var optimalSolution;
|
|
@@ -5706,73 +5795,6 @@
|
|
|
5706
5795
|
return optimalSolution;
|
|
5707
5796
|
}
|
|
5708
5797
|
|
|
5709
|
-
function formatPositiveNumber(number)
|
|
5710
|
-
{
|
|
5711
|
-
function getMantissa()
|
|
5712
|
-
{
|
|
5713
|
-
var lastDigitIndex = usefulDigits - 1;
|
|
5714
|
-
var preMantissa = digits.slice(0, lastDigitIndex);
|
|
5715
|
-
var lastDigit = +digits[lastDigitIndex];
|
|
5716
|
-
var value = evalNumber(preMantissa, lastDigit, exp);
|
|
5717
|
-
for (;;)
|
|
5718
|
-
{
|
|
5719
|
-
var decreasedLastDigit = lastDigit - 1;
|
|
5720
|
-
var newValue = evalNumber(preMantissa, decreasedLastDigit, exp);
|
|
5721
|
-
if (newValue !== value)
|
|
5722
|
-
break;
|
|
5723
|
-
lastDigit = decreasedLastDigit;
|
|
5724
|
-
}
|
|
5725
|
-
var mantissa = preMantissa + lastDigit;
|
|
5726
|
-
return mantissa;
|
|
5727
|
-
}
|
|
5728
|
-
|
|
5729
|
-
var str;
|
|
5730
|
-
var match = /^(\d+)(?:\.(\d+))?(?:e(.+))?$/.exec(number);
|
|
5731
|
-
var digitsAfterDot = match[2] || '';
|
|
5732
|
-
var digits = (match[1] + digitsAfterDot).replace(/^0+/, '');
|
|
5733
|
-
var usefulDigits = digits.search(/0*$/);
|
|
5734
|
-
var exp = (match[3] | 0) - digitsAfterDot.length + digits.length - usefulDigits;
|
|
5735
|
-
var mantissa = getMantissa();
|
|
5736
|
-
if (exp >= 0)
|
|
5737
|
-
{
|
|
5738
|
-
if (exp < 10)
|
|
5739
|
-
str = mantissa + extraZeros(exp);
|
|
5740
|
-
else if (exp % 100 === 99 && (exp > 99 || mantissa[1]))
|
|
5741
|
-
str = mantissa.replace(/.$/, '.$&e') + (exp + 1);
|
|
5742
|
-
else
|
|
5743
|
-
str = mantissa + 'e' + exp;
|
|
5744
|
-
}
|
|
5745
|
-
else
|
|
5746
|
-
{
|
|
5747
|
-
if (exp >= -mantissa.length)
|
|
5748
|
-
str = mantissa.slice(0, exp) + '.' + mantissa.slice(exp);
|
|
5749
|
-
else
|
|
5750
|
-
{
|
|
5751
|
-
var extraZeroCount = -mantissa.length - exp;
|
|
5752
|
-
var extraLength = APPEND_LENGTH_OF_DOT + APPEND_LENGTH_OF_DIGIT_0 * extraZeroCount;
|
|
5753
|
-
str =
|
|
5754
|
-
replaceNegativeExponential(mantissa, exp, extraLength) ||
|
|
5755
|
-
'.' + extraZeros(extraZeroCount) + mantissa;
|
|
5756
|
-
}
|
|
5757
|
-
}
|
|
5758
|
-
return str;
|
|
5759
|
-
}
|
|
5760
|
-
|
|
5761
|
-
function getMultiDigitLength(str)
|
|
5762
|
-
{
|
|
5763
|
-
var appendLength = 0;
|
|
5764
|
-
_Array_prototype_forEach_call
|
|
5765
|
-
(
|
|
5766
|
-
str,
|
|
5767
|
-
function (digit)
|
|
5768
|
-
{
|
|
5769
|
-
var digitAppendLength = APPEND_LENGTH_OF_DIGITS[digit];
|
|
5770
|
-
appendLength += digitAppendLength;
|
|
5771
|
-
}
|
|
5772
|
-
);
|
|
5773
|
-
return appendLength;
|
|
5774
|
-
}
|
|
5775
|
-
|
|
5776
5798
|
function getReplacers(optimize)
|
|
5777
5799
|
{
|
|
5778
5800
|
var replaceString =
|
|
@@ -5827,39 +5849,6 @@
|
|
|
5827
5849
|
return replacement;
|
|
5828
5850
|
}
|
|
5829
5851
|
|
|
5830
|
-
function replaceMultiDigitNumber(number)
|
|
5831
|
-
{
|
|
5832
|
-
var str = formatPositiveNumber(number);
|
|
5833
|
-
var replacement = replaceStaticString(str);
|
|
5834
|
-
return replacement;
|
|
5835
|
-
}
|
|
5836
|
-
|
|
5837
|
-
function replaceNegativeExponential(mantissa, exp, rivalExtraLength)
|
|
5838
|
-
{
|
|
5839
|
-
var extraZeroCount;
|
|
5840
|
-
if (exp % 100 > 7 - 100)
|
|
5841
|
-
{
|
|
5842
|
-
if (exp % 10 > -7)
|
|
5843
|
-
extraZeroCount = 0;
|
|
5844
|
-
else
|
|
5845
|
-
extraZeroCount = 10 + exp % 10;
|
|
5846
|
-
}
|
|
5847
|
-
else
|
|
5848
|
-
extraZeroCount = 100 + exp % 100;
|
|
5849
|
-
mantissa += extraZeros(extraZeroCount);
|
|
5850
|
-
exp -= extraZeroCount;
|
|
5851
|
-
var extraLength =
|
|
5852
|
-
APPEND_LENGTH_OF_DIGIT_0 * extraZeroCount +
|
|
5853
|
-
APPEND_LENGTH_OF_SMALL_E +
|
|
5854
|
-
APPEND_LENGTH_OF_MINUS +
|
|
5855
|
-
getMultiDigitLength(_String$1(-exp));
|
|
5856
|
-
if (extraLength < rivalExtraLength)
|
|
5857
|
-
{
|
|
5858
|
-
var str = mantissa + 'e' + exp;
|
|
5859
|
-
return str;
|
|
5860
|
-
}
|
|
5861
|
-
}
|
|
5862
|
-
|
|
5863
5852
|
function replacePrimaryExpr(encoder, unit, bondStrength, unitIndices, maxLength, replacers)
|
|
5864
5853
|
{
|
|
5865
5854
|
var MIN_APPEND_LENGTH = 3;
|
|
@@ -8239,6 +8228,29 @@
|
|
|
8239
8228
|
var MIN_SOLUTION_SPAN = 2;
|
|
8240
8229
|
var RADIX_REPLACEMENTS = [];
|
|
8241
8230
|
|
|
8231
|
+
// DECIMAL_MIN_LENGTHS is indexed by decimalDigitMaxCount (the number of digits used to write
|
|
8232
|
+
// MAX_SAFE_INTEGER in base radix).
|
|
8233
|
+
// decimalDigitMaxCount may only range from 11 (for radix 36) to 15 (for radix 12).
|
|
8234
|
+
var DECIMAL_MIN_LENGTHS =
|
|
8235
|
+
[
|
|
8236
|
+
,
|
|
8237
|
+
,
|
|
8238
|
+
,
|
|
8239
|
+
,
|
|
8240
|
+
,
|
|
8241
|
+
,
|
|
8242
|
+
,
|
|
8243
|
+
,
|
|
8244
|
+
,
|
|
8245
|
+
,
|
|
8246
|
+
,
|
|
8247
|
+
48, // 1e10
|
|
8248
|
+
50, // 1e11
|
|
8249
|
+
54, // 1e12
|
|
8250
|
+
,
|
|
8251
|
+
64, // 1e14
|
|
8252
|
+
];
|
|
8253
|
+
|
|
8242
8254
|
function createOptimizer$1(toStringReplacement)
|
|
8243
8255
|
{
|
|
8244
8256
|
function appendLengthOf(solution)
|
|
@@ -8288,7 +8300,8 @@
|
|
|
8288
8300
|
var decimal = _parseInt(chars, radix);
|
|
8289
8301
|
if (decimal > MAX_SAFE_INTEGER)
|
|
8290
8302
|
return clusterAppendLength == null;
|
|
8291
|
-
var
|
|
8303
|
+
var decimalStr = formatPositiveNumber(decimal);
|
|
8304
|
+
var decimalReplacement = replaceStaticString(decimalStr);
|
|
8292
8305
|
// Adding 3 for leading "+(" and trailing ")".
|
|
8293
8306
|
var decimalLength = decimalReplacement.length + 3;
|
|
8294
8307
|
var radixReplacement = RADIX_REPLACEMENTS[radix];
|
|
@@ -8405,33 +8418,10 @@
|
|
|
8405
8418
|
var initialize =
|
|
8406
8419
|
function ()
|
|
8407
8420
|
{
|
|
8408
|
-
// DECIMAL_MIN_LENGTHS is indexed by decimalDigitMaxCount (the number of digits used to write
|
|
8409
|
-
// MAX_SAFE_INTEGER in base radix).
|
|
8410
|
-
// decimalDigitMaxCount may only range from 11 (for radix 36) to 15 (for radix 12).
|
|
8411
|
-
var DECIMAL_MIN_LENGTHS =
|
|
8412
|
-
[
|
|
8413
|
-
,
|
|
8414
|
-
,
|
|
8415
|
-
,
|
|
8416
|
-
,
|
|
8417
|
-
,
|
|
8418
|
-
,
|
|
8419
|
-
,
|
|
8420
|
-
,
|
|
8421
|
-
,
|
|
8422
|
-
,
|
|
8423
|
-
,
|
|
8424
|
-
48, // 1e10
|
|
8425
|
-
50, // 1e11
|
|
8426
|
-
54, // 1e12
|
|
8427
|
-
,
|
|
8428
|
-
64, // 1e14
|
|
8429
|
-
];
|
|
8430
|
-
|
|
8431
8421
|
var minLength = Infinity;
|
|
8432
8422
|
for (var radix = MAX_RADIX; radix >= 12; --radix)
|
|
8433
8423
|
{
|
|
8434
|
-
var replacement =
|
|
8424
|
+
var replacement = replaceStaticString(_String$1(radix));
|
|
8435
8425
|
var length = replacement.length;
|
|
8436
8426
|
if (length < minLength)
|
|
8437
8427
|
minLength = length;
|
|
@@ -8886,4 +8876,4 @@
|
|
|
8886
8876
|
)();
|
|
8887
8877
|
}
|
|
8888
8878
|
|
|
8889
|
-
}()
|
|
8879
|
+
})();
|