@putout/bundle 5.4.0 → 5.4.1
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/bundle/putout.js +1398 -1224
- package/bundle/putout.min.js +7 -7
- package/bundle/putout.slim.js +1398 -1224
- package/package.json +4 -4
package/bundle/putout.js
CHANGED
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
function fullstore(value) {
|
|
2
|
-
const data = {
|
|
3
|
-
value,
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
return (...args) => {
|
|
7
|
-
const [value] = args;
|
|
8
|
-
|
|
9
|
-
if (!args.length)
|
|
10
|
-
return data.value;
|
|
11
|
-
|
|
12
|
-
data.value = value;
|
|
13
|
-
|
|
14
|
-
return value;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
1
|
var global$1 = (typeof global !== "undefined" ? global :
|
|
19
2
|
typeof self !== "undefined" ? self :
|
|
20
3
|
typeof window !== "undefined" ? window : {});
|
|
@@ -216,7 +199,7 @@ function write (buffer, value, offset, isLE, mLen, nBytes) {
|
|
|
216
199
|
|
|
217
200
|
var toString = {}.toString;
|
|
218
201
|
|
|
219
|
-
var isArray$
|
|
202
|
+
var isArray$g = Array.isArray || function (arr) {
|
|
220
203
|
return toString.call(arr) == '[object Array]';
|
|
221
204
|
};
|
|
222
205
|
|
|
@@ -500,7 +483,7 @@ function fromObject (that, obj) {
|
|
|
500
483
|
return fromArrayLike(that, obj)
|
|
501
484
|
}
|
|
502
485
|
|
|
503
|
-
if (obj.type === 'Buffer' && isArray$
|
|
486
|
+
if (obj.type === 'Buffer' && isArray$g(obj.data)) {
|
|
504
487
|
return fromArrayLike(that, obj.data)
|
|
505
488
|
}
|
|
506
489
|
}
|
|
@@ -565,7 +548,7 @@ Buffer.isEncoding = function isEncoding (encoding) {
|
|
|
565
548
|
};
|
|
566
549
|
|
|
567
550
|
Buffer.concat = function concat (list, length) {
|
|
568
|
-
if (!isArray$
|
|
551
|
+
if (!isArray$g(list)) {
|
|
569
552
|
throw new TypeError('"list" argument must be an Array of Buffers')
|
|
570
553
|
}
|
|
571
554
|
|
|
@@ -2219,7 +2202,7 @@ var browser$1 = {
|
|
|
2219
2202
|
};
|
|
2220
2203
|
|
|
2221
2204
|
var util = /*#__PURE__*/Object.freeze({
|
|
2222
|
-
|
|
2205
|
+
__proto__: null
|
|
2223
2206
|
});
|
|
2224
2207
|
|
|
2225
2208
|
var __create = Object.create;
|
|
@@ -2264,9 +2247,9 @@ __defProp(target, 'default', {
|
|
|
2264
2247
|
enumerable: true,
|
|
2265
2248
|
}) , mod));
|
|
2266
2249
|
|
|
2267
|
-
// node_modules/jsesc/jsesc.js
|
|
2250
|
+
// ../babel-babel/node_modules/jsesc/jsesc.js
|
|
2268
2251
|
var require_jsesc = __commonJS({
|
|
2269
|
-
'node_modules/jsesc/jsesc.js'(exports$1, module) {
|
|
2252
|
+
'../babel-babel/node_modules/jsesc/jsesc.js'(exports$1, module) {
|
|
2270
2253
|
|
|
2271
2254
|
var object = {};
|
|
2272
2255
|
var hasOwnProperty = object.hasOwnProperty;
|
|
@@ -2330,10 +2313,6 @@ var require_jsesc = __commonJS({
|
|
|
2330
2313
|
return typeof value == 'number' || toString.call(value) == '[object Number]';
|
|
2331
2314
|
};
|
|
2332
2315
|
|
|
2333
|
-
var isBigInt = (value) => {
|
|
2334
|
-
return typeof value == 'bigint';
|
|
2335
|
-
};
|
|
2336
|
-
|
|
2337
2316
|
var isFunction5 = (value) => {
|
|
2338
2317
|
return typeof value == 'function';
|
|
2339
2318
|
};
|
|
@@ -2482,41 +2461,32 @@ var require_jsesc = __commonJS({
|
|
|
2482
2461
|
}
|
|
2483
2462
|
|
|
2484
2463
|
return '[' + newLine + result.join(',' + newLine) + newLine + (compact ? '' : oldIndent) + ']';
|
|
2485
|
-
} else if (isNumber2(argument)
|
|
2464
|
+
} else if (isNumber2(argument)) {
|
|
2486
2465
|
if (json) {
|
|
2487
|
-
return JSON.stringify(
|
|
2466
|
+
return JSON.stringify(argument);
|
|
2488
2467
|
}
|
|
2489
2468
|
|
|
2490
|
-
let result2;
|
|
2491
|
-
|
|
2492
2469
|
if (useDecNumbers) {
|
|
2493
|
-
|
|
2494
|
-
}
|
|
2470
|
+
return String(argument);
|
|
2471
|
+
}
|
|
2472
|
+
|
|
2473
|
+
if (useHexNumbers) {
|
|
2495
2474
|
let hexadecimal2 = argument.toString(16);
|
|
2496
2475
|
|
|
2497
2476
|
if (!lowercaseHex) {
|
|
2498
2477
|
hexadecimal2 = hexadecimal2.toUpperCase();
|
|
2499
2478
|
}
|
|
2500
2479
|
|
|
2501
|
-
|
|
2502
|
-
} else if (useBinNumbers) {
|
|
2503
|
-
result2 = '0b' + argument.toString(2);
|
|
2504
|
-
} else if (useOctNumbers) {
|
|
2505
|
-
result2 = '0o' + argument.toString(8);
|
|
2480
|
+
return '0x' + hexadecimal2;
|
|
2506
2481
|
}
|
|
2507
|
-
|
|
2508
2482
|
|
|
2509
|
-
if (
|
|
2510
|
-
return
|
|
2483
|
+
if (useBinNumbers) {
|
|
2484
|
+
return '0b' + argument.toString(2);
|
|
2511
2485
|
}
|
|
2512
2486
|
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
if (json) {
|
|
2516
|
-
return JSON.stringify(Number(argument));
|
|
2487
|
+
if (useOctNumbers) {
|
|
2488
|
+
return '0o' + argument.toString(8);
|
|
2517
2489
|
}
|
|
2518
|
-
|
|
2519
|
-
return argument + 'n';
|
|
2520
2490
|
} else if (!isObject(argument)) {
|
|
2521
2491
|
if (json) {
|
|
2522
2492
|
return JSON.stringify(argument) || 'null';
|
|
@@ -2539,7 +2509,6 @@ var require_jsesc = __commonJS({
|
|
|
2539
2509
|
return '{' + newLine + result.join(',' + newLine) + newLine + (compact ? '' : oldIndent) + '}';
|
|
2540
2510
|
}
|
|
2541
2511
|
|
|
2542
|
-
|
|
2543
2512
|
}
|
|
2544
2513
|
|
|
2545
2514
|
const regex = options.escapeEverything ? escapeEverythingRegex : escapeNonAsciiRegex;
|
|
@@ -2626,7 +2595,7 @@ var require_jsesc = __commonJS({
|
|
|
2626
2595
|
},
|
|
2627
2596
|
});
|
|
2628
2597
|
|
|
2629
|
-
//
|
|
2598
|
+
// ../babel-babel/packages/babel-types/lib/index.js
|
|
2630
2599
|
var lib_exports = {};
|
|
2631
2600
|
|
|
2632
2601
|
__export(lib_exports, {
|
|
@@ -3382,7 +3351,7 @@ __export(lib_exports, {
|
|
|
3382
3351
|
isAccessor: () => isAccessor,
|
|
3383
3352
|
isAnyTypeAnnotation: () => isAnyTypeAnnotation,
|
|
3384
3353
|
isArgumentPlaceholder: () => isArgumentPlaceholder,
|
|
3385
|
-
isArrayExpression: () => isArrayExpression$
|
|
3354
|
+
isArrayExpression: () => isArrayExpression$b,
|
|
3386
3355
|
isArrayPattern: () => isArrayPattern,
|
|
3387
3356
|
isArrayTypeAnnotation: () => isArrayTypeAnnotation,
|
|
3388
3357
|
isArrowFunctionExpression: () => isArrowFunctionExpression$3,
|
|
@@ -3875,14 +3844,11 @@ __export(lib_exports, {
|
|
|
3875
3844
|
yieldExpression: () => yieldExpression,
|
|
3876
3845
|
});
|
|
3877
3846
|
|
|
3878
|
-
//
|
|
3847
|
+
// ../babel-babel/packages/babel-helper-validator-identifier/lib/index.js
|
|
3879
3848
|
var nonASCIIidentifierStartChars = '\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC';
|
|
3880
3849
|
var nonASCIIidentifierChars = '\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65';
|
|
3881
3850
|
var nonASCIIidentifierStart = new RegExp('[' + nonASCIIidentifierStartChars + ']');
|
|
3882
3851
|
var nonASCIIidentifier = new RegExp('[' + nonASCIIidentifierStartChars + nonASCIIidentifierChars + ']');
|
|
3883
|
-
|
|
3884
|
-
nonASCIIidentifierStartChars =
|
|
3885
|
-
nonASCIIidentifierChars = null;
|
|
3886
3852
|
var astralIdentifierStartCodes = [
|
|
3887
3853
|
0,
|
|
3888
3854
|
11,
|
|
@@ -4993,7 +4959,7 @@ function isKeyword$1(word) {
|
|
|
4993
4959
|
return keywords$1.has(word);
|
|
4994
4960
|
}
|
|
4995
4961
|
|
|
4996
|
-
//
|
|
4962
|
+
// ../babel-babel/packages/babel-helper-string-parser/lib/index.js
|
|
4997
4963
|
var _isDigit = function isDigit(code2) {
|
|
4998
4964
|
return code2 >= 48 && code2 <= 57;
|
|
4999
4965
|
};
|
|
@@ -5294,7 +5260,7 @@ function readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors) {
|
|
|
5294
5260
|
};
|
|
5295
5261
|
}
|
|
5296
5262
|
|
|
5297
|
-
//
|
|
5263
|
+
// ../babel-babel/packages/babel-types/lib/index.js
|
|
5298
5264
|
function shallowEqual(actual, expected) {
|
|
5299
5265
|
const keys2 = Object.keys(expected);
|
|
5300
5266
|
|
|
@@ -5356,7 +5322,7 @@ function captureShortStackTrace(skip2, length) {
|
|
|
5356
5322
|
};
|
|
5357
5323
|
}
|
|
5358
5324
|
|
|
5359
|
-
function isArrayExpression$
|
|
5325
|
+
function isArrayExpression$b(node, opts) {
|
|
5360
5326
|
if (!node)
|
|
5361
5327
|
return false;
|
|
5362
5328
|
|
|
@@ -18630,15 +18596,13 @@ function removeTypeDuplicates$1(nodesIn) {
|
|
|
18630
18596
|
const name = getQualifiedName$1(node.id);
|
|
18631
18597
|
|
|
18632
18598
|
if (generics.has(name)) {
|
|
18633
|
-
|
|
18599
|
+
const existingTypeParameters = generics.get(name).typeParameters;
|
|
18634
18600
|
|
|
18635
|
-
if (
|
|
18601
|
+
if (existingTypeParameters) {
|
|
18636
18602
|
if (node.typeParameters) {
|
|
18637
|
-
|
|
18638
|
-
|
|
18603
|
+
existingTypeParameters.params.push(...node.typeParameters.params);
|
|
18604
|
+
existingTypeParameters.params = removeTypeDuplicates$1(existingTypeParameters.params);
|
|
18639
18605
|
}
|
|
18640
|
-
} else {
|
|
18641
|
-
existing = node.typeParameters;
|
|
18642
18606
|
}
|
|
18643
18607
|
} else {
|
|
18644
18608
|
generics.set(name, node);
|
|
@@ -18717,14 +18681,11 @@ function removeTypeDuplicates(nodesIn) {
|
|
|
18717
18681
|
const name = getQualifiedName(node.typeName);
|
|
18718
18682
|
|
|
18719
18683
|
if (generics.has(name)) {
|
|
18720
|
-
|
|
18721
|
-
const existingTypeArguments = existing[typeArgumentsKey];
|
|
18684
|
+
const existingTypeArguments = generics.get(name)[typeArgumentsKey];
|
|
18722
18685
|
|
|
18723
18686
|
if (existingTypeArguments) {
|
|
18724
18687
|
existingTypeArguments.params.push(...typeArguments.params);
|
|
18725
18688
|
existingTypeArguments.params = removeTypeDuplicates(existingTypeArguments.params);
|
|
18726
|
-
} else {
|
|
18727
|
-
existing = typeArguments;
|
|
18728
18689
|
}
|
|
18729
18690
|
} else {
|
|
18730
18691
|
generics.set(name, node);
|
|
@@ -18784,6 +18745,9 @@ function cloneIfNodeOrArray(obj, deep, withoutLoc, commentsCache) {
|
|
|
18784
18745
|
}
|
|
18785
18746
|
|
|
18786
18747
|
function cloneNode(node, deep = true, withoutLoc = false) {
|
|
18748
|
+
if (!node)
|
|
18749
|
+
return node;
|
|
18750
|
+
|
|
18787
18751
|
return cloneNodeInternal(node, deep, withoutLoc, /* @__PURE__ */new Map());
|
|
18788
18752
|
}
|
|
18789
18753
|
|
|
@@ -19019,7 +18983,7 @@ function toBlock(node, parent) {
|
|
|
19019
18983
|
return node;
|
|
19020
18984
|
}
|
|
19021
18985
|
|
|
19022
|
-
let blockNodes
|
|
18986
|
+
let blockNodes;
|
|
19023
18987
|
|
|
19024
18988
|
if (isEmptyStatement(node)) {
|
|
19025
18989
|
blockNodes = [];
|
|
@@ -19104,8 +19068,8 @@ function toExpression$1(node) {
|
|
|
19104
19068
|
return node;
|
|
19105
19069
|
}
|
|
19106
19070
|
|
|
19107
|
-
var _skip =
|
|
19108
|
-
var _stop =
|
|
19071
|
+
var _skip = Symbol();
|
|
19072
|
+
var _stop = Symbol();
|
|
19109
19073
|
|
|
19110
19074
|
function traverseFast(node, enter, opts) {
|
|
19111
19075
|
if (!node)
|
|
@@ -19979,7 +19943,7 @@ var react = {
|
|
|
19979
19943
|
buildChildren,
|
|
19980
19944
|
};
|
|
19981
19945
|
|
|
19982
|
-
//
|
|
19946
|
+
// ../babel-babel/packages/babel-parser/lib/index.js
|
|
19983
19947
|
var Position = class {
|
|
19984
19948
|
line;
|
|
19985
19949
|
column;
|
|
@@ -21419,9 +21383,6 @@ var nonASCIIidentifierStartChars2 = '\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u
|
|
|
21419
21383
|
var nonASCIIidentifierChars2 = '\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65';
|
|
21420
21384
|
var nonASCIIidentifierStart2 = new RegExp('[' + nonASCIIidentifierStartChars2 + ']');
|
|
21421
21385
|
var nonASCIIidentifier2 = new RegExp('[' + nonASCIIidentifierStartChars2 + nonASCIIidentifierChars2 + ']');
|
|
21422
|
-
|
|
21423
|
-
nonASCIIidentifierStartChars2 =
|
|
21424
|
-
nonASCIIidentifierChars2 = null;
|
|
21425
21386
|
var astralIdentifierStartCodes2 = [
|
|
21426
21387
|
0,
|
|
21427
21388
|
11,
|
|
@@ -24025,7 +23986,7 @@ var CommentsParser = class extends BaseParser {
|
|
|
24025
23986
|
};
|
|
24026
23987
|
|
|
24027
23988
|
var State$2 = class _State {
|
|
24028
|
-
flags =
|
|
23989
|
+
flags = 4096;
|
|
24029
23990
|
get strict() {
|
|
24030
23991
|
return (this.flags & 1) > 0;
|
|
24031
23992
|
}
|
|
@@ -24121,32 +24082,61 @@ var State$2 = class _State {
|
|
|
24121
24082
|
this.flags &= -65;
|
|
24122
24083
|
}
|
|
24123
24084
|
|
|
24124
|
-
|
|
24125
|
-
maxNumOfResolvableTopics: 0,
|
|
24126
|
-
maxTopicIndex: null,
|
|
24127
|
-
};
|
|
24128
|
-
get soloAwait() {
|
|
24085
|
+
get inConditionalConsequent() {
|
|
24129
24086
|
return (this.flags & 128) > 0;
|
|
24130
24087
|
}
|
|
24131
24088
|
|
|
24132
|
-
set
|
|
24089
|
+
set inConditionalConsequent(v) {
|
|
24133
24090
|
if (v)
|
|
24134
24091
|
this.flags |= 128;
|
|
24135
24092
|
else
|
|
24136
24093
|
this.flags &= -129;
|
|
24137
24094
|
}
|
|
24138
24095
|
|
|
24139
|
-
get
|
|
24096
|
+
get inHackPipelineBody() {
|
|
24140
24097
|
return (this.flags & 256) > 0;
|
|
24141
24098
|
}
|
|
24142
24099
|
|
|
24143
|
-
set
|
|
24100
|
+
set inHackPipelineBody(v) {
|
|
24144
24101
|
if (v)
|
|
24145
24102
|
this.flags |= 256;
|
|
24146
24103
|
else
|
|
24147
24104
|
this.flags &= -257;
|
|
24148
24105
|
}
|
|
24149
24106
|
|
|
24107
|
+
get seenTopicReference() {
|
|
24108
|
+
return (this.flags & 512) > 0;
|
|
24109
|
+
}
|
|
24110
|
+
|
|
24111
|
+
set seenTopicReference(v) {
|
|
24112
|
+
if (v)
|
|
24113
|
+
this.flags |= 512;
|
|
24114
|
+
else
|
|
24115
|
+
this.flags &= -513;
|
|
24116
|
+
}
|
|
24117
|
+
|
|
24118
|
+
get soloAwait() {
|
|
24119
|
+
return (this.flags & 1024) > 0;
|
|
24120
|
+
}
|
|
24121
|
+
|
|
24122
|
+
set soloAwait(v) {
|
|
24123
|
+
if (v)
|
|
24124
|
+
this.flags |= 1024;
|
|
24125
|
+
else
|
|
24126
|
+
this.flags &= -1025;
|
|
24127
|
+
}
|
|
24128
|
+
|
|
24129
|
+
get inFSharpPipelineDirectBody() {
|
|
24130
|
+
return (this.flags & 2048) > 0;
|
|
24131
|
+
}
|
|
24132
|
+
|
|
24133
|
+
set inFSharpPipelineDirectBody(v) {
|
|
24134
|
+
if (v)
|
|
24135
|
+
this.flags |= 2048;
|
|
24136
|
+
else
|
|
24137
|
+
this.flags &= -2049;
|
|
24138
|
+
}
|
|
24139
|
+
|
|
24150
24140
|
labels = [];
|
|
24151
24141
|
commentsLen = 0;
|
|
24152
24142
|
commentStack = [];
|
|
@@ -24159,37 +24149,37 @@ var State$2 = class _State {
|
|
|
24159
24149
|
lastTokStartLoc = null;
|
|
24160
24150
|
context = [types.brace];
|
|
24161
24151
|
get canStartJSXElement() {
|
|
24162
|
-
return (this.flags &
|
|
24152
|
+
return (this.flags & 4096) > 0;
|
|
24163
24153
|
}
|
|
24164
24154
|
|
|
24165
24155
|
set canStartJSXElement(v) {
|
|
24166
24156
|
if (v)
|
|
24167
|
-
this.flags |=
|
|
24157
|
+
this.flags |= 4096;
|
|
24168
24158
|
else
|
|
24169
|
-
this.flags &= -
|
|
24159
|
+
this.flags &= -4097;
|
|
24170
24160
|
}
|
|
24171
24161
|
|
|
24172
24162
|
get containsEsc() {
|
|
24173
|
-
return (this.flags &
|
|
24163
|
+
return (this.flags & 8192) > 0;
|
|
24174
24164
|
}
|
|
24175
24165
|
|
|
24176
24166
|
set containsEsc(v) {
|
|
24177
24167
|
if (v)
|
|
24178
|
-
this.flags |=
|
|
24168
|
+
this.flags |= 8192;
|
|
24179
24169
|
else
|
|
24180
|
-
this.flags &= -
|
|
24170
|
+
this.flags &= -8193;
|
|
24181
24171
|
}
|
|
24182
24172
|
|
|
24183
24173
|
firstInvalidTemplateEscapePos = null;
|
|
24184
24174
|
get hasTopLevelAwait() {
|
|
24185
|
-
return (this.flags &
|
|
24175
|
+
return (this.flags & 16384) > 0;
|
|
24186
24176
|
}
|
|
24187
24177
|
|
|
24188
24178
|
set hasTopLevelAwait(v) {
|
|
24189
24179
|
if (v)
|
|
24190
|
-
this.flags |=
|
|
24180
|
+
this.flags |= 16384;
|
|
24191
24181
|
else
|
|
24192
|
-
this.flags &= -
|
|
24182
|
+
this.flags &= -16385;
|
|
24193
24183
|
}
|
|
24194
24184
|
|
|
24195
24185
|
strictErrors = /* @__PURE__ */new Map();
|
|
@@ -24211,7 +24201,6 @@ var State$2 = class _State {
|
|
|
24211
24201
|
state.potentialArrowAt = this.potentialArrowAt;
|
|
24212
24202
|
state.noArrowAt = this.noArrowAt.slice();
|
|
24213
24203
|
state.noArrowParamsConversionAt = this.noArrowParamsConversionAt.slice();
|
|
24214
|
-
state.topicContext = this.topicContext;
|
|
24215
24204
|
state.labels = this.labels.slice();
|
|
24216
24205
|
state.commentsLen = this.commentsLen;
|
|
24217
24206
|
state.commentStack = this.commentStack.slice();
|
|
@@ -29592,7 +29581,18 @@ var typescript$1 = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
29592
29581
|
}
|
|
29593
29582
|
}
|
|
29594
29583
|
|
|
29595
|
-
|
|
29584
|
+
this.next();
|
|
29585
|
+
const node = this.startNodeAt(startLoc);
|
|
29586
|
+
|
|
29587
|
+
node.test = expr;
|
|
29588
|
+
const oldInConditionalConsequent = this.state.inConditionalConsequent;
|
|
29589
|
+
|
|
29590
|
+
this.state.inConditionalConsequent = true;
|
|
29591
|
+
node.consequent = this.parseMaybeAssignAllowIn();
|
|
29592
|
+
this.state.inConditionalConsequent = oldInConditionalConsequent;
|
|
29593
|
+
this.expect(10);
|
|
29594
|
+
node.alternate = this.parseMaybeAssign();
|
|
29595
|
+
return this.finishNode(node, 'ConditionalExpression');
|
|
29596
29596
|
}
|
|
29597
29597
|
|
|
29598
29598
|
parseParenItem(node, startLoc) {
|
|
@@ -30177,7 +30177,24 @@ var typescript$1 = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
30177
30177
|
}
|
|
30178
30178
|
|
|
30179
30179
|
shouldParseAsyncArrow() {
|
|
30180
|
-
|
|
30180
|
+
if (this.match(10)) {
|
|
30181
|
+
if (this.state.inConditionalConsequent)
|
|
30182
|
+
return false;
|
|
30183
|
+
|
|
30184
|
+
return true;
|
|
30185
|
+
}
|
|
30186
|
+
|
|
30187
|
+
return super.shouldParseAsyncArrow();
|
|
30188
|
+
}
|
|
30189
|
+
|
|
30190
|
+
parseParenAndDistinguishExpression(canBeArrow) {
|
|
30191
|
+
const oldInConditionalConsequent = this.state.inConditionalConsequent;
|
|
30192
|
+
|
|
30193
|
+
this.state.inConditionalConsequent = false;
|
|
30194
|
+
const result = super.parseParenAndDistinguishExpression(canBeArrow);
|
|
30195
|
+
|
|
30196
|
+
this.state.inConditionalConsequent = oldInConditionalConsequent;
|
|
30197
|
+
return result;
|
|
30181
30198
|
}
|
|
30182
30199
|
|
|
30183
30200
|
canHaveLeadingDecorator() {
|
|
@@ -32397,7 +32414,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
32397
32414
|
}
|
|
32398
32415
|
|
|
32399
32416
|
parsePropertyDefinition(refExpressionErrors) {
|
|
32400
|
-
|
|
32417
|
+
const decorators = [];
|
|
32401
32418
|
|
|
32402
32419
|
if (this.match(22)) {
|
|
32403
32420
|
if (this.hasPlugin('decorators')) {
|
|
@@ -32423,7 +32440,6 @@ var ExpressionParser = class extends LValParser {
|
|
|
32423
32440
|
|
|
32424
32441
|
if (decorators.length) {
|
|
32425
32442
|
prop.decorators = decorators;
|
|
32426
|
-
decorators = [];
|
|
32427
32443
|
}
|
|
32428
32444
|
|
|
32429
32445
|
prop.method = false;
|
|
@@ -32989,16 +33005,17 @@ var ExpressionParser = class extends LValParser {
|
|
|
32989
33005
|
}
|
|
32990
33006
|
|
|
32991
33007
|
withTopicBindingContext(callback) {
|
|
32992
|
-
const
|
|
33008
|
+
const oldInHackPipelineBody = this.state.inHackPipelineBody;
|
|
32993
33009
|
|
|
32994
|
-
this.state.
|
|
32995
|
-
|
|
32996
|
-
|
|
32997
|
-
|
|
33010
|
+
this.state.inHackPipelineBody = true;
|
|
33011
|
+
const oldSeenTopicReference = this.state.seenTopicReference;
|
|
33012
|
+
|
|
33013
|
+
this.state.seenTopicReference = false;
|
|
32998
33014
|
try {
|
|
32999
33015
|
return callback();
|
|
33000
33016
|
} finally {
|
|
33001
|
-
this.state.
|
|
33017
|
+
this.state.inHackPipelineBody = oldInHackPipelineBody;
|
|
33018
|
+
this.state.seenTopicReference = oldSeenTopicReference;
|
|
33002
33019
|
}
|
|
33003
33020
|
}
|
|
33004
33021
|
|
|
@@ -33046,15 +33063,15 @@ var ExpressionParser = class extends LValParser {
|
|
|
33046
33063
|
}
|
|
33047
33064
|
|
|
33048
33065
|
registerTopicReference() {
|
|
33049
|
-
this.state.
|
|
33066
|
+
this.state.seenTopicReference = true;
|
|
33050
33067
|
}
|
|
33051
33068
|
|
|
33052
33069
|
topicReferenceIsAllowedInCurrentContext() {
|
|
33053
|
-
return this.state.
|
|
33070
|
+
return this.state.inHackPipelineBody;
|
|
33054
33071
|
}
|
|
33055
33072
|
|
|
33056
33073
|
topicReferenceWasUsedInCurrentContext() {
|
|
33057
|
-
return this.state.
|
|
33074
|
+
return this.state.seenTopicReference;
|
|
33058
33075
|
}
|
|
33059
33076
|
|
|
33060
33077
|
parseFSharpPipelineBody(prec) {
|
|
@@ -35483,7 +35500,7 @@ function getParserClass(pluginsMap) {
|
|
|
35483
35500
|
return cls;
|
|
35484
35501
|
}
|
|
35485
35502
|
|
|
35486
|
-
//
|
|
35503
|
+
// ../babel-babel/packages/babel-code-frame/lib/common-BO7XIBW3.js
|
|
35487
35504
|
var NEWLINE$1 = /\r\n|[\n\r\u2028\u2029]/;
|
|
35488
35505
|
|
|
35489
35506
|
function getMarkerLines(loc, source, opts, startLineBaseZero) {
|
|
@@ -35641,7 +35658,7 @@ ${frame}`;
|
|
|
35641
35658
|
return defs2.reset(frame);
|
|
35642
35659
|
}
|
|
35643
35660
|
|
|
35644
|
-
const {styleText = (a, b) => b} = util;// node_modules/js-tokens/index.js
|
|
35661
|
+
const {styleText = (a, b) => b} = util;// ../babel-babel/node_modules/js-tokens/index.js
|
|
35645
35662
|
var HashbangComment;
|
|
35646
35663
|
var Identifier2;
|
|
35647
35664
|
var JSXIdentifier2;
|
|
@@ -36151,7 +36168,7 @@ jsTokens = function*(input, {jsx: jsx2 = false} = {}) {
|
|
|
36151
36168
|
};
|
|
36152
36169
|
var js_tokens_default = jsTokens;
|
|
36153
36170
|
|
|
36154
|
-
//
|
|
36171
|
+
// ../babel-babel/packages/babel-code-frame/lib/index.js
|
|
36155
36172
|
function isColorSupported() {
|
|
36156
36173
|
return styleText('red', '-') !== '-';
|
|
36157
36174
|
}
|
|
@@ -36330,7 +36347,7 @@ function codeFrameColumns(rawLines, loc, opts = {}) {
|
|
|
36330
36347
|
} : void 0);
|
|
36331
36348
|
}
|
|
36332
36349
|
|
|
36333
|
-
//
|
|
36350
|
+
// ../babel-babel/packages/babel-template/lib/index.js
|
|
36334
36351
|
var {assertExpressionStatement: assertExpressionStatement2} = lib_exports;
|
|
36335
36352
|
|
|
36336
36353
|
function makeStatementFormatter(fn) {
|
|
@@ -36969,7 +36986,7 @@ var index = Object.assign(smart.bind(void 0), {
|
|
|
36969
36986
|
ast: smart.ast,
|
|
36970
36987
|
});
|
|
36971
36988
|
|
|
36972
|
-
// node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
|
|
36989
|
+
// ../babel-babel/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
|
|
36973
36990
|
var comma = ','.charCodeAt(0);
|
|
36974
36991
|
var semicolon = ';'.charCodeAt(0);
|
|
36975
36992
|
var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
|
@@ -37218,7 +37235,7 @@ function encode(decoded) {
|
|
|
37218
37235
|
return writer.flush();
|
|
37219
37236
|
}
|
|
37220
37237
|
|
|
37221
|
-
// node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs
|
|
37238
|
+
// ../babel-babel/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs
|
|
37222
37239
|
var schemeRegex = /^[\w+.-]+:\/\//;
|
|
37223
37240
|
var urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/;
|
|
37224
37241
|
var fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;
|
|
@@ -37438,7 +37455,7 @@ case 2:
|
|
|
37438
37455
|
}
|
|
37439
37456
|
}
|
|
37440
37457
|
|
|
37441
|
-
// node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs
|
|
37458
|
+
// ../babel-babel/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs
|
|
37442
37459
|
function stripFilename(path) {
|
|
37443
37460
|
if (!path)
|
|
37444
37461
|
return '';
|
|
@@ -37710,7 +37727,7 @@ function traceSegmentInternal(segments, memo, line, column, bias) {
|
|
|
37710
37727
|
return index3;
|
|
37711
37728
|
}
|
|
37712
37729
|
|
|
37713
|
-
// node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs
|
|
37730
|
+
// ../babel-babel/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs
|
|
37714
37731
|
var SetArray = class {
|
|
37715
37732
|
constructor() {
|
|
37716
37733
|
this._indexes = {
|
|
@@ -37979,7 +37996,7 @@ function addMappingInternal(skipable, map, mapping) {
|
|
|
37979
37996
|
return addSegmentInternal(skipable, map, generated.line - 1, generated.column, source, original.line - 1, original.column, name, content);
|
|
37980
37997
|
}
|
|
37981
37998
|
|
|
37982
|
-
//
|
|
37999
|
+
// ../babel-babel/packages/babel-generator/lib/index.js
|
|
37983
38000
|
var import_jsesc = __toESM(require_jsesc());
|
|
37984
38001
|
|
|
37985
38002
|
var SourceMap = class {
|
|
@@ -43824,7 +43841,7 @@ function generate$1(ast, opts = {}, code2) {
|
|
|
43824
43841
|
return printer.generate(ast);
|
|
43825
43842
|
}
|
|
43826
43843
|
|
|
43827
|
-
// node_modules/obug/dist/core.js
|
|
43844
|
+
// ../babel-babel/node_modules/obug/dist/core.js
|
|
43828
43845
|
function selectColor$1(colors2, namespace) {
|
|
43829
43846
|
let hash = 0;
|
|
43830
43847
|
|
|
@@ -43871,7 +43888,7 @@ function enable$1(namespaces$1) {
|
|
|
43871
43888
|
names$1.push(ns);
|
|
43872
43889
|
}
|
|
43873
43890
|
|
|
43874
|
-
// node_modules/obug/dist/node.js
|
|
43891
|
+
// ../babel-babel/node_modules/obug/dist/node.js
|
|
43875
43892
|
var colors$1 = [];
|
|
43876
43893
|
|
|
43877
43894
|
var inspectOpts = {};
|
|
@@ -43918,7 +43935,7 @@ function createDebug2(namespace, options) {
|
|
|
43918
43935
|
}
|
|
43919
43936
|
|
|
43920
43937
|
enable$1(browser$1.env.DEBUG || '');
|
|
43921
|
-
//
|
|
43938
|
+
// ../babel-babel/packages/babel-helper-globals/data/builtin-lower.json
|
|
43922
43939
|
|
|
43923
43940
|
var builtin_lower_default = [
|
|
43924
43941
|
'decodeURI',
|
|
@@ -43936,7 +43953,7 @@ var builtin_lower_default = [
|
|
|
43936
43953
|
'unescape',
|
|
43937
43954
|
];
|
|
43938
43955
|
|
|
43939
|
-
//
|
|
43956
|
+
// ../babel-babel/packages/babel-helper-globals/data/builtin-upper.json
|
|
43940
43957
|
var builtin_upper_default = [
|
|
43941
43958
|
'AggregateError',
|
|
43942
43959
|
'Array',
|
|
@@ -43989,7 +44006,7 @@ var builtin_upper_default = [
|
|
|
43989
44006
|
'WeakSet',
|
|
43990
44007
|
];
|
|
43991
44008
|
|
|
43992
|
-
//
|
|
44009
|
+
// ../babel-babel/packages/babel-traverse/lib/index.js
|
|
43993
44010
|
var ReferencedIdentifier = [
|
|
43994
44011
|
'Identifier',
|
|
43995
44012
|
'JSXIdentifier',
|
|
@@ -49106,7 +49123,7 @@ function isExecutionUncertainInList(paths, maxIndex) {
|
|
|
49106
49123
|
return false;
|
|
49107
49124
|
}
|
|
49108
49125
|
|
|
49109
|
-
var SYMBOL_CHECKING =
|
|
49126
|
+
var SYMBOL_CHECKING = Symbol();
|
|
49110
49127
|
|
|
49111
49128
|
function _guessExecutionStatusRelativeTo(target) {
|
|
49112
49129
|
return _guessExecutionStatusRelativeToCached(this, target, /* @__PURE__ */new Map());
|
|
@@ -50471,17 +50488,45 @@ traverse3.hasType = function(tree, type, denylistTypes) {
|
|
|
50471
50488
|
};
|
|
50472
50489
|
traverse3.cache = cache;
|
|
50473
50490
|
|
|
50474
|
-
const
|
|
50475
|
-
|
|
50476
|
-
|
|
50477
|
-
|
|
50478
|
-
|
|
50479
|
-
|
|
50480
|
-
|
|
50481
|
-
|
|
50482
|
-
|
|
50491
|
+
const isString$f = (a) => typeof a === 'string';
|
|
50492
|
+
const constant = (a) => () => a;
|
|
50493
|
+
const {keys: keys$3} = Object;
|
|
50494
|
+
|
|
50495
|
+
const rendy = (template, values, modifiers) => {
|
|
50496
|
+
check$e(template, values);
|
|
50497
|
+
|
|
50498
|
+
let result = template;
|
|
50499
|
+
const names = keys$3(values) ;
|
|
50500
|
+
|
|
50501
|
+
for (const key of names) {
|
|
50502
|
+
const [parsedKey, value] = parseValue$1(key, values);
|
|
50503
|
+
const str = constant(value);
|
|
50504
|
+
|
|
50505
|
+
while (result.includes(parsedKey))
|
|
50506
|
+
result = result.replace(parsedKey, str);
|
|
50507
|
+
}
|
|
50508
|
+
|
|
50509
|
+
if (result.includes('{{'))
|
|
50510
|
+
result = result.replace(/{{.*?}}/g, '');
|
|
50511
|
+
|
|
50512
|
+
return result;
|
|
50483
50513
|
};
|
|
50484
50514
|
|
|
50515
|
+
function check$e(template, values) {
|
|
50516
|
+
if (!isString$f(template))
|
|
50517
|
+
throw Error('template should be a string!');
|
|
50518
|
+
|
|
50519
|
+
if (typeof values !== 'object')
|
|
50520
|
+
throw Error('values should be an object!');
|
|
50521
|
+
}
|
|
50522
|
+
|
|
50523
|
+
function parseValue$1(key, values, modifiers) {
|
|
50524
|
+
return [
|
|
50525
|
+
`{{ ${key} }}`,
|
|
50526
|
+
values[key],
|
|
50527
|
+
];
|
|
50528
|
+
}
|
|
50529
|
+
|
|
50485
50530
|
const {
|
|
50486
50531
|
isStringLiteral: isStringLiteral$a,
|
|
50487
50532
|
isIdentifier: isIdentifier$g,
|
|
@@ -50490,7 +50535,7 @@ const {
|
|
|
50490
50535
|
isForOfStatement: isForOfStatement$1,
|
|
50491
50536
|
isVariableDeclaration: isVariableDeclaration$4,
|
|
50492
50537
|
isMemberExpression: isMemberExpression$8,
|
|
50493
|
-
isArrayExpression: isArrayExpression$
|
|
50538
|
+
isArrayExpression: isArrayExpression$a,
|
|
50494
50539
|
isObjectExpression: isObjectExpression$c,
|
|
50495
50540
|
isLabeledStatement: isLabeledStatement$1,
|
|
50496
50541
|
isTryStatement,
|
|
@@ -50598,7 +50643,7 @@ const isStringAndArray = ([a, b]) => {
|
|
|
50598
50643
|
if (!isStringLiteral$a(a))
|
|
50599
50644
|
return false;
|
|
50600
50645
|
|
|
50601
|
-
if (!isArrayExpression$
|
|
50646
|
+
if (!isArrayExpression$a(b))
|
|
50602
50647
|
return false;
|
|
50603
50648
|
|
|
50604
50649
|
return !isStringAndIdentifier(b.node.elements);
|
|
@@ -50660,39 +50705,214 @@ const hasLeadingComment = (path) => path.node?.leadingComments?.length;
|
|
|
50660
50705
|
const noTrailingComment = (path) => !path.node.trailingComments?.length;
|
|
50661
50706
|
const noLeadingComment = (path) => !path.node.leadingComments?.length;
|
|
50662
50707
|
|
|
50708
|
+
var maybeSatisfy = (plugin) => {
|
|
50709
|
+
if (!plugin.afterSatisfy && !plugin.beforeSatisfy && !plugin.satisfy)
|
|
50710
|
+
return plugin;
|
|
50711
|
+
|
|
50712
|
+
const {
|
|
50713
|
+
satisfy,
|
|
50714
|
+
afterSatisfy = satisfy,
|
|
50715
|
+
beforeSatisfy = satisfy,
|
|
50716
|
+
} = plugin;
|
|
50717
|
+
|
|
50718
|
+
return {
|
|
50719
|
+
afterIf: createIf(afterSatisfy),
|
|
50720
|
+
beforeIf: createIf(beforeSatisfy),
|
|
50721
|
+
...plugin,
|
|
50722
|
+
};
|
|
50723
|
+
};
|
|
50724
|
+
|
|
50725
|
+
const createIf = (getConditions) => {
|
|
50726
|
+
const conditions = getConditions?.() || [];
|
|
50727
|
+
return satisfy(conditions);
|
|
50728
|
+
};
|
|
50729
|
+
|
|
50730
|
+
const {
|
|
50731
|
+
isProgram: isProgram$4,
|
|
50732
|
+
isFile: isFile$1,
|
|
50733
|
+
isStatement: isStatement$5,
|
|
50734
|
+
expressionStatement: expressionStatement$3,
|
|
50735
|
+
program,
|
|
50736
|
+
file,
|
|
50737
|
+
} = lib_exports;
|
|
50738
|
+
|
|
50663
50739
|
const isFn$7 = (a) => typeof a === 'function';
|
|
50664
50740
|
|
|
50665
|
-
const
|
|
50741
|
+
const maybeThrow = (a, path, b) => {
|
|
50742
|
+
if (!a)
|
|
50743
|
+
return;
|
|
50744
|
+
|
|
50745
|
+
throw Error(rendy(b, {
|
|
50746
|
+
path,
|
|
50747
|
+
type: path.type,
|
|
50748
|
+
}));
|
|
50749
|
+
};
|
|
50666
50750
|
|
|
50667
|
-
const
|
|
50668
|
-
|
|
50669
|
-
|
|
50751
|
+
const maybeStatement = (ast) => isStatement$5(ast) ? ast : expressionStatement$3(ast);
|
|
50752
|
+
|
|
50753
|
+
const maybeProgram = (ast) => isProgram$4(ast) ? ast : program([
|
|
50754
|
+
maybeStatement(ast),
|
|
50755
|
+
]);
|
|
50756
|
+
|
|
50757
|
+
const maybeFile = (ast) => isFile$1(ast) ? ast : file(maybeProgram(ast));
|
|
50758
|
+
|
|
50759
|
+
const maybeVisitor = (plugin, path, printer, options) => {
|
|
50760
|
+
if (isFn$7(plugin))
|
|
50761
|
+
return plugin(path, printer, options);
|
|
50670
50762
|
|
|
50671
|
-
return
|
|
50763
|
+
return objectPlugin(plugin, path, printer, options);
|
|
50672
50764
|
};
|
|
50673
50765
|
|
|
50674
|
-
|
|
50675
|
-
|
|
50676
|
-
|
|
50677
|
-
|
|
50678
|
-
|
|
50679
|
-
|
|
50680
|
-
|
|
50681
|
-
|
|
50682
|
-
|
|
50683
|
-
});
|
|
50766
|
+
function objectPlugin(plugin, path, printer, semantics) {
|
|
50767
|
+
const {
|
|
50768
|
+
print,
|
|
50769
|
+
split,
|
|
50770
|
+
condition,
|
|
50771
|
+
before = split,
|
|
50772
|
+
beforeIf = condition,
|
|
50773
|
+
after = split,
|
|
50774
|
+
afterIf = condition,
|
|
50775
|
+
} = maybeSatisfy(plugin);
|
|
50776
|
+
|
|
50777
|
+
if (beforeIf?.(path, printer, semantics))
|
|
50778
|
+
before(path, printer, semantics);
|
|
50779
|
+
|
|
50780
|
+
print(path, printer, semantics);
|
|
50781
|
+
|
|
50782
|
+
if (afterIf?.(path, printer, semantics))
|
|
50783
|
+
after(path, printer, semantics);
|
|
50784
|
+
}
|
|
50684
50785
|
|
|
50685
|
-
|
|
50686
|
-
|
|
50687
|
-
|
|
50688
|
-
|
|
50786
|
+
function fullstore(value) {
|
|
50787
|
+
const data = {
|
|
50788
|
+
value,
|
|
50789
|
+
};
|
|
50790
|
+
|
|
50791
|
+
return (...args) => {
|
|
50792
|
+
const [value] = args;
|
|
50689
50793
|
|
|
50690
|
-
if (!
|
|
50691
|
-
return
|
|
50794
|
+
if (!args.length)
|
|
50795
|
+
return data.value;
|
|
50692
50796
|
|
|
50693
|
-
|
|
50694
|
-
|
|
50695
|
-
|
|
50797
|
+
data.value = value;
|
|
50798
|
+
|
|
50799
|
+
return value;
|
|
50800
|
+
};
|
|
50801
|
+
}
|
|
50802
|
+
|
|
50803
|
+
const TYPES$3 = {
|
|
50804
|
+
TOKEN: 'Token',
|
|
50805
|
+
NEWLINE: 'Newline',
|
|
50806
|
+
SPLITTER: 'Splitter',
|
|
50807
|
+
INDENT: 'Indent',
|
|
50808
|
+
DEBUG: 'Debug',
|
|
50809
|
+
SPACE: 'Space',
|
|
50810
|
+
QUOTE: 'Quote',
|
|
50811
|
+
END_OF_FILE: 'EndOfFile',
|
|
50812
|
+
};
|
|
50813
|
+
|
|
50814
|
+
var stringSnakeCase = snakeCase;
|
|
50815
|
+
|
|
50816
|
+
/*
|
|
50817
|
+
snakeCase('the quick brown fox'); // 'the_quick_brown_fox'
|
|
50818
|
+
snakeCase('the-quick-brown-fox'); // 'the_quick_brown_fox'
|
|
50819
|
+
snakeCase('the_quick_brown_fox'); // 'the_quick_brown_fox'
|
|
50820
|
+
snakeCase('theQuickBrownFox'); // 'the_quick_brown_fox'
|
|
50821
|
+
snakeCase('theQuickBrown Fox'); // 'the_quick_brown_Fox'
|
|
50822
|
+
snakeCase('thequickbrownfox'); // 'thequickbrownfox'
|
|
50823
|
+
snakeCase('the - quick * brown# fox'); // 'the_quick_brown_fox'
|
|
50824
|
+
snakeCase('theQUICKBrownFox'); // 'the_q_u_i_c_k_brown_fox'
|
|
50825
|
+
*/
|
|
50826
|
+
|
|
50827
|
+
// any combination of spaces and punctuation characters
|
|
50828
|
+
// thanks to http://stackoverflow.com/a/25575009
|
|
50829
|
+
var wordSeparators = /[\s\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,\-.\/:;<=>?@\[\]^_`{|}~]+/;
|
|
50830
|
+
var capitals = /[A-Z\u00C0-\u00D6\u00D9-\u00DD]/g;
|
|
50831
|
+
|
|
50832
|
+
function snakeCase(str) {
|
|
50833
|
+
//replace capitals with space + lower case equivalent for later parsing
|
|
50834
|
+
str = str.replace(capitals, function(match) {
|
|
50835
|
+
return ' ' + (match.toLowerCase() || match);
|
|
50836
|
+
});
|
|
50837
|
+
return str
|
|
50838
|
+
.trim()
|
|
50839
|
+
.split(wordSeparators)
|
|
50840
|
+
.join('_');
|
|
50841
|
+
}
|
|
50842
|
+
|
|
50843
|
+
const {stringify: stringify$7} = JSON;
|
|
50844
|
+
const {
|
|
50845
|
+
LOG,
|
|
50846
|
+
LOG_ALL,
|
|
50847
|
+
LOG_TOKENS,
|
|
50848
|
+
LOG_TERM,
|
|
50849
|
+
LOG_DEBUG,
|
|
50850
|
+
} = {};
|
|
50851
|
+
|
|
50852
|
+
const createDebug$4 = (tokens) => (a) => {
|
|
50853
|
+
if (!LOG_DEBUG)
|
|
50854
|
+
return;
|
|
50855
|
+
|
|
50856
|
+
tokens.push({
|
|
50857
|
+
type: TYPES$3.DEBUG,
|
|
50858
|
+
value: `/*__${stringSnakeCase(a)}*/`,
|
|
50859
|
+
});
|
|
50860
|
+
};
|
|
50861
|
+
|
|
50862
|
+
const createLog = ({newline = '\n', store = createStore$1()} = {}) => ({type, value}) => {
|
|
50863
|
+
if (LOG_TOKENS) {
|
|
50864
|
+
console.log(codeFrameColumns(stringify$7({
|
|
50865
|
+
type,
|
|
50866
|
+
value,
|
|
50867
|
+
}), {}, {
|
|
50868
|
+
highlightCode: true,
|
|
50869
|
+
}));
|
|
50870
|
+
|
|
50871
|
+
return;
|
|
50872
|
+
}
|
|
50873
|
+
|
|
50874
|
+
if (LOG_ALL) {
|
|
50875
|
+
console.log(codeFrameColumns(value, {}, {
|
|
50876
|
+
highlightCode: true,
|
|
50877
|
+
}));
|
|
50878
|
+
|
|
50879
|
+
return;
|
|
50880
|
+
}
|
|
50881
|
+
|
|
50882
|
+
if (LOG) {
|
|
50883
|
+
if (value === newline) {
|
|
50884
|
+
console.log(codeFrameColumns(store(), {}, {
|
|
50885
|
+
highlightCode: true,
|
|
50886
|
+
}));
|
|
50887
|
+
|
|
50888
|
+
return;
|
|
50889
|
+
}
|
|
50890
|
+
|
|
50891
|
+
store(value);
|
|
50892
|
+
}
|
|
50893
|
+
|
|
50894
|
+
if (LOG_TERM)
|
|
50895
|
+
browser$1.stdout.write(value);
|
|
50896
|
+
};
|
|
50897
|
+
|
|
50898
|
+
function createStore$1() {
|
|
50899
|
+
let chunks = [];
|
|
50900
|
+
|
|
50901
|
+
return (...args) => {
|
|
50902
|
+
const [chunk] = args;
|
|
50903
|
+
|
|
50904
|
+
if (args.length) {
|
|
50905
|
+
chunks.push(chunk);
|
|
50906
|
+
return;
|
|
50907
|
+
}
|
|
50908
|
+
|
|
50909
|
+
const result = chunks.join('');
|
|
50910
|
+
|
|
50911
|
+
chunks = [];
|
|
50912
|
+
|
|
50913
|
+
return result;
|
|
50914
|
+
};
|
|
50915
|
+
}
|
|
50696
50916
|
|
|
50697
50917
|
const WATER_MARK_BEFORE = '__putout_newline_before';
|
|
50698
50918
|
const WATER_MARK_AFTER = '__putout_newline_after';
|
|
@@ -50715,6 +50935,40 @@ const hasPrevNewline = (path) => {
|
|
|
50715
50935
|
return isMarkedAfter(path.getPrevSibling());
|
|
50716
50936
|
};
|
|
50717
50937
|
|
|
50938
|
+
const isFn$6 = (a) => typeof a === 'function';
|
|
50939
|
+
|
|
50940
|
+
const isParens$2 = (path) => path.node.extra?.parenthesized;
|
|
50941
|
+
|
|
50942
|
+
const maybeParens = (print) => {
|
|
50943
|
+
if (isFn$6(print))
|
|
50944
|
+
return maybeParensPrint(print);
|
|
50945
|
+
|
|
50946
|
+
return maybeParensCondition(print);
|
|
50947
|
+
};
|
|
50948
|
+
|
|
50949
|
+
const maybeParensPrint = (print) => ({
|
|
50950
|
+
condition: isParens$2,
|
|
50951
|
+
before(path, {write}) {
|
|
50952
|
+
write('(');
|
|
50953
|
+
},
|
|
50954
|
+
print,
|
|
50955
|
+
after(path, {write}) {
|
|
50956
|
+
write(')');
|
|
50957
|
+
},
|
|
50958
|
+
});
|
|
50959
|
+
|
|
50960
|
+
const maybeParensCondition = ({print, condition, checkParens = true}) => ({
|
|
50961
|
+
...maybeParensPrint(print),
|
|
50962
|
+
condition: (path, print, semantics) => {
|
|
50963
|
+
const is = condition?.(path, print, semantics);
|
|
50964
|
+
|
|
50965
|
+
if (!checkParens)
|
|
50966
|
+
return is;
|
|
50967
|
+
|
|
50968
|
+
return is || isParens$2(path);
|
|
50969
|
+
},
|
|
50970
|
+
});
|
|
50971
|
+
|
|
50718
50972
|
const maybeInsideFn = (insideFn, {print, indent}) => {
|
|
50719
50973
|
if (!insideFn)
|
|
50720
50974
|
return;
|
|
@@ -50989,7 +51243,7 @@ const parseLeadingComments = (path, printer, semantics, {currentTraverse = {}} =
|
|
|
50989
51243
|
}
|
|
50990
51244
|
};
|
|
50991
51245
|
|
|
50992
|
-
const {assign: assign$
|
|
51246
|
+
const {assign: assign$c} = Object;
|
|
50993
51247
|
|
|
50994
51248
|
const chain$1 = (path) => {
|
|
50995
51249
|
const all = [
|
|
@@ -51059,7 +51313,7 @@ function build(path) {
|
|
|
51059
51313
|
};
|
|
51060
51314
|
|
|
51061
51315
|
if (path.isCallExpression())
|
|
51062
|
-
assign$
|
|
51316
|
+
assign$c(prop, {
|
|
51063
51317
|
args: path.node.arguments.length,
|
|
51064
51318
|
name: path.node.callee.property?.name || '',
|
|
51065
51319
|
});
|
|
@@ -51314,6 +51568,8 @@ function isPrevCall(path) {
|
|
|
51314
51568
|
return !isCallExpression$8(expression.arguments[0]);
|
|
51315
51569
|
}
|
|
51316
51570
|
|
|
51571
|
+
const isEmptyBody$1 = ({node}) => !node.body.length;
|
|
51572
|
+
|
|
51317
51573
|
const parseComments = (path, {write, maybe}, semantics) => {
|
|
51318
51574
|
if (!semantics.comments)
|
|
51319
51575
|
return;
|
|
@@ -51332,7 +51588,7 @@ const parseComments = (path, {write, maybe}, semantics) => {
|
|
|
51332
51588
|
write('//');
|
|
51333
51589
|
write(value);
|
|
51334
51590
|
|
|
51335
|
-
if (program) {
|
|
51591
|
+
if (program && isEmptyBody$1(path)) {
|
|
51336
51592
|
maybe.write.newline(i < n);
|
|
51337
51593
|
continue;
|
|
51338
51594
|
}
|
|
@@ -52028,12 +52284,12 @@ const ClassDeclaration = {
|
|
|
52028
52284
|
},
|
|
52029
52285
|
};
|
|
52030
52286
|
|
|
52031
|
-
const {isArray: isArray$
|
|
52287
|
+
const {isArray: isArray$f} = Array;
|
|
52032
52288
|
|
|
52033
52289
|
const parseArgs = (path) => {
|
|
52034
52290
|
const argsPath = path.get('arguments');
|
|
52035
52291
|
|
|
52036
|
-
if (!isArray$
|
|
52292
|
+
if (!isArray$f(argsPath))
|
|
52037
52293
|
return [];
|
|
52038
52294
|
|
|
52039
52295
|
return argsPath;
|
|
@@ -52176,7 +52432,7 @@ function maybePrintBrace(brace, path, printer, semantics) {
|
|
|
52176
52432
|
maybe.print(roundBraces.new, brace);
|
|
52177
52433
|
}
|
|
52178
52434
|
|
|
52179
|
-
const {isArrayExpression: isArrayExpression$
|
|
52435
|
+
const {isArrayExpression: isArrayExpression$9} = lib_exports;
|
|
52180
52436
|
|
|
52181
52437
|
const TYPES$2 = [
|
|
52182
52438
|
'NullLiteral',
|
|
@@ -52187,7 +52443,7 @@ const TYPES$2 = [
|
|
|
52187
52443
|
const isInsideTuple = (path) => {
|
|
52188
52444
|
const {parentPath} = path;
|
|
52189
52445
|
|
|
52190
|
-
if (!isArrayExpression$
|
|
52446
|
+
if (!isArrayExpression$9(parentPath))
|
|
52191
52447
|
return false;
|
|
52192
52448
|
|
|
52193
52449
|
const [first, second] = parentPath.node.elements;
|
|
@@ -52199,13 +52455,13 @@ const isInsideTuple = (path) => {
|
|
|
52199
52455
|
};
|
|
52200
52456
|
|
|
52201
52457
|
const {
|
|
52202
|
-
isArrayExpression: isArrayExpression$
|
|
52458
|
+
isArrayExpression: isArrayExpression$8,
|
|
52203
52459
|
isCallExpression: isCallExpression$7,
|
|
52204
52460
|
isIdentifier: isIdentifier$e,
|
|
52205
52461
|
} = lib_exports;
|
|
52206
52462
|
|
|
52207
52463
|
const isThirdObjectInsideArray = ({parentPath}) => {
|
|
52208
|
-
if (!isArrayExpression$
|
|
52464
|
+
if (!isArrayExpression$8(parentPath))
|
|
52209
52465
|
return false;
|
|
52210
52466
|
|
|
52211
52467
|
const [, second] = parentPath.node.elements;
|
|
@@ -52215,7 +52471,7 @@ const isThirdObjectInsideArray = ({parentPath}) => {
|
|
|
52215
52471
|
|
|
52216
52472
|
const {
|
|
52217
52473
|
isStringLiteral: isStringLiteral$9,
|
|
52218
|
-
isArrayExpression: isArrayExpression$
|
|
52474
|
+
isArrayExpression: isArrayExpression$7,
|
|
52219
52475
|
isSpreadElement: isSpreadElement$2,
|
|
52220
52476
|
} = lib_exports;
|
|
52221
52477
|
|
|
@@ -52239,10 +52495,10 @@ const isMemberExpressionCallee = ({parentPath}) => {
|
|
|
52239
52495
|
const isInsideCall = ({parentPath}) => parentPath.isCallExpression();
|
|
52240
52496
|
|
|
52241
52497
|
function isInsideNestedArrayCall({parentPath}) {
|
|
52242
|
-
if (!isArrayExpression$
|
|
52498
|
+
if (!isArrayExpression$7(parentPath))
|
|
52243
52499
|
return false;
|
|
52244
52500
|
|
|
52245
|
-
if (!isArrayExpression$
|
|
52501
|
+
if (!isArrayExpression$7(parentPath.parentPath))
|
|
52246
52502
|
return false;
|
|
52247
52503
|
|
|
52248
52504
|
return isInsideCall(parentPath.parentPath);
|
|
@@ -52505,7 +52761,7 @@ function maybePrintTypeAnnotation(path, printer) {
|
|
|
52505
52761
|
|
|
52506
52762
|
const {
|
|
52507
52763
|
isAssignmentPattern: isAssignmentPattern$4,
|
|
52508
|
-
isArrayExpression: isArrayExpression$
|
|
52764
|
+
isArrayExpression: isArrayExpression$6,
|
|
52509
52765
|
isObjectExpression: isObjectExpression$a,
|
|
52510
52766
|
isIdentifier: isIdentifier$d,
|
|
52511
52767
|
} = lib_exports;
|
|
@@ -52514,7 +52770,7 @@ const calculateAssigns = (property, semantics) => {
|
|
|
52514
52770
|
const currentAssign = isLongAssignPattern(property, semantics);
|
|
52515
52771
|
|
|
52516
52772
|
const {right} = property.node.value;
|
|
52517
|
-
const isArrayOrObjectRight = isArrayExpression$
|
|
52773
|
+
const isArrayOrObjectRight = isArrayExpression$6(right) || isComplexObject(right);
|
|
52518
52774
|
const complexAssign = currentAssign && isArrayOrObjectRight;
|
|
52519
52775
|
|
|
52520
52776
|
return {
|
|
@@ -53147,7 +53403,7 @@ const isSimple = (a) => {
|
|
|
53147
53403
|
};
|
|
53148
53404
|
|
|
53149
53405
|
const {
|
|
53150
|
-
isArrayExpression: isArrayExpression$
|
|
53406
|
+
isArrayExpression: isArrayExpression$5,
|
|
53151
53407
|
isLiteral: isLiteral$2,
|
|
53152
53408
|
isIdentifier: isIdentifier$8,
|
|
53153
53409
|
isMemberExpression: isMemberExpression$2,
|
|
@@ -53187,7 +53443,7 @@ function extract(node) {
|
|
|
53187
53443
|
if (isMemberExpression$2(node))
|
|
53188
53444
|
return `${extract(node.object)}.${extract(node.property)}`;
|
|
53189
53445
|
|
|
53190
|
-
if (isArrayExpression$
|
|
53446
|
+
if (isArrayExpression$5(node))
|
|
53191
53447
|
return extractArrayExpression(node);
|
|
53192
53448
|
|
|
53193
53449
|
if (isJSXText$3(node))
|
|
@@ -53228,7 +53484,7 @@ function extract(node) {
|
|
|
53228
53484
|
|
|
53229
53485
|
function extractArrayExpression(node, collector = []) {
|
|
53230
53486
|
for (const el of node.elements) {
|
|
53231
|
-
if (isArrayExpression$
|
|
53487
|
+
if (isArrayExpression$5(el)) {
|
|
53232
53488
|
extractArrayExpression(el, collector);
|
|
53233
53489
|
continue;
|
|
53234
53490
|
}
|
|
@@ -53714,22 +53970,22 @@ function maybeEncode(a) {
|
|
|
53714
53970
|
}
|
|
53715
53971
|
|
|
53716
53972
|
const {
|
|
53717
|
-
isStatement: isStatement$
|
|
53973
|
+
isStatement: isStatement$4,
|
|
53718
53974
|
isBlockStatement: isBlockStatement$5,
|
|
53719
53975
|
blockStatement,
|
|
53720
|
-
expressionStatement: expressionStatement$
|
|
53976
|
+
expressionStatement: expressionStatement$2,
|
|
53721
53977
|
} = lib_exports;
|
|
53722
53978
|
|
|
53723
53979
|
const maybeBody = (path, node) => {
|
|
53724
53980
|
const {parentPath} = path;
|
|
53725
53981
|
|
|
53726
|
-
if (node && !isStatement$
|
|
53982
|
+
if (node && !isStatement$4(node) || isBlockStatement$5(node) || !parentPath?.isArrowFunctionExpression?.())
|
|
53727
53983
|
return {
|
|
53728
53984
|
currentPath: path,
|
|
53729
53985
|
};
|
|
53730
53986
|
|
|
53731
53987
|
parentPath.node.body = blockStatement([
|
|
53732
|
-
expressionStatement$
|
|
53988
|
+
expressionStatement$2(path.node),
|
|
53733
53989
|
]);
|
|
53734
53990
|
|
|
53735
53991
|
return {
|
|
@@ -53740,7 +53996,7 @@ const maybeBody = (path, node) => {
|
|
|
53740
53996
|
const {
|
|
53741
53997
|
isExpression: isExpression$1,
|
|
53742
53998
|
toStatement,
|
|
53743
|
-
expressionStatement: expressionStatement$
|
|
53999
|
+
expressionStatement: expressionStatement$1,
|
|
53744
54000
|
} = lib_exports;
|
|
53745
54001
|
|
|
53746
54002
|
const toExpression = (el) => {
|
|
@@ -53754,7 +54010,7 @@ const toExpression = (el) => {
|
|
|
53754
54010
|
return el;
|
|
53755
54011
|
|
|
53756
54012
|
if (isExpression$1(el))
|
|
53757
|
-
return expressionStatement$
|
|
54013
|
+
return expressionStatement$1(el);
|
|
53758
54014
|
|
|
53759
54015
|
return toStatement(el);
|
|
53760
54016
|
};
|
|
@@ -53806,7 +54062,7 @@ function removeDuplicateLeadingComments(nodes) {
|
|
|
53806
54062
|
}
|
|
53807
54063
|
}
|
|
53808
54064
|
|
|
53809
|
-
const {assign: assign$
|
|
54065
|
+
const {assign: assign$b} = Object;
|
|
53810
54066
|
|
|
53811
54067
|
const parseNode$2 = (a) => {
|
|
53812
54068
|
a = extractMark(a);
|
|
@@ -53830,7 +54086,7 @@ const replaceWith = (path, node) => {
|
|
|
53830
54086
|
|
|
53831
54087
|
currentPath.replaceWith(node);
|
|
53832
54088
|
|
|
53833
|
-
assign$
|
|
54089
|
+
assign$b(currentPath.node, {
|
|
53834
54090
|
comments,
|
|
53835
54091
|
loc,
|
|
53836
54092
|
});
|
|
@@ -53853,8 +54109,8 @@ const {
|
|
|
53853
54109
|
matchesPattern,
|
|
53854
54110
|
isImportDeclaration: isImportDeclaration$1,
|
|
53855
54111
|
isExportDeclaration: isExportDeclaration$4,
|
|
53856
|
-
isStatement: isStatement$
|
|
53857
|
-
expressionStatement
|
|
54112
|
+
isStatement: isStatement$3,
|
|
54113
|
+
expressionStatement,
|
|
53858
54114
|
} = lib_exports;
|
|
53859
54115
|
|
|
53860
54116
|
const insertBefore = (path, node) => {
|
|
@@ -53870,8 +54126,8 @@ const insertAfter = (path, node) => {
|
|
|
53870
54126
|
if (node.trailingComments)
|
|
53871
54127
|
delete node.trailingComments;
|
|
53872
54128
|
|
|
53873
|
-
if (isStatement$
|
|
53874
|
-
path.insertAfter(expressionStatement
|
|
54129
|
+
if (isStatement$3(path) && !isStatement$3(node))
|
|
54130
|
+
path.insertAfter(expressionStatement(node));
|
|
53875
54131
|
else
|
|
53876
54132
|
path.insertAfter(node);
|
|
53877
54133
|
|
|
@@ -53920,7 +54176,7 @@ const isESM = (path) => {
|
|
|
53920
54176
|
|
|
53921
54177
|
const {
|
|
53922
54178
|
isObjectExpression: isObjectExpression$4,
|
|
53923
|
-
isArrayExpression: isArrayExpression$
|
|
54179
|
+
isArrayExpression: isArrayExpression$4,
|
|
53924
54180
|
isObjectProperty: isObjectProperty$1,
|
|
53925
54181
|
isCallExpression: isCallExpression$5,
|
|
53926
54182
|
isAwaitExpression,
|
|
@@ -53931,7 +54187,7 @@ const {
|
|
|
53931
54187
|
isIdentifier: isIdentifier$7,
|
|
53932
54188
|
} = lib_exports;
|
|
53933
54189
|
|
|
53934
|
-
const {round
|
|
54190
|
+
const {round} = Math;
|
|
53935
54191
|
|
|
53936
54192
|
const isOneSpread = (elements) => {
|
|
53937
54193
|
if (elements.length > 1)
|
|
@@ -54043,7 +54299,7 @@ const isMultiLine = (path, {elements, maxElementsInOneLine, maxElementLengthInOn
|
|
|
54043
54299
|
if (isSimpleAndObject(elements))
|
|
54044
54300
|
return ONE_LINE;
|
|
54045
54301
|
|
|
54046
|
-
if (isStringAndString(elements) && path.parentPath.isArrayExpression() && isArrayExpression$
|
|
54302
|
+
if (isStringAndString(elements) && path.parentPath.isArrayExpression() && isArrayExpression$4(path.parentPath.node.elements[0]))
|
|
54047
54303
|
return ONE_LINE;
|
|
54048
54304
|
|
|
54049
54305
|
if (isSiblingIsArray(path))
|
|
@@ -54129,7 +54385,7 @@ function isTwoStringsDifferentLength(strings) {
|
|
|
54129
54385
|
const aLength = a.node.value.length;
|
|
54130
54386
|
const bLength = b.node.value.length;
|
|
54131
54387
|
|
|
54132
|
-
return round
|
|
54388
|
+
return round(bLength / aLength) > 2;
|
|
54133
54389
|
}
|
|
54134
54390
|
|
|
54135
54391
|
function isInsideLoop(path) {
|
|
@@ -54219,7 +54475,7 @@ const isCurrentNewLine = (path) => {
|
|
|
54219
54475
|
|
|
54220
54476
|
const {
|
|
54221
54477
|
isStringLiteral: isStringLiteral$5,
|
|
54222
|
-
isArrayExpression: isArrayExpression$
|
|
54478
|
+
isArrayExpression: isArrayExpression$3,
|
|
54223
54479
|
isObjectExpression: isObjectExpression$3,
|
|
54224
54480
|
isTemplateLiteral: isTemplateLiteral$2,
|
|
54225
54481
|
} = lib_exports;
|
|
@@ -54258,8 +54514,8 @@ function isArrayInsideArray(path) {
|
|
|
54258
54514
|
return false;
|
|
54259
54515
|
|
|
54260
54516
|
const parentElements = path.parentPath.node.elements;
|
|
54261
|
-
const parentHasArrays = parentElements.filter(isArrayExpression$
|
|
54262
|
-
const lastNotArray = !isArrayExpression$
|
|
54517
|
+
const parentHasArrays = parentElements.filter(isArrayExpression$3).length;
|
|
54518
|
+
const lastNotArray = !isArrayExpression$3(parentElements.at(-1));
|
|
54263
54519
|
|
|
54264
54520
|
if (parentHasArrays && lastNotArray)
|
|
54265
54521
|
return false;
|
|
@@ -55855,7 +56111,7 @@ const {
|
|
|
55855
56111
|
isExportDeclaration: isExportDeclaration$2,
|
|
55856
56112
|
isDoWhileStatement,
|
|
55857
56113
|
isBlockStatement: isBlockStatement$4,
|
|
55858
|
-
isArrayExpression: isArrayExpression$
|
|
56114
|
+
isArrayExpression: isArrayExpression$2,
|
|
55859
56115
|
} = lib_exports;
|
|
55860
56116
|
|
|
55861
56117
|
const isFirstStatement = (path) => path.node.body[0];
|
|
@@ -55865,7 +56121,7 @@ const isMethodOrArrow = (path) => isArrowFunctionExpression(path) || isObjectMet
|
|
|
55865
56121
|
const isInsideArrayTupleOfThree = (path) => {
|
|
55866
56122
|
const {parentPath} = path.parentPath;
|
|
55867
56123
|
|
|
55868
|
-
if (!isArrayExpression$
|
|
56124
|
+
if (!isArrayExpression$2(parentPath))
|
|
55869
56125
|
return false;
|
|
55870
56126
|
|
|
55871
56127
|
const {length} = parentPath.node.elements;
|
|
@@ -56085,7 +56341,7 @@ const ForOfStatement = {
|
|
|
56085
56341
|
const {
|
|
56086
56342
|
isBlockStatement: isBlockStatement$3,
|
|
56087
56343
|
isFunctionDeclaration,
|
|
56088
|
-
isStatement: isStatement$
|
|
56344
|
+
isStatement: isStatement$2,
|
|
56089
56345
|
isExpressionStatement: isExpressionStatement$4,
|
|
56090
56346
|
isReturnStatement,
|
|
56091
56347
|
isContinueStatement,
|
|
@@ -56197,7 +56453,7 @@ const IfStatement = {
|
|
|
56197
56453
|
|
|
56198
56454
|
const nextPath = path.parentPath.getNextSibling();
|
|
56199
56455
|
|
|
56200
|
-
if (path === partOfAlternate && !isTopLevel(path) && !isStatement$
|
|
56456
|
+
if (path === partOfAlternate && !isTopLevel(path) && !isStatement$2(nextPath))
|
|
56201
56457
|
print.newline();
|
|
56202
56458
|
|
|
56203
56459
|
if (isLastEmptyInsideBody(path))
|
|
@@ -56455,7 +56711,7 @@ const isInsideAssignNextAssignFunction = (path) => {
|
|
|
56455
56711
|
|
|
56456
56712
|
const {
|
|
56457
56713
|
isBlockStatement: isBlockStatement$2,
|
|
56458
|
-
isProgram: isProgram$
|
|
56714
|
+
isProgram: isProgram$3,
|
|
56459
56715
|
isIfStatement,
|
|
56460
56716
|
} = lib_exports;
|
|
56461
56717
|
|
|
@@ -56484,7 +56740,7 @@ const printLeadingCommentBlock$1 = (path, printer, semantics, {printComment}) =>
|
|
|
56484
56740
|
if (hasTrailingComment(prev))
|
|
56485
56741
|
return;
|
|
56486
56742
|
|
|
56487
|
-
if (isBlockStatement$2(path.parentPath) && !isProgram$
|
|
56743
|
+
if (isBlockStatement$2(path.parentPath) && !isProgram$3(path.parentPath.parentPath))
|
|
56488
56744
|
indent();
|
|
56489
56745
|
|
|
56490
56746
|
printComment();
|
|
@@ -58087,390 +58343,170 @@ const JSXClosingElement = (path, {print}) => {
|
|
|
58087
58343
|
};
|
|
58088
58344
|
|
|
58089
58345
|
var baseVisitors = /*#__PURE__*/Object.freeze({
|
|
58090
|
-
|
|
58091
|
-
|
|
58092
|
-
|
|
58093
|
-
|
|
58094
|
-
|
|
58095
|
-
|
|
58096
|
-
|
|
58097
|
-
|
|
58098
|
-
|
|
58099
|
-
|
|
58100
|
-
|
|
58101
|
-
|
|
58102
|
-
|
|
58103
|
-
|
|
58104
|
-
|
|
58105
|
-
|
|
58106
|
-
|
|
58107
|
-
|
|
58108
|
-
|
|
58109
|
-
|
|
58110
|
-
|
|
58111
|
-
|
|
58112
|
-
|
|
58113
|
-
|
|
58114
|
-
|
|
58115
|
-
|
|
58116
|
-
|
|
58117
|
-
|
|
58118
|
-
|
|
58119
|
-
|
|
58120
|
-
|
|
58121
|
-
|
|
58122
|
-
|
|
58123
|
-
|
|
58124
|
-
|
|
58125
|
-
|
|
58126
|
-
|
|
58127
|
-
|
|
58128
|
-
|
|
58129
|
-
|
|
58130
|
-
|
|
58131
|
-
|
|
58132
|
-
|
|
58133
|
-
|
|
58134
|
-
|
|
58135
|
-
|
|
58136
|
-
|
|
58137
|
-
|
|
58138
|
-
|
|
58139
|
-
|
|
58140
|
-
|
|
58141
|
-
|
|
58142
|
-
|
|
58143
|
-
|
|
58144
|
-
|
|
58145
|
-
|
|
58146
|
-
|
|
58147
|
-
|
|
58148
|
-
|
|
58149
|
-
|
|
58150
|
-
|
|
58151
|
-
|
|
58152
|
-
|
|
58153
|
-
|
|
58154
|
-
|
|
58155
|
-
|
|
58156
|
-
|
|
58157
|
-
|
|
58158
|
-
|
|
58159
|
-
|
|
58160
|
-
|
|
58161
|
-
|
|
58162
|
-
|
|
58163
|
-
|
|
58164
|
-
|
|
58165
|
-
|
|
58166
|
-
|
|
58167
|
-
|
|
58168
|
-
|
|
58169
|
-
|
|
58170
|
-
|
|
58171
|
-
|
|
58172
|
-
|
|
58173
|
-
|
|
58174
|
-
|
|
58175
|
-
|
|
58176
|
-
|
|
58177
|
-
|
|
58178
|
-
|
|
58179
|
-
|
|
58180
|
-
|
|
58181
|
-
|
|
58182
|
-
|
|
58183
|
-
|
|
58184
|
-
|
|
58185
|
-
|
|
58186
|
-
|
|
58187
|
-
|
|
58188
|
-
|
|
58189
|
-
|
|
58190
|
-
|
|
58191
|
-
|
|
58192
|
-
|
|
58193
|
-
|
|
58194
|
-
|
|
58195
|
-
|
|
58196
|
-
|
|
58197
|
-
|
|
58198
|
-
|
|
58199
|
-
|
|
58200
|
-
|
|
58201
|
-
|
|
58202
|
-
|
|
58203
|
-
|
|
58204
|
-
|
|
58205
|
-
|
|
58206
|
-
|
|
58207
|
-
|
|
58208
|
-
|
|
58209
|
-
|
|
58210
|
-
|
|
58211
|
-
|
|
58212
|
-
|
|
58213
|
-
|
|
58214
|
-
|
|
58215
|
-
|
|
58216
|
-
|
|
58217
|
-
|
|
58218
|
-
|
|
58219
|
-
|
|
58220
|
-
|
|
58221
|
-
|
|
58222
|
-
|
|
58223
|
-
|
|
58224
|
-
|
|
58225
|
-
|
|
58226
|
-
|
|
58227
|
-
|
|
58228
|
-
|
|
58229
|
-
|
|
58230
|
-
|
|
58231
|
-
|
|
58232
|
-
|
|
58233
|
-
|
|
58234
|
-
|
|
58235
|
-
|
|
58236
|
-
|
|
58237
|
-
|
|
58238
|
-
|
|
58239
|
-
|
|
58240
|
-
|
|
58241
|
-
|
|
58242
|
-
|
|
58243
|
-
|
|
58244
|
-
|
|
58245
|
-
|
|
58246
|
-
|
|
58247
|
-
|
|
58248
|
-
|
|
58249
|
-
|
|
58250
|
-
|
|
58251
|
-
|
|
58346
|
+
__proto__: null,
|
|
58347
|
+
ArrayExpression: ArrayExpression,
|
|
58348
|
+
ArrayPattern: ArrayPattern,
|
|
58349
|
+
ArrowFunctionExpression: ArrowFunctionExpression,
|
|
58350
|
+
AssignmentExpression: AssignmentExpression,
|
|
58351
|
+
AssignmentPattern: AssignmentPattern,
|
|
58352
|
+
AwaitExpression: AwaitExpression,
|
|
58353
|
+
BigIntLiteral: BigIntLiteral,
|
|
58354
|
+
BinaryExpression: BinaryExpression,
|
|
58355
|
+
BlockStatement: BlockStatement,
|
|
58356
|
+
BooleanLiteral: BooleanLiteral,
|
|
58357
|
+
BreakStatement: BreakStatement,
|
|
58358
|
+
CallExpression: CallExpression,
|
|
58359
|
+
CatchClause: CatchClause,
|
|
58360
|
+
ClassAccessorProperty: ClassAccessorProperty,
|
|
58361
|
+
ClassDeclaration: ClassDeclaration,
|
|
58362
|
+
ClassExpression: ClassExpression,
|
|
58363
|
+
ClassMethod: ClassMethod,
|
|
58364
|
+
ClassPrivateMethod: ClassPrivateMethod,
|
|
58365
|
+
ClassPrivateProperty: ClassPrivateProperty,
|
|
58366
|
+
ClassProperty: ClassProperty,
|
|
58367
|
+
ConditionalExpression: ConditionalExpression,
|
|
58368
|
+
ContinueStatement: ContinueStatement,
|
|
58369
|
+
DebuggerStatement: DebuggerStatement,
|
|
58370
|
+
Decorator: Decorator,
|
|
58371
|
+
Directive: Directive,
|
|
58372
|
+
DirectiveLiteral: DirectiveLiteral,
|
|
58373
|
+
DoWhileStatement: DoWhileStatement,
|
|
58374
|
+
EmptyStatement: EmptyStatement,
|
|
58375
|
+
ExportAllDeclaration: ExportAllDeclaration,
|
|
58376
|
+
ExportDefaultDeclaration: ExportDefaultDeclaration,
|
|
58377
|
+
ExportDefaultSpecifier: ExportDefaultSpecifier,
|
|
58378
|
+
ExportNamedDeclaration: ExportNamedDeclaration,
|
|
58379
|
+
ExportNamespaceSpecifier: ExportNamespaceSpecifier,
|
|
58380
|
+
ExportSpecifier: ExportSpecifier,
|
|
58381
|
+
ExpressionStatement: ExpressionStatement,
|
|
58382
|
+
ForInStatement: ForInStatement,
|
|
58383
|
+
ForOfStatement: ForOfStatement,
|
|
58384
|
+
ForStatement: ForStatement,
|
|
58385
|
+
FunctionDeclaration: FunctionDeclaration,
|
|
58386
|
+
FunctionExpression: FunctionExpression,
|
|
58387
|
+
Identifier: Identifier,
|
|
58388
|
+
IfStatement: IfStatement,
|
|
58389
|
+
ImportAttribute: ImportAttribute,
|
|
58390
|
+
ImportDeclaration: ImportDeclaration,
|
|
58391
|
+
ImportExpression: ImportExpression,
|
|
58392
|
+
InterpreterDirective: InterpreterDirective,
|
|
58393
|
+
JSXAttribute: JSXAttribute,
|
|
58394
|
+
JSXClosingElement: JSXClosingElement,
|
|
58395
|
+
JSXClosingFragment: JSXClosingFragment,
|
|
58396
|
+
JSXElement: JSXElement,
|
|
58397
|
+
JSXEmptyExpression: JSXEmptyExpression,
|
|
58398
|
+
JSXExpressionContainer: JSXExpressionContainer,
|
|
58399
|
+
JSXFragment: JSXFragment,
|
|
58400
|
+
JSXIdentifier: JSXIdentifier,
|
|
58401
|
+
JSXMemberExpression: JSXMemberExpression,
|
|
58402
|
+
JSXOpeningElement: JSXOpeningElement,
|
|
58403
|
+
JSXOpeningFragment: JSXOpeningFragment,
|
|
58404
|
+
JSXSpreadAttribute: JSXSpreadAttribute,
|
|
58405
|
+
JSXText: JSXText,
|
|
58406
|
+
LabeledStatement: LabeledStatement,
|
|
58407
|
+
LogicalExpression: LogicalExpression,
|
|
58408
|
+
MemberExpression: MemberExpression,
|
|
58409
|
+
MetaProperty: MetaProperty,
|
|
58410
|
+
NewExpression: NewExpression,
|
|
58411
|
+
NullLiteral: NullLiteral,
|
|
58412
|
+
NumericLiteral: NumericLiteral,
|
|
58413
|
+
ObjectExpression: ObjectExpression,
|
|
58414
|
+
ObjectMethod: ObjectMethod,
|
|
58415
|
+
ObjectPattern: ObjectPattern,
|
|
58416
|
+
ObjectProperty: ObjectProperty,
|
|
58417
|
+
OptionalCallExpression: OptionalCallExpression,
|
|
58418
|
+
OptionalMemberExpression: OptionalMemberExpression,
|
|
58419
|
+
ParenthesizedExpression: ParenthesizedExpression,
|
|
58420
|
+
PrivateName: PrivateName,
|
|
58421
|
+
Program: Program,
|
|
58422
|
+
RegExpLiteral: RegExpLiteral,
|
|
58423
|
+
RestElement: RestElement,
|
|
58424
|
+
ReturnStatement: ReturnStatement,
|
|
58425
|
+
SequenceExpression: SequenceExpression,
|
|
58426
|
+
SpreadElement: SpreadElement,
|
|
58427
|
+
StaticBlock: StaticBlock,
|
|
58428
|
+
StringLiteral: StringLiteral,
|
|
58429
|
+
Super: Super,
|
|
58430
|
+
SwitchStatement: SwitchStatement,
|
|
58431
|
+
TSAnyKeyword: TSAnyKeyword,
|
|
58432
|
+
TSArrayType: TSArrayType,
|
|
58433
|
+
TSAsExpression: TSAsExpression,
|
|
58434
|
+
TSBigIntKeyword: TSBigIntKeyword,
|
|
58435
|
+
TSBooleanKeyword: TSBooleanKeyword,
|
|
58436
|
+
TSCallSignatureDeclaration: TSCallSignatureDeclaration,
|
|
58437
|
+
TSClassImplements: TSClassImplements,
|
|
58438
|
+
TSConditionalType: TSConditionalType,
|
|
58439
|
+
TSConstructSignatureDeclaration: TSConstructSignatureDeclaration,
|
|
58440
|
+
TSConstructorType: TSConstructorType,
|
|
58441
|
+
TSDeclareFunction: TSDeclareFunction,
|
|
58442
|
+
TSDeclareMethod: TSDeclareMethod,
|
|
58443
|
+
TSEnumDeclaration: TSEnumDeclaration,
|
|
58444
|
+
TSEnumMember: TSEnumMember,
|
|
58445
|
+
TSExportAssignment: TSExportAssignment,
|
|
58446
|
+
TSExternalModuleReference: TSExternalModuleReference,
|
|
58447
|
+
TSFunctionType: TSFunctionType,
|
|
58448
|
+
TSImportEqualsDeclaration: TSImportEqualsDeclaration,
|
|
58449
|
+
TSImportType: TSImportType,
|
|
58450
|
+
TSIndexSignature: TSIndexSignature,
|
|
58451
|
+
TSIndexedAccessType: TSIndexedAccessType,
|
|
58452
|
+
TSInferType: TSInferType,
|
|
58453
|
+
TSInstantiationExpression: TSInstantiationExpression,
|
|
58454
|
+
TSInterfaceBody: TSInterfaceBody,
|
|
58455
|
+
TSInterfaceDeclaration: TSInterfaceDeclaration,
|
|
58456
|
+
TSInterfaceHeritage: TSInterfaceHeritage,
|
|
58457
|
+
TSIntersectionType: TSIntersectionType,
|
|
58458
|
+
TSLiteralType: TSLiteralType,
|
|
58459
|
+
TSMappedType: TSMappedType,
|
|
58460
|
+
TSMethodSignature: TSMethodSignature,
|
|
58461
|
+
TSModuleBlock: TSModuleBlock,
|
|
58462
|
+
TSModuleDeclaration: TSModuleDeclaration,
|
|
58463
|
+
TSNamedTupleMember: TSNamedTupleMember,
|
|
58464
|
+
TSNeverKeyword: TSNeverKeyword,
|
|
58465
|
+
TSNonNullExpression: TSNonNullExpression,
|
|
58466
|
+
TSNullKeyword: TSNullKeyword,
|
|
58467
|
+
TSNumberKeyword: TSNumberKeyword,
|
|
58468
|
+
TSObjectKeyword: TSObjectKeyword,
|
|
58469
|
+
TSOptionalType: TSOptionalType,
|
|
58470
|
+
TSParameterProperty: TSParameterProperty,
|
|
58471
|
+
TSParenthesizedType: TSParenthesizedType,
|
|
58472
|
+
TSPropertySignature: TSPropertySignature,
|
|
58473
|
+
TSQualifiedName: TSQualifiedName,
|
|
58474
|
+
TSRestType: TSRestType,
|
|
58475
|
+
TSSatisfiesExpression: TSSatisfiesExpression,
|
|
58476
|
+
TSStringKeyword: TSStringKeyword,
|
|
58477
|
+
TSSymbolKeyword: TSSymbolKeyword,
|
|
58478
|
+
TSTemplateLiteralType: TSTemplateLiteralType,
|
|
58479
|
+
TSThisType: TSThisType,
|
|
58480
|
+
TSTupleType: TSTupleType,
|
|
58481
|
+
TSTypeAliasDeclaration: TSTypeAliasDeclaration,
|
|
58482
|
+
TSTypeAnnotation: TSTypeAnnotation,
|
|
58483
|
+
TSTypeAssertion: TSTypeAssertion,
|
|
58484
|
+
TSTypeLiteral: TSTypeLiteral,
|
|
58485
|
+
TSTypeOperator: TSTypeOperator,
|
|
58486
|
+
TSTypeParameter: TSTypeParameter,
|
|
58487
|
+
TSTypeParameterDeclaration: TSTypeParameterDeclaration,
|
|
58488
|
+
TSTypeParameterInstantiation: TSTypeParameterInstantiation,
|
|
58489
|
+
TSTypePredicate: TSTypePredicate,
|
|
58490
|
+
TSTypeQuery: TSTypeQuery,
|
|
58491
|
+
TSTypeReference: TSTypeReference,
|
|
58492
|
+
TSUndefinedKeyword: TSUndefinedKeyword,
|
|
58493
|
+
TSUnionType: TSUnionType,
|
|
58494
|
+
TSUnknownKeyword: TSUnknownKeyword,
|
|
58495
|
+
TSVoidKeyword: TSVoidKeyword,
|
|
58496
|
+
TaggedTemplateExpression: TaggedTemplateExpression,
|
|
58497
|
+
TemplateLiteral: TemplateLiteral,
|
|
58498
|
+
ThisExpression: ThisExpression,
|
|
58499
|
+
ThrowStatement: ThrowStatement,
|
|
58500
|
+
TryStatement: TryStatement,
|
|
58501
|
+
UnaryExpression: UnaryExpression,
|
|
58502
|
+
UpdateExpression: UpdateExpression,
|
|
58503
|
+
VariableDeclaration: VariableDeclaration,
|
|
58504
|
+
VoidPattern: VoidPattern,
|
|
58505
|
+
WhileStatement: WhileStatement,
|
|
58506
|
+
WithStatement: WithStatement,
|
|
58507
|
+
YieldExpression: YieldExpression
|
|
58252
58508
|
});
|
|
58253
58509
|
|
|
58254
|
-
const isString$c = (a) => typeof a === 'string';
|
|
58255
|
-
const constant = (a) => () => a;
|
|
58256
|
-
const {keys: keys$3} = Object;
|
|
58257
|
-
|
|
58258
|
-
const rendy = (template, values, modifiers) => {
|
|
58259
|
-
check$e(template, values);
|
|
58260
|
-
|
|
58261
|
-
let result = template;
|
|
58262
|
-
const names = keys$3(values) ;
|
|
58263
|
-
|
|
58264
|
-
for (const key of names) {
|
|
58265
|
-
const [parsedKey, value] = parseValue$1(key, values);
|
|
58266
|
-
const str = constant(value);
|
|
58267
|
-
|
|
58268
|
-
while (result.includes(parsedKey))
|
|
58269
|
-
result = result.replace(parsedKey, str);
|
|
58270
|
-
}
|
|
58271
|
-
|
|
58272
|
-
if (result.includes('{{'))
|
|
58273
|
-
result = result.replace(/{{.*?}}/g, '');
|
|
58274
|
-
|
|
58275
|
-
return result;
|
|
58276
|
-
};
|
|
58277
|
-
|
|
58278
|
-
function check$e(template, values) {
|
|
58279
|
-
if (!isString$c(template))
|
|
58280
|
-
throw Error('template should be a string!');
|
|
58281
|
-
|
|
58282
|
-
if (typeof values !== 'object')
|
|
58283
|
-
throw Error('values should be an object!');
|
|
58284
|
-
}
|
|
58285
|
-
|
|
58286
|
-
function parseValue$1(key, values, modifiers) {
|
|
58287
|
-
return [
|
|
58288
|
-
`{{ ${key} }}`,
|
|
58289
|
-
values[key],
|
|
58290
|
-
];
|
|
58291
|
-
}
|
|
58292
|
-
|
|
58293
|
-
var maybeSatisfy = (plugin) => {
|
|
58294
|
-
if (!plugin.afterSatisfy && !plugin.beforeSatisfy && !plugin.satisfy)
|
|
58295
|
-
return plugin;
|
|
58296
|
-
|
|
58297
|
-
const {
|
|
58298
|
-
satisfy,
|
|
58299
|
-
afterSatisfy = satisfy,
|
|
58300
|
-
beforeSatisfy = satisfy,
|
|
58301
|
-
} = plugin;
|
|
58302
|
-
|
|
58303
|
-
return {
|
|
58304
|
-
afterIf: createIf(afterSatisfy),
|
|
58305
|
-
beforeIf: createIf(beforeSatisfy),
|
|
58306
|
-
...plugin,
|
|
58307
|
-
};
|
|
58308
|
-
};
|
|
58309
|
-
|
|
58310
|
-
const createIf = (getConditions) => {
|
|
58311
|
-
const conditions = getConditions?.() || [];
|
|
58312
|
-
return satisfy(conditions);
|
|
58313
|
-
};
|
|
58314
|
-
|
|
58315
|
-
const {
|
|
58316
|
-
isProgram: isProgram$3,
|
|
58317
|
-
isFile: isFile$1,
|
|
58318
|
-
isStatement: isStatement$2,
|
|
58319
|
-
expressionStatement,
|
|
58320
|
-
program,
|
|
58321
|
-
file,
|
|
58322
|
-
} = lib_exports;
|
|
58323
|
-
|
|
58324
|
-
const isFn$6 = (a) => typeof a === 'function';
|
|
58325
|
-
|
|
58326
|
-
const maybeThrow = (a, path, b) => {
|
|
58327
|
-
if (!a)
|
|
58328
|
-
return;
|
|
58329
|
-
|
|
58330
|
-
throw Error(rendy(b, {
|
|
58331
|
-
path,
|
|
58332
|
-
type: path.type,
|
|
58333
|
-
}));
|
|
58334
|
-
};
|
|
58335
|
-
|
|
58336
|
-
const maybeStatement = (ast) => isStatement$2(ast) ? ast : expressionStatement(ast);
|
|
58337
|
-
|
|
58338
|
-
const maybeProgram = (ast) => isProgram$3(ast) ? ast : program([
|
|
58339
|
-
maybeStatement(ast),
|
|
58340
|
-
]);
|
|
58341
|
-
|
|
58342
|
-
const maybeFile = (ast) => isFile$1(ast) ? ast : file(maybeProgram(ast));
|
|
58343
|
-
|
|
58344
|
-
const maybeVisitor = (plugin, path, printer, options) => {
|
|
58345
|
-
if (isFn$6(plugin))
|
|
58346
|
-
return plugin(path, printer, options);
|
|
58347
|
-
|
|
58348
|
-
return objectPlugin(plugin, path, printer, options);
|
|
58349
|
-
};
|
|
58350
|
-
|
|
58351
|
-
function objectPlugin(plugin, path, printer, semantics) {
|
|
58352
|
-
const {
|
|
58353
|
-
print,
|
|
58354
|
-
split,
|
|
58355
|
-
condition,
|
|
58356
|
-
before = split,
|
|
58357
|
-
beforeIf = condition,
|
|
58358
|
-
after = split,
|
|
58359
|
-
afterIf = condition,
|
|
58360
|
-
} = maybeSatisfy(plugin);
|
|
58361
|
-
|
|
58362
|
-
if (beforeIf?.(path, printer, semantics))
|
|
58363
|
-
before(path, printer, semantics);
|
|
58364
|
-
|
|
58365
|
-
print(path, printer, semantics);
|
|
58366
|
-
|
|
58367
|
-
if (afterIf?.(path, printer, semantics))
|
|
58368
|
-
after(path, printer, semantics);
|
|
58369
|
-
}
|
|
58370
|
-
|
|
58371
|
-
var stringSnakeCase = snakeCase;
|
|
58372
|
-
|
|
58373
|
-
/*
|
|
58374
|
-
snakeCase('the quick brown fox'); // 'the_quick_brown_fox'
|
|
58375
|
-
snakeCase('the-quick-brown-fox'); // 'the_quick_brown_fox'
|
|
58376
|
-
snakeCase('the_quick_brown_fox'); // 'the_quick_brown_fox'
|
|
58377
|
-
snakeCase('theQuickBrownFox'); // 'the_quick_brown_fox'
|
|
58378
|
-
snakeCase('theQuickBrown Fox'); // 'the_quick_brown_Fox'
|
|
58379
|
-
snakeCase('thequickbrownfox'); // 'thequickbrownfox'
|
|
58380
|
-
snakeCase('the - quick * brown# fox'); // 'the_quick_brown_fox'
|
|
58381
|
-
snakeCase('theQUICKBrownFox'); // 'the_q_u_i_c_k_brown_fox'
|
|
58382
|
-
*/
|
|
58383
|
-
|
|
58384
|
-
// any combination of spaces and punctuation characters
|
|
58385
|
-
// thanks to http://stackoverflow.com/a/25575009
|
|
58386
|
-
var wordSeparators = /[\s\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,\-.\/:;<=>?@\[\]^_`{|}~]+/;
|
|
58387
|
-
var capitals = /[A-Z\u00C0-\u00D6\u00D9-\u00DD]/g;
|
|
58388
|
-
|
|
58389
|
-
function snakeCase(str) {
|
|
58390
|
-
//replace capitals with space + lower case equivalent for later parsing
|
|
58391
|
-
str = str.replace(capitals, function(match) {
|
|
58392
|
-
return ' ' + (match.toLowerCase() || match);
|
|
58393
|
-
});
|
|
58394
|
-
return str
|
|
58395
|
-
.trim()
|
|
58396
|
-
.split(wordSeparators)
|
|
58397
|
-
.join('_');
|
|
58398
|
-
}
|
|
58399
|
-
|
|
58400
|
-
const {stringify: stringify$7} = JSON;
|
|
58401
|
-
const {
|
|
58402
|
-
LOG,
|
|
58403
|
-
LOG_ALL,
|
|
58404
|
-
LOG_TOKENS,
|
|
58405
|
-
LOG_TERM,
|
|
58406
|
-
LOG_DEBUG,
|
|
58407
|
-
} = {};
|
|
58408
|
-
|
|
58409
|
-
const createDebug$4 = (tokens) => (a) => {
|
|
58410
|
-
if (!LOG_DEBUG)
|
|
58411
|
-
return;
|
|
58412
|
-
|
|
58413
|
-
tokens.push({
|
|
58414
|
-
type: TYPES$3.DEBUG,
|
|
58415
|
-
value: `/*__${stringSnakeCase(a)}*/`,
|
|
58416
|
-
});
|
|
58417
|
-
};
|
|
58418
|
-
|
|
58419
|
-
const createLog = ({newline = '\n', store = createStore$1()} = {}) => ({type, value}) => {
|
|
58420
|
-
if (LOG_TOKENS) {
|
|
58421
|
-
console.log(codeFrameColumns(stringify$7({
|
|
58422
|
-
type,
|
|
58423
|
-
value,
|
|
58424
|
-
}), {}, {
|
|
58425
|
-
highlightCode: true,
|
|
58426
|
-
}));
|
|
58427
|
-
|
|
58428
|
-
return;
|
|
58429
|
-
}
|
|
58430
|
-
|
|
58431
|
-
if (LOG_ALL) {
|
|
58432
|
-
console.log(codeFrameColumns(value, {}, {
|
|
58433
|
-
highlightCode: true,
|
|
58434
|
-
}));
|
|
58435
|
-
|
|
58436
|
-
return;
|
|
58437
|
-
}
|
|
58438
|
-
|
|
58439
|
-
if (LOG) {
|
|
58440
|
-
if (value === newline) {
|
|
58441
|
-
console.log(codeFrameColumns(store(), {}, {
|
|
58442
|
-
highlightCode: true,
|
|
58443
|
-
}));
|
|
58444
|
-
|
|
58445
|
-
return;
|
|
58446
|
-
}
|
|
58447
|
-
|
|
58448
|
-
store(value);
|
|
58449
|
-
}
|
|
58450
|
-
|
|
58451
|
-
if (LOG_TERM)
|
|
58452
|
-
browser$1.stdout.write(value);
|
|
58453
|
-
};
|
|
58454
|
-
|
|
58455
|
-
function createStore$1() {
|
|
58456
|
-
let chunks = [];
|
|
58457
|
-
|
|
58458
|
-
return (...args) => {
|
|
58459
|
-
const [chunk] = args;
|
|
58460
|
-
|
|
58461
|
-
if (args.length) {
|
|
58462
|
-
chunks.push(chunk);
|
|
58463
|
-
return;
|
|
58464
|
-
}
|
|
58465
|
-
|
|
58466
|
-
const result = chunks.join('');
|
|
58467
|
-
|
|
58468
|
-
chunks = [];
|
|
58469
|
-
|
|
58470
|
-
return result;
|
|
58471
|
-
};
|
|
58472
|
-
}
|
|
58473
|
-
|
|
58474
58510
|
const isObject$7 = (a) => a && typeof a === 'object';
|
|
58475
58511
|
const isBool$3 = (a) => typeof a === 'boolean';
|
|
58476
58512
|
|
|
@@ -58566,40 +58602,13 @@ const initSemantics = (format, semantics = {}) => ({
|
|
|
58566
58602
|
roundBraces: parseRoundBraces(semantics),
|
|
58567
58603
|
});
|
|
58568
58604
|
|
|
58569
|
-
const
|
|
58570
|
-
const {round} = Math;
|
|
58571
|
-
const isString$b = (a) => typeof a === 'string';
|
|
58572
|
-
const {assign: assign$9, freeze} = Object;
|
|
58573
|
-
|
|
58574
|
-
const GET = '__';
|
|
58575
|
-
const get = (path, command) => path.get(command.replace(GET, ''));
|
|
58576
|
-
|
|
58577
|
-
const createAddToken = (tokens) => {
|
|
58578
|
-
const log = createLog();
|
|
58579
|
-
|
|
58580
|
-
return (token) => {
|
|
58581
|
-
log(token);
|
|
58582
|
-
tokens.push(token);
|
|
58583
|
-
};
|
|
58584
|
-
};
|
|
58605
|
+
const {assign: assign$a} = Object;
|
|
58585
58606
|
|
|
58586
|
-
const
|
|
58587
|
-
|
|
58588
|
-
visitors,
|
|
58589
|
-
format,
|
|
58590
|
-
semantics,
|
|
58591
|
-
} = parseOverrides(overrides);
|
|
58592
|
-
|
|
58593
|
-
const tokens = [];
|
|
58594
|
-
const addToken = createAddToken(tokens);
|
|
58595
|
-
const debug = createDebug$4(tokens);
|
|
58607
|
+
const createIndent = ({format, addToken}) => {
|
|
58608
|
+
let i = 0;
|
|
58596
58609
|
|
|
58597
|
-
const
|
|
58598
|
-
|
|
58599
|
-
type: TYPES$3.TOKEN,
|
|
58600
|
-
value,
|
|
58601
|
-
});
|
|
58602
|
-
};
|
|
58610
|
+
const incIndent = () => ++i;
|
|
58611
|
+
const decIndent = () => --i;
|
|
58603
58612
|
|
|
58604
58613
|
const indent = () => {
|
|
58605
58614
|
addToken({
|
|
@@ -58608,73 +58617,87 @@ const tokenize = (ast, overrides) => {
|
|
|
58608
58617
|
});
|
|
58609
58618
|
};
|
|
58610
58619
|
|
|
58611
|
-
|
|
58612
|
-
|
|
58613
|
-
|
|
58614
|
-
|
|
58615
|
-
|
|
58620
|
+
assign$a(indent, {
|
|
58621
|
+
inc: incIndent,
|
|
58622
|
+
dec: decIndent,
|
|
58623
|
+
getLevel() {
|
|
58624
|
+
return i;
|
|
58625
|
+
},
|
|
58626
|
+
});
|
|
58616
58627
|
|
|
58617
|
-
|
|
58618
|
-
|
|
58619
|
-
|
|
58620
|
-
|
|
58621
|
-
|
|
58622
|
-
|
|
58628
|
+
return indent;
|
|
58629
|
+
};
|
|
58630
|
+
|
|
58631
|
+
function printIndent(i, indent) {
|
|
58632
|
+
let result = '';
|
|
58633
|
+
++i;
|
|
58623
58634
|
|
|
58624
|
-
|
|
58635
|
+
while (--i > 0) {
|
|
58636
|
+
result += indent;
|
|
58637
|
+
}
|
|
58625
58638
|
|
|
58626
|
-
|
|
58627
|
-
|
|
58628
|
-
|
|
58629
|
-
|
|
58639
|
+
return result;
|
|
58640
|
+
}
|
|
58641
|
+
|
|
58642
|
+
const isObject$6 = (a) => a && typeof a === 'object';
|
|
58643
|
+
const isString$c = (a) => typeof a === 'string';
|
|
58644
|
+
|
|
58645
|
+
const GET = '__';
|
|
58646
|
+
const get = (path, command) => path.get(command.replace(GET, ''));
|
|
58647
|
+
|
|
58648
|
+
const {freeze, assign: assign$9} = Object;
|
|
58649
|
+
|
|
58650
|
+
const createPrinter = (overrides) => {
|
|
58651
|
+
const tokens = [];
|
|
58652
|
+
const {
|
|
58653
|
+
format,
|
|
58654
|
+
semantics,
|
|
58655
|
+
visitors,
|
|
58656
|
+
} = parseOverrides(overrides);
|
|
58630
58657
|
|
|
58631
|
-
const
|
|
58658
|
+
const addToken = createAddToken(tokens);
|
|
58659
|
+
const debug = createDebug$4(tokens);
|
|
58660
|
+
const write = createWrite(addToken);
|
|
58632
58661
|
|
|
58633
|
-
const
|
|
58634
|
-
|
|
58635
|
-
|
|
58636
|
-
};
|
|
58662
|
+
const indent = createIndent({
|
|
58663
|
+
format,
|
|
58664
|
+
addToken,
|
|
58665
|
+
});
|
|
58637
58666
|
|
|
58638
|
-
const
|
|
58639
|
-
|
|
58667
|
+
const newline = createNewline({
|
|
58668
|
+
format,
|
|
58669
|
+
addToken,
|
|
58670
|
+
});
|
|
58640
58671
|
|
|
58641
|
-
const
|
|
58642
|
-
|
|
58643
|
-
|
|
58644
|
-
|
|
58645
|
-
});
|
|
58646
|
-
};
|
|
58672
|
+
const breakline = createBreakline({
|
|
58673
|
+
newline,
|
|
58674
|
+
indent,
|
|
58675
|
+
});
|
|
58647
58676
|
|
|
58648
|
-
const
|
|
58649
|
-
|
|
58650
|
-
|
|
58651
|
-
|
|
58677
|
+
const linebreak = createLinebreak({
|
|
58678
|
+
indent,
|
|
58679
|
+
newline,
|
|
58680
|
+
});
|
|
58652
58681
|
|
|
58653
|
-
|
|
58654
|
-
|
|
58655
|
-
|
|
58682
|
+
const space = createSpace({
|
|
58683
|
+
format,
|
|
58684
|
+
addToken,
|
|
58656
58685
|
});
|
|
58657
58686
|
|
|
58658
|
-
const splitter = (
|
|
58659
|
-
|
|
58660
|
-
|
|
58661
|
-
|
|
58662
|
-
});
|
|
58663
|
-
};
|
|
58687
|
+
const splitter = createSplitter({
|
|
58688
|
+
format,
|
|
58689
|
+
addToken,
|
|
58690
|
+
});
|
|
58664
58691
|
|
|
58665
|
-
const
|
|
58666
|
-
|
|
58667
|
-
|
|
58668
|
-
|
|
58669
|
-
});
|
|
58670
|
-
};
|
|
58692
|
+
const endOfFile = createEndOfFile({
|
|
58693
|
+
format,
|
|
58694
|
+
addToken,
|
|
58695
|
+
});
|
|
58671
58696
|
|
|
58672
|
-
const
|
|
58673
|
-
addToken
|
|
58674
|
-
|
|
58675
|
-
|
|
58676
|
-
});
|
|
58677
|
-
};
|
|
58697
|
+
const quote = createQuote({
|
|
58698
|
+
addToken,
|
|
58699
|
+
format,
|
|
58700
|
+
});
|
|
58678
58701
|
|
|
58679
58702
|
assign$9(write, {
|
|
58680
58703
|
indent,
|
|
@@ -58687,6 +58710,15 @@ const tokenize = (ast, overrides) => {
|
|
|
58687
58710
|
endOfFile,
|
|
58688
58711
|
});
|
|
58689
58712
|
|
|
58713
|
+
const maybeBreakline = createMaybe(breakline);
|
|
58714
|
+
const maybeNewline = createMaybe(newline);
|
|
58715
|
+
const maybeLinebreak = createMaybe(linebreak);
|
|
58716
|
+
const maybeSpace = createMaybe(space);
|
|
58717
|
+
|
|
58718
|
+
const maybeWrite = createMaybeWrite({
|
|
58719
|
+
write,
|
|
58720
|
+
});
|
|
58721
|
+
|
|
58690
58722
|
assign$9(maybeWrite, {
|
|
58691
58723
|
newline: maybeNewline,
|
|
58692
58724
|
breakline: maybeBreakline,
|
|
@@ -58694,6 +58726,8 @@ const tokenize = (ast, overrides) => {
|
|
|
58694
58726
|
space: maybeSpace,
|
|
58695
58727
|
});
|
|
58696
58728
|
|
|
58729
|
+
const maybeIndent = createMaybe(indent);
|
|
58730
|
+
|
|
58697
58731
|
const maybe = {
|
|
58698
58732
|
indent: maybeIndent,
|
|
58699
58733
|
markAfter: maybeMarkAfter,
|
|
@@ -58701,117 +58735,138 @@ const tokenize = (ast, overrides) => {
|
|
|
58701
58735
|
space: maybeSpace,
|
|
58702
58736
|
};
|
|
58703
58737
|
|
|
58738
|
+
const maybeIndentInc = createMaybe(indent.inc);
|
|
58739
|
+
const maybeIndentDec = createMaybe(indent.dec);
|
|
58740
|
+
|
|
58704
58741
|
assign$9(maybe.indent, {
|
|
58705
58742
|
inc: maybeIndentInc,
|
|
58706
58743
|
dec: maybeIndentDec,
|
|
58707
58744
|
});
|
|
58708
58745
|
|
|
58746
|
+
const getMainPrinter = () => mainPrinter;
|
|
58747
|
+
|
|
58748
|
+
const traverse = createTraverse$6({
|
|
58749
|
+
maybeNewline,
|
|
58750
|
+
maybeLinebreak,
|
|
58751
|
+
maybeSpace,
|
|
58752
|
+
maybeBreakline,
|
|
58753
|
+
indent,
|
|
58754
|
+
write,
|
|
58755
|
+
debug,
|
|
58756
|
+
semantics,
|
|
58757
|
+
visitors,
|
|
58758
|
+
getMainPrinter,
|
|
58759
|
+
});
|
|
58760
|
+
|
|
58709
58761
|
// should never change to avoid unexpected errors related to printing path, since it hard to debug
|
|
58710
58762
|
const mainPrinter = freeze({
|
|
58711
58763
|
indent,
|
|
58712
58764
|
write,
|
|
58713
58765
|
debug,
|
|
58714
|
-
traverse,
|
|
58715
58766
|
maybe,
|
|
58716
58767
|
quote,
|
|
58717
58768
|
store: fullstore(),
|
|
58769
|
+
traverse,
|
|
58718
58770
|
});
|
|
58719
58771
|
|
|
58772
|
+
const getTokens = () => tokens;
|
|
58773
|
+
|
|
58774
|
+
return {
|
|
58775
|
+
getTokens,
|
|
58776
|
+
traverse,
|
|
58777
|
+
};
|
|
58778
|
+
};
|
|
58779
|
+
|
|
58780
|
+
const createTraverse$6 = (overrides) => function traverse(path) {
|
|
58781
|
+
const {
|
|
58782
|
+
write,
|
|
58783
|
+
debug,
|
|
58784
|
+
maybeLinebreak,
|
|
58785
|
+
maybeSpace,
|
|
58786
|
+
maybeBreakline,
|
|
58787
|
+
maybeNewline,
|
|
58788
|
+
indent,
|
|
58789
|
+
semantics,
|
|
58790
|
+
visitors,
|
|
58791
|
+
getMainPrinter,
|
|
58792
|
+
} = overrides;
|
|
58793
|
+
|
|
58794
|
+
const mainPrinter = getMainPrinter();
|
|
58795
|
+
|
|
58720
58796
|
const currentTraversers = {
|
|
58721
58797
|
...baseVisitors,
|
|
58722
58798
|
...visitors,
|
|
58723
58799
|
};
|
|
58724
58800
|
|
|
58725
|
-
|
|
58726
|
-
|
|
58727
|
-
else
|
|
58728
|
-
traverse3(maybeFile(ast), {
|
|
58729
|
-
Program(path) {
|
|
58730
|
-
traverse(path);
|
|
58731
|
-
path.stop();
|
|
58732
|
-
},
|
|
58733
|
-
});
|
|
58801
|
+
const {type} = path;
|
|
58802
|
+
const currentTraverse = currentTraversers[type];
|
|
58734
58803
|
|
|
58735
|
-
|
|
58736
|
-
|
|
58737
|
-
const currentTraverse = currentTraversers[type];
|
|
58738
|
-
|
|
58739
|
-
if (!path.node)
|
|
58740
|
-
return;
|
|
58741
|
-
|
|
58742
|
-
const print = createPrint(path, {
|
|
58743
|
-
write,
|
|
58744
|
-
traverse,
|
|
58745
|
-
});
|
|
58746
|
-
|
|
58747
|
-
assign$9(print, write, {
|
|
58748
|
-
space,
|
|
58749
|
-
round,
|
|
58750
|
-
});
|
|
58751
|
-
|
|
58752
|
-
const printer = {
|
|
58753
|
-
...mainPrinter,
|
|
58754
|
-
print,
|
|
58755
|
-
};
|
|
58756
|
-
|
|
58757
|
-
const maybePrint = (a, b) => a && print(b);
|
|
58758
|
-
|
|
58759
|
-
assign$9(maybePrint, {
|
|
58760
|
-
newline: maybeNewline,
|
|
58761
|
-
breakline: maybeBreakline,
|
|
58762
|
-
linebreak: maybeLinebreak,
|
|
58763
|
-
space: maybeSpace,
|
|
58764
|
-
});
|
|
58765
|
-
|
|
58766
|
-
assign$9(printer.maybe, {
|
|
58767
|
-
print: maybePrint,
|
|
58768
|
-
});
|
|
58769
|
-
|
|
58770
|
-
maybeThrow(!currentTraverse, path, `☝️ Node type '{{ type }}' is not supported yet by @putout/printer: '{{ path }}'`);
|
|
58771
|
-
|
|
58772
|
-
const currentIndent = i;
|
|
58773
|
-
parseLeadingComments(path, printer, semantics, {
|
|
58774
|
-
currentTraverse,
|
|
58775
|
-
});
|
|
58776
|
-
|
|
58777
|
-
// this is main thing
|
|
58778
|
-
maybeVisitor(currentTraverse, path, printer, semantics);
|
|
58779
|
-
parseTrailingComments(path, printer, semantics, {
|
|
58780
|
-
currentTraverse,
|
|
58781
|
-
});
|
|
58782
|
-
maybeThrow(i !== currentIndent, path, `☝️Looks like indent level changed after token visitor: '{{ type }}', for code: '{{ path }}'`);
|
|
58783
|
-
|
|
58784
|
-
debug(path.type);
|
|
58785
|
-
}
|
|
58804
|
+
if (!path.node)
|
|
58805
|
+
return;
|
|
58786
58806
|
|
|
58787
|
-
|
|
58788
|
-
|
|
58789
|
-
|
|
58790
|
-
|
|
58791
|
-
let result = '';
|
|
58792
|
-
++i;
|
|
58807
|
+
const print = createPrint(path, {
|
|
58808
|
+
write,
|
|
58809
|
+
traverse,
|
|
58810
|
+
});
|
|
58793
58811
|
|
|
58794
|
-
|
|
58795
|
-
|
|
58796
|
-
|
|
58812
|
+
const printer = {
|
|
58813
|
+
...mainPrinter,
|
|
58814
|
+
traverse,
|
|
58815
|
+
print,
|
|
58816
|
+
};
|
|
58797
58817
|
|
|
58798
|
-
|
|
58799
|
-
}
|
|
58800
|
-
|
|
58801
|
-
const createPrint = (path, {traverse, write}) => (maybeLine) => {
|
|
58802
|
-
if (maybeLine === path)
|
|
58803
|
-
return null;
|
|
58818
|
+
const maybePrint = (a, b) => a && print(b);
|
|
58804
58819
|
|
|
58805
|
-
|
|
58820
|
+
assign$9(maybePrint, {
|
|
58821
|
+
newline: maybeNewline,
|
|
58822
|
+
breakline: maybeBreakline,
|
|
58823
|
+
linebreak: maybeLinebreak,
|
|
58824
|
+
space: maybeSpace,
|
|
58825
|
+
});
|
|
58826
|
+
|
|
58827
|
+
assign$9(printer.maybe, {
|
|
58828
|
+
print: maybePrint,
|
|
58829
|
+
});
|
|
58830
|
+
|
|
58831
|
+
maybeThrow(!currentTraverse, path, `☝️ Node type '{{ type }}' is not supported yet by @putout/printer: '{{ path }}'`);
|
|
58806
58832
|
|
|
58807
|
-
|
|
58808
|
-
return traverse(computed);
|
|
58833
|
+
const currentIndent = indent.getLevel();
|
|
58809
58834
|
|
|
58810
|
-
|
|
58835
|
+
parseLeadingComments(path, printer, semantics, {
|
|
58836
|
+
currentTraverse,
|
|
58837
|
+
});
|
|
58838
|
+
|
|
58839
|
+
// this is main thing
|
|
58840
|
+
maybeVisitor(currentTraverse, path, printer, semantics);
|
|
58841
|
+
parseTrailingComments(path, printer, semantics, {
|
|
58842
|
+
currentTraverse,
|
|
58843
|
+
});
|
|
58844
|
+
|
|
58845
|
+
maybeThrow(indent.getLevel() !== currentIndent, path, `☝️Looks like indent level changed after token visitor: '{{ type }}', for code: '{{ path }}'`);
|
|
58846
|
+
|
|
58847
|
+
debug(path.type);
|
|
58848
|
+
};
|
|
58849
|
+
|
|
58850
|
+
const createPrint = (path, {traverse, write}) => {
|
|
58851
|
+
const print = (maybeLine) => {
|
|
58852
|
+
if (maybeLine === path)
|
|
58853
|
+
return null;
|
|
58854
|
+
|
|
58855
|
+
const computed = computePath(path, maybeLine);
|
|
58856
|
+
|
|
58857
|
+
if (isObject$6(computed))
|
|
58858
|
+
return traverse(computed);
|
|
58859
|
+
|
|
58860
|
+
return write(computed);
|
|
58861
|
+
};
|
|
58862
|
+
|
|
58863
|
+
assign$9(print, write);
|
|
58864
|
+
|
|
58865
|
+
return print;
|
|
58811
58866
|
};
|
|
58812
58867
|
|
|
58813
58868
|
const computePath = (path, maybeLine) => {
|
|
58814
|
-
if (isString$
|
|
58869
|
+
if (isString$c(maybeLine) && maybeLine.startsWith(GET))
|
|
58815
58870
|
return get(path, maybeLine);
|
|
58816
58871
|
|
|
58817
58872
|
if (isObject$6(maybeLine))
|
|
@@ -58820,6 +58875,87 @@ const computePath = (path, maybeLine) => {
|
|
|
58820
58875
|
return maybeLine;
|
|
58821
58876
|
};
|
|
58822
58877
|
|
|
58878
|
+
const createWrite = (addToken) => (value) => {
|
|
58879
|
+
addToken({
|
|
58880
|
+
type: TYPES$3.TOKEN,
|
|
58881
|
+
value,
|
|
58882
|
+
});
|
|
58883
|
+
};
|
|
58884
|
+
|
|
58885
|
+
const createNewline = ({format, addToken}) => () => {
|
|
58886
|
+
addToken({
|
|
58887
|
+
type: TYPES$3.NEWLINE,
|
|
58888
|
+
value: format.newline,
|
|
58889
|
+
});
|
|
58890
|
+
};
|
|
58891
|
+
|
|
58892
|
+
const createMaybe = (fn) => (a) => a && fn();
|
|
58893
|
+
|
|
58894
|
+
const createBreakline = ({newline, indent}) => () => {
|
|
58895
|
+
newline();
|
|
58896
|
+
indent();
|
|
58897
|
+
};
|
|
58898
|
+
|
|
58899
|
+
const createLinebreak = ({indent, newline}) => () => {
|
|
58900
|
+
indent();
|
|
58901
|
+
newline();
|
|
58902
|
+
};
|
|
58903
|
+
|
|
58904
|
+
const createMaybeWrite = ({write}) => (a, b) => a && write(b);
|
|
58905
|
+
|
|
58906
|
+
const createSpace = ({format, addToken}) => () => {
|
|
58907
|
+
addToken({
|
|
58908
|
+
type: TYPES$3.SPACE,
|
|
58909
|
+
value: format.space,
|
|
58910
|
+
});
|
|
58911
|
+
};
|
|
58912
|
+
|
|
58913
|
+
const createSplitter = ({format, addToken}) => () => {
|
|
58914
|
+
addToken({
|
|
58915
|
+
type: TYPES$3.SPLITTER,
|
|
58916
|
+
value: format.splitter,
|
|
58917
|
+
});
|
|
58918
|
+
};
|
|
58919
|
+
|
|
58920
|
+
const createQuote = ({addToken, format}) => () => {
|
|
58921
|
+
addToken({
|
|
58922
|
+
type: TYPES$3.QUOTE,
|
|
58923
|
+
value: format.quote,
|
|
58924
|
+
});
|
|
58925
|
+
};
|
|
58926
|
+
|
|
58927
|
+
const createEndOfFile = ({format, addToken}) => () => {
|
|
58928
|
+
addToken({
|
|
58929
|
+
type: TYPES$3.END_OF_FILE,
|
|
58930
|
+
value: format.endOfFile,
|
|
58931
|
+
});
|
|
58932
|
+
};
|
|
58933
|
+
|
|
58934
|
+
const createAddToken = (tokens) => {
|
|
58935
|
+
const log = createLog();
|
|
58936
|
+
|
|
58937
|
+
return (token) => {
|
|
58938
|
+
log(token);
|
|
58939
|
+
tokens.push(token);
|
|
58940
|
+
};
|
|
58941
|
+
};
|
|
58942
|
+
|
|
58943
|
+
const tokenize = (ast, overrides) => {
|
|
58944
|
+
const {getTokens, traverse} = createPrinter(overrides);
|
|
58945
|
+
|
|
58946
|
+
if (ast.parentPath)
|
|
58947
|
+
pathTraverse(ast, traverse);
|
|
58948
|
+
else
|
|
58949
|
+
traverse3(maybeFile(ast), {
|
|
58950
|
+
Program(path) {
|
|
58951
|
+
traverse(path);
|
|
58952
|
+
path.stop();
|
|
58953
|
+
},
|
|
58954
|
+
});
|
|
58955
|
+
|
|
58956
|
+
return getTokens();
|
|
58957
|
+
};
|
|
58958
|
+
|
|
58823
58959
|
function pathTraverse(ast, traverse) {
|
|
58824
58960
|
ast.parentPath.traverse({
|
|
58825
58961
|
enter(path) {
|
|
@@ -58997,7 +59133,7 @@ function check$d(ast) {
|
|
|
58997
59133
|
throw Error('☝️Looks like ast not an object');
|
|
58998
59134
|
}
|
|
58999
59135
|
|
|
59000
|
-
const isString$
|
|
59136
|
+
const isString$b = (a) => typeof a === 'string';
|
|
59001
59137
|
|
|
59002
59138
|
const alignSpaces = (str) => {
|
|
59003
59139
|
check$c(str);
|
|
@@ -59045,7 +59181,7 @@ function getSpaces(s) {
|
|
|
59045
59181
|
}
|
|
59046
59182
|
|
|
59047
59183
|
function check$c(str) {
|
|
59048
|
-
if (!isString$
|
|
59184
|
+
if (!isString$b(str))
|
|
59049
59185
|
throw Error('str should be a string!');
|
|
59050
59186
|
}
|
|
59051
59187
|
|
|
@@ -59079,9 +59215,9 @@ const print$1 = (ast, options) => {
|
|
|
59079
59215
|
return alignSpaces(code);
|
|
59080
59216
|
};
|
|
59081
59217
|
|
|
59082
|
-
const {isArray: isArray$
|
|
59218
|
+
const {isArray: isArray$e} = Array;
|
|
59083
59219
|
|
|
59084
|
-
const maybeArray$5 = (a) => isArray$
|
|
59220
|
+
const maybeArray$5 = (a) => isArray$e(a) ? a : [a, {}];
|
|
59085
59221
|
|
|
59086
59222
|
const print = (ast, options = {}) => {
|
|
59087
59223
|
const [printer = 'putout', printerOptions] = maybeArray$5(options.printer);
|
|
@@ -59349,7 +59485,7 @@ function getCommentGroup({trailing, leading}) {
|
|
|
59349
59485
|
return 'innerComments'; // Dangling comments, such as `[/* a */]`.
|
|
59350
59486
|
}
|
|
59351
59487
|
|
|
59352
|
-
const isString$
|
|
59488
|
+
const isString$a = (a) => typeof a === 'string';
|
|
59353
59489
|
const isNumber$2 = (a) => typeof a === 'number';
|
|
59354
59490
|
const isNull = (a) => a === null;
|
|
59355
59491
|
const isBool$2 = (a) => typeof a === 'boolean';
|
|
@@ -59365,7 +59501,7 @@ var setLiteral = (node) => {
|
|
|
59365
59501
|
return;
|
|
59366
59502
|
}
|
|
59367
59503
|
|
|
59368
|
-
if (isString$
|
|
59504
|
+
if (isString$a(value)) {
|
|
59369
59505
|
node.type = 'StringLiteral';
|
|
59370
59506
|
return;
|
|
59371
59507
|
}
|
|
@@ -59674,8 +59810,8 @@ var onceExports = once$6.exports;
|
|
|
59674
59810
|
const noop$3 = () => {};
|
|
59675
59811
|
|
|
59676
59812
|
var empty = /*#__PURE__*/Object.freeze({
|
|
59677
|
-
|
|
59678
|
-
|
|
59813
|
+
__proto__: null,
|
|
59814
|
+
default: noop$3
|
|
59679
59815
|
});
|
|
59680
59816
|
|
|
59681
59817
|
var require$$1 = /*@__PURE__*/getAugmentedNamespace(empty);
|
|
@@ -59706,8 +59842,8 @@ function privateMethods(Parser) {
|
|
|
59706
59842
|
}
|
|
59707
59843
|
|
|
59708
59844
|
var acornPrivateMethods = /*#__PURE__*/Object.freeze({
|
|
59709
|
-
|
|
59710
|
-
|
|
59845
|
+
__proto__: null,
|
|
59846
|
+
default: privateMethods
|
|
59711
59847
|
});
|
|
59712
59848
|
|
|
59713
59849
|
var require$$2 = /*@__PURE__*/getAugmentedNamespace(acornPrivateMethods);
|
|
@@ -59788,10 +59924,10 @@ const allowUndeclaredExports = true;
|
|
|
59788
59924
|
const allowImportExportEverywhere = true;
|
|
59789
59925
|
|
|
59790
59926
|
var options = /*#__PURE__*/Object.freeze({
|
|
59791
|
-
|
|
59792
|
-
|
|
59793
|
-
|
|
59794
|
-
|
|
59927
|
+
__proto__: null,
|
|
59928
|
+
allowImportExportEverywhere: allowImportExportEverywhere,
|
|
59929
|
+
allowReturnOutsideFunction: allowReturnOutsideFunction,
|
|
59930
|
+
allowUndeclaredExports: allowUndeclaredExports
|
|
59795
59931
|
});
|
|
59796
59932
|
|
|
59797
59933
|
const {assign: assign$5} = Object;
|
|
@@ -60028,7 +60164,7 @@ const tryThrowWithReason$1 = (fn, ...args) => {
|
|
|
60028
60164
|
};
|
|
60029
60165
|
|
|
60030
60166
|
const {assign: assign$4} = Object;
|
|
60031
|
-
const isString$
|
|
60167
|
+
const isString$9 = (a) => typeof a === 'string';
|
|
60032
60168
|
|
|
60033
60169
|
const parse$4 = (source, options) => {
|
|
60034
60170
|
check$b(source);
|
|
@@ -60070,7 +60206,7 @@ const getParser = ({parser = 'babel', isTS, isJSX, printer}) => ({
|
|
|
60070
60206
|
});
|
|
60071
60207
|
|
|
60072
60208
|
function check$b(source) {
|
|
60073
|
-
if (!isString$
|
|
60209
|
+
if (!isString$9(source))
|
|
60074
60210
|
throw Error(`☝️ Looks like type of 'source' is not 'string', but '${typeof source}'`);
|
|
60075
60211
|
}
|
|
60076
60212
|
|
|
@@ -60180,6 +60316,126 @@ function $cf838c15c8b009ba$export$22f15dd4e5be7e52(fn, o) {
|
|
|
60180
60316
|
return f;
|
|
60181
60317
|
}
|
|
60182
60318
|
|
|
60319
|
+
const wrap = (fn) => (...a) => (...b) => fn(...a, ...b);
|
|
60320
|
+
|
|
60321
|
+
var wraptile = (fn, ...a) => {
|
|
60322
|
+
check$a(fn);
|
|
60323
|
+
|
|
60324
|
+
if (a.length)
|
|
60325
|
+
return wrap(fn)(...a);
|
|
60326
|
+
|
|
60327
|
+
return wrap(fn);
|
|
60328
|
+
};
|
|
60329
|
+
|
|
60330
|
+
function check$a(fn) {
|
|
60331
|
+
if (typeof fn !== 'function')
|
|
60332
|
+
throw Error('fn should be a function!');
|
|
60333
|
+
}
|
|
60334
|
+
|
|
60335
|
+
var wraptile$1 = wraptile;
|
|
60336
|
+
|
|
60337
|
+
const {entries: entries$a} = Object;
|
|
60338
|
+
const {isArray: isArray$d} = Array;
|
|
60339
|
+
|
|
60340
|
+
var findPath = (parentPath) => {
|
|
60341
|
+
let current = {
|
|
60342
|
+
parentPath,
|
|
60343
|
+
};
|
|
60344
|
+
|
|
60345
|
+
const path = [];
|
|
60346
|
+
|
|
60347
|
+
while (current = current.parentPath) {
|
|
60348
|
+
path.unshift(findKey(current, current.parent));
|
|
60349
|
+
}
|
|
60350
|
+
|
|
60351
|
+
return path.join('.');
|
|
60352
|
+
};
|
|
60353
|
+
|
|
60354
|
+
function findKey(path, parent) {
|
|
60355
|
+
const {node} = path;
|
|
60356
|
+
let key;
|
|
60357
|
+
let value;
|
|
60358
|
+
|
|
60359
|
+
for ([key, value] of entries$a(parent)) {
|
|
60360
|
+
if (isArray$d(value)) {
|
|
60361
|
+
const index = value.indexOf(node);
|
|
60362
|
+
|
|
60363
|
+
if (index >= 0)
|
|
60364
|
+
return `${key}.${index}`;
|
|
60365
|
+
|
|
60366
|
+
continue;
|
|
60367
|
+
}
|
|
60368
|
+
|
|
60369
|
+
if (value === node)
|
|
60370
|
+
break;
|
|
60371
|
+
}
|
|
60372
|
+
|
|
60373
|
+
return key;
|
|
60374
|
+
}
|
|
60375
|
+
|
|
60376
|
+
const {isProgram: isProgram$2} = lib_exports;
|
|
60377
|
+
const hasWatermark = (watermark) => (path) => path.node?.[__watermark]?.has(watermark);
|
|
60378
|
+
|
|
60379
|
+
const __watermark = '__putout_runner_replace';
|
|
60380
|
+
|
|
60381
|
+
const watermark = (from, to, path) => {
|
|
60382
|
+
const {watermark, highWatermark} = create(from, to, path);
|
|
60383
|
+
const program = path.findParent(isProgram$2);
|
|
60384
|
+
const options = {
|
|
60385
|
+
watermark,
|
|
60386
|
+
highWatermark,
|
|
60387
|
+
program,
|
|
60388
|
+
path,
|
|
60389
|
+
};
|
|
60390
|
+
|
|
60391
|
+
return {
|
|
60392
|
+
init: wraptile$1(init, options),
|
|
60393
|
+
has: wraptile$1(has, options),
|
|
60394
|
+
add: wraptile$1(add, options),
|
|
60395
|
+
};
|
|
60396
|
+
};
|
|
60397
|
+
|
|
60398
|
+
function create(from, to, path) {
|
|
60399
|
+
const watermark = `${from} -> ${to}`;
|
|
60400
|
+
const highWatermark = `${findPath(path)}: ${watermark}`;
|
|
60401
|
+
|
|
60402
|
+
return {
|
|
60403
|
+
watermark,
|
|
60404
|
+
highWatermark,
|
|
60405
|
+
};
|
|
60406
|
+
}
|
|
60407
|
+
|
|
60408
|
+
function init({path, program}) {
|
|
60409
|
+
if (path.node)
|
|
60410
|
+
path.node[__watermark] = path.node[__watermark] || new Set();
|
|
60411
|
+
|
|
60412
|
+
program.node[__watermark] = program.node[__watermark] || new Set();
|
|
60413
|
+
}
|
|
60414
|
+
|
|
60415
|
+
function add({path, program, watermark, highWatermark}) {
|
|
60416
|
+
init({
|
|
60417
|
+
path,
|
|
60418
|
+
program,
|
|
60419
|
+
});
|
|
60420
|
+
|
|
60421
|
+
path?.node[__watermark].add(watermark);
|
|
60422
|
+
program.node[__watermark].add(highWatermark);
|
|
60423
|
+
}
|
|
60424
|
+
|
|
60425
|
+
const clearWatermark = (node) => {
|
|
60426
|
+
delete node?.[__watermark];
|
|
60427
|
+
};
|
|
60428
|
+
|
|
60429
|
+
function has({path, program, watermark, highWatermark}) {
|
|
60430
|
+
const {node} = path;
|
|
60431
|
+
const {loc} = node;
|
|
60432
|
+
|
|
60433
|
+
if (node?.[__watermark].has(watermark) || path.findParent(hasWatermark(watermark)) && !loc)
|
|
60434
|
+
return true;
|
|
60435
|
+
|
|
60436
|
+
return program.node[__watermark].has(highWatermark);
|
|
60437
|
+
}
|
|
60438
|
+
|
|
60183
60439
|
const {
|
|
60184
60440
|
nanomemoize = $cf838c15c8b009ba$export$22f15dd4e5be7e52,
|
|
60185
60441
|
} = $cf838c15c8b009ba$export$22f15dd4e5be7e52;
|
|
@@ -60222,7 +60478,7 @@ const template$1 = nanomemoize((value, options) => {
|
|
|
60222
60478
|
|
|
60223
60479
|
template$1.extractExpression = extractExpression$2;
|
|
60224
60480
|
|
|
60225
|
-
|
|
60481
|
+
const templateAst = nanomemoize((value, options) => {
|
|
60226
60482
|
const result = index.ast(value, {
|
|
60227
60483
|
...defaults,
|
|
60228
60484
|
...options,
|
|
@@ -60231,6 +60487,14 @@ template$1.ast = nanomemoize((value, options) => {
|
|
|
60231
60487
|
return extractExpression$2(result);
|
|
60232
60488
|
});
|
|
60233
60489
|
|
|
60490
|
+
template$1.ast = (...a) => {
|
|
60491
|
+
const node = templateAst(...a);
|
|
60492
|
+
|
|
60493
|
+
clearWatermark(node);
|
|
60494
|
+
|
|
60495
|
+
return templateAst(...a);
|
|
60496
|
+
};
|
|
60497
|
+
|
|
60234
60498
|
template$1.program = nanomemoize((value, options) => {
|
|
60235
60499
|
const result = index.program(value, {
|
|
60236
60500
|
...defaults,
|
|
@@ -60258,31 +60522,6 @@ template$1.ast.fresh = (value, options) => {
|
|
|
60258
60522
|
return extractExpression$2(result);
|
|
60259
60523
|
};
|
|
60260
60524
|
|
|
60261
|
-
const mergeShebang = (shebang, source) => {
|
|
60262
|
-
if (!shebang)
|
|
60263
|
-
return source;
|
|
60264
|
-
|
|
60265
|
-
return `${shebang}\n${source}`;
|
|
60266
|
-
};
|
|
60267
|
-
|
|
60268
|
-
const cutShebang = (source) => {
|
|
60269
|
-
if (source.indexOf('#'))
|
|
60270
|
-
return [source, ''];
|
|
60271
|
-
|
|
60272
|
-
const lines = source.split('\n');
|
|
60273
|
-
|
|
60274
|
-
const result = lines
|
|
60275
|
-
.slice(1)
|
|
60276
|
-
.join('\n');
|
|
60277
|
-
|
|
60278
|
-
const [shebang] = lines;
|
|
60279
|
-
|
|
60280
|
-
return [
|
|
60281
|
-
result,
|
|
60282
|
-
`${shebang}\n`,
|
|
60283
|
-
];
|
|
60284
|
-
};
|
|
60285
|
-
|
|
60286
60525
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
60287
60526
|
//
|
|
60288
60527
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
@@ -60519,7 +60758,7 @@ var substr = 'ab'.substr(-1) === 'b' ?
|
|
|
60519
60758
|
const isFn$5 = (a) => typeof a === 'function';
|
|
60520
60759
|
|
|
60521
60760
|
const tryToCatch = async (fn, ...args) => {
|
|
60522
|
-
check$
|
|
60761
|
+
check$9(fn);
|
|
60523
60762
|
|
|
60524
60763
|
try {
|
|
60525
60764
|
return [null, await fn(...args)];
|
|
@@ -60528,7 +60767,7 @@ const tryToCatch = async (fn, ...args) => {
|
|
|
60528
60767
|
}
|
|
60529
60768
|
};
|
|
60530
60769
|
|
|
60531
|
-
function check$
|
|
60770
|
+
function check$9(fn) {
|
|
60532
60771
|
if (!isFn$5(fn))
|
|
60533
60772
|
throw Error('fn should be a function!');
|
|
60534
60773
|
}
|
|
@@ -60646,8 +60885,8 @@ function buildPluginsDirs(name) {
|
|
|
60646
60885
|
}
|
|
60647
60886
|
|
|
60648
60887
|
const isStr$2 = (a) => typeof a === 'string';
|
|
60649
|
-
const {isArray: isArray$
|
|
60650
|
-
const {entries: entries$
|
|
60888
|
+
const {isArray: isArray$c} = Array;
|
|
60889
|
+
const {entries: entries$9} = Object;
|
|
60651
60890
|
|
|
60652
60891
|
const parsePluginNames = (plugins) => {
|
|
60653
60892
|
const result = [];
|
|
@@ -60658,23 +60897,23 @@ const parsePluginNames = (plugins) => {
|
|
|
60658
60897
|
continue;
|
|
60659
60898
|
}
|
|
60660
60899
|
|
|
60661
|
-
if (isArray$
|
|
60900
|
+
if (isArray$c(plugin)) {
|
|
60662
60901
|
const [pluginName, fn] = plugin;
|
|
60663
60902
|
result.push([pluginName, fn]);
|
|
60664
60903
|
continue;
|
|
60665
60904
|
}
|
|
60666
60905
|
|
|
60667
|
-
result.push(...entries$
|
|
60906
|
+
result.push(...entries$9(plugin));
|
|
60668
60907
|
}
|
|
60669
60908
|
|
|
60670
60909
|
return result;
|
|
60671
60910
|
};
|
|
60672
60911
|
|
|
60673
|
-
const {isArray: isArray$
|
|
60912
|
+
const {isArray: isArray$b} = Array;
|
|
60674
60913
|
const isBool$1 = (a) => typeof a === 'boolean';
|
|
60675
60914
|
const isStr$1 = (a) => typeof a === 'string';
|
|
60676
60915
|
const isObj = (a) => typeof a === 'object';
|
|
60677
|
-
const {entries: entries$
|
|
60916
|
+
const {entries: entries$8} = Object;
|
|
60678
60917
|
const {stringify: stringify$6} = JSON;
|
|
60679
60918
|
|
|
60680
60919
|
const notSupportedError = (a) => Error(`☝️ Rule format not supported ${a}: ${typeof a}`);
|
|
@@ -60699,9 +60938,9 @@ const parseRules = (rules) => {
|
|
|
60699
60938
|
const plugin = null;
|
|
60700
60939
|
const msg = '';
|
|
60701
60940
|
|
|
60702
|
-
check$
|
|
60941
|
+
check$8(rules);
|
|
60703
60942
|
|
|
60704
|
-
for (const [rule, value] of entries$
|
|
60943
|
+
for (const [rule, value] of entries$8(rules)) {
|
|
60705
60944
|
if (isStr$1(value)) {
|
|
60706
60945
|
result.push({
|
|
60707
60946
|
rule,
|
|
@@ -60724,7 +60963,7 @@ const parseRules = (rules) => {
|
|
|
60724
60963
|
continue;
|
|
60725
60964
|
}
|
|
60726
60965
|
|
|
60727
|
-
const looksLikeArray = isArray$
|
|
60966
|
+
const looksLikeArray = isArray$b(value);
|
|
60728
60967
|
const looksLikeNormalArray = looksLikeArray && value.length;
|
|
60729
60968
|
|
|
60730
60969
|
if (looksLikeNormalArray) {
|
|
@@ -60786,8 +61025,8 @@ function validateState(rule, value) {
|
|
|
60786
61025
|
});
|
|
60787
61026
|
}
|
|
60788
61027
|
|
|
60789
|
-
function check$
|
|
60790
|
-
if (isArray$
|
|
61028
|
+
function check$8(rules) {
|
|
61029
|
+
if (isArray$b(rules))
|
|
60791
61030
|
throw Error(`☝️Looks like type of 'rules' passed to @putout/engine-loader is 'array', expected: 'object'.`);
|
|
60792
61031
|
}
|
|
60793
61032
|
|
|
@@ -60892,22 +61131,26 @@ const getLoadedRules = (rules) => {
|
|
|
60892
61131
|
return loadedRules;
|
|
60893
61132
|
};
|
|
60894
61133
|
|
|
60895
|
-
const isString$
|
|
61134
|
+
const isString$8 = (a) => typeof a === 'string';
|
|
60896
61135
|
|
|
60897
|
-
const check$
|
|
61136
|
+
const check$7 = (options) => {
|
|
60898
61137
|
if (!options || typeof options !== 'object')
|
|
60899
61138
|
throw Error('options should be an object!');
|
|
60900
61139
|
};
|
|
60901
61140
|
|
|
60902
61141
|
const checkRule = (rule) => {
|
|
60903
|
-
if (!isString$
|
|
61142
|
+
if (!isString$8(rule))
|
|
60904
61143
|
throw Error(`☝️ Looks like plugin name type is not 'string', but: '${typeof rule}'`);
|
|
60905
61144
|
};
|
|
60906
61145
|
|
|
60907
61146
|
const validateRulesRelations = (options) => {
|
|
60908
|
-
check$
|
|
61147
|
+
check$7(options);
|
|
61148
|
+
|
|
61149
|
+
const {
|
|
61150
|
+
pluginNames = [],
|
|
61151
|
+
rules = {},
|
|
61152
|
+
} = options;
|
|
60909
61153
|
|
|
60910
|
-
const {pluginNames = [], rules = {}} = options;
|
|
60911
61154
|
const items = parsePluginNames(pluginNames);
|
|
60912
61155
|
|
|
60913
61156
|
validateRules({
|
|
@@ -60916,13 +61159,13 @@ const validateRulesRelations = (options) => {
|
|
|
60916
61159
|
});
|
|
60917
61160
|
};
|
|
60918
61161
|
|
|
60919
|
-
const {entries: entries$
|
|
61162
|
+
const {entries: entries$7, fromEntries} = Object;
|
|
60920
61163
|
const cut = (a) => a.split('/')[0];
|
|
60921
61164
|
|
|
60922
61165
|
const enableNestedRules = (rules) => {
|
|
60923
61166
|
const newRules = new Map();
|
|
60924
61167
|
|
|
60925
|
-
for (const [rule, value] of entries$
|
|
61168
|
+
for (const [rule, value] of entries$7(rules)) {
|
|
60926
61169
|
if (newRules.has(rule))
|
|
60927
61170
|
continue;
|
|
60928
61171
|
|
|
@@ -60971,8 +61214,8 @@ var validatePlugin = ({plugin, rule}) => {
|
|
|
60971
61214
|
throw Error(`☝️ Cannot determine type of plugin '${rule}'. Here is list of supported plugins: https://git.io/JqcMn`);
|
|
60972
61215
|
};
|
|
60973
61216
|
|
|
60974
|
-
const {isArray: isArray$
|
|
60975
|
-
const maybeTuple = (a) => isArray$
|
|
61217
|
+
const {isArray: isArray$a} = Array;
|
|
61218
|
+
const maybeTuple = (a) => isArray$a(a) ? a : ['on', a];
|
|
60976
61219
|
|
|
60977
61220
|
// Would be great to have ability to filter
|
|
60978
61221
|
// disabled plugins and prevent them from loading
|
|
@@ -61015,9 +61258,13 @@ function isExactRuleEnabled(name, status, rules) {
|
|
|
61015
61258
|
const loadPluginAsync = createAsyncLoader('plugin');
|
|
61016
61259
|
|
|
61017
61260
|
const loadPluginsAsync = async (options) => {
|
|
61018
|
-
check$
|
|
61261
|
+
check$7(options);
|
|
61262
|
+
|
|
61263
|
+
const {
|
|
61264
|
+
pluginNames = [],
|
|
61265
|
+
rules = {},
|
|
61266
|
+
} = options;
|
|
61019
61267
|
|
|
61020
|
-
const {pluginNames = [], rules = {}} = options;
|
|
61021
61268
|
const {
|
|
61022
61269
|
items,
|
|
61023
61270
|
loadedRules,
|
|
@@ -61107,12 +61354,16 @@ function parseRuleName(rule) {
|
|
|
61107
61354
|
return rule;
|
|
61108
61355
|
}
|
|
61109
61356
|
|
|
61110
|
-
const {isArray: isArray$
|
|
61357
|
+
const {isArray: isArray$9} = Array;
|
|
61111
61358
|
|
|
61112
61359
|
const loadPlugins = (options) => {
|
|
61113
|
-
check$
|
|
61360
|
+
check$7(options);
|
|
61361
|
+
|
|
61362
|
+
const {
|
|
61363
|
+
pluginNames = [],
|
|
61364
|
+
rules = {},
|
|
61365
|
+
} = options;
|
|
61114
61366
|
|
|
61115
|
-
const {pluginNames = [], rules = {}} = options;
|
|
61116
61367
|
const {
|
|
61117
61368
|
items,
|
|
61118
61369
|
loadedRules,
|
|
@@ -61139,16 +61390,17 @@ const parseRule = (rule) => rule
|
|
|
61139
61390
|
.replace('import:@putout/plugin-', '')
|
|
61140
61391
|
.replace('@putout/plugin-', '');
|
|
61141
61392
|
|
|
61142
|
-
const maybeFromTuple = (a) => isArray$
|
|
61393
|
+
const maybeFromTuple = (a) => isArray$9(a) ? a[1] : a;
|
|
61143
61394
|
|
|
61144
61395
|
function loadAllPlugins({items, loadedRules}) {
|
|
61145
61396
|
const plugins = [];
|
|
61146
61397
|
|
|
61147
61398
|
for (const [rule, itemPlugin] of items) {
|
|
61399
|
+
checkRule(rule);
|
|
61400
|
+
|
|
61148
61401
|
if (!isEnabled(rule, loadedRules))
|
|
61149
61402
|
continue;
|
|
61150
61403
|
|
|
61151
|
-
checkRule(rule);
|
|
61152
61404
|
const parsedRule = parseRule(rule);
|
|
61153
61405
|
|
|
61154
61406
|
const [name, namespace] = splitRule(rule);
|
|
@@ -61464,21 +61716,12 @@ const isFn$4 = (a) => typeof a === 'function';
|
|
|
61464
61716
|
const getPath$1 = (path) => path.path || path;
|
|
61465
61717
|
const debug$4 = createDebug$1('putout:runner:fix');
|
|
61466
61718
|
|
|
61467
|
-
const chooseFixArgs = ({path, pathOptions, options}) =>
|
|
61468
|
-
|
|
61469
|
-
|
|
61470
|
-
|
|
61471
|
-
|
|
61472
|
-
|
|
61473
|
-
},
|
|
61474
|
-
];
|
|
61475
|
-
|
|
61476
|
-
return [
|
|
61477
|
-
path, {
|
|
61478
|
-
options,
|
|
61479
|
-
},
|
|
61480
|
-
];
|
|
61481
|
-
};
|
|
61719
|
+
const chooseFixArgs = ({path, pathOptions, options}) => [
|
|
61720
|
+
path, {
|
|
61721
|
+
options,
|
|
61722
|
+
...pathOptions,
|
|
61723
|
+
},
|
|
61724
|
+
];
|
|
61482
61725
|
|
|
61483
61726
|
const tryToFix = (fix, {path, pathOptions, position, options}) => {
|
|
61484
61727
|
const [e] = tryCatch(fix, ...chooseFixArgs({
|
|
@@ -61527,7 +61770,7 @@ function validate$1(name, fn) {
|
|
|
61527
61770
|
|
|
61528
61771
|
const getPath = (item) => item.path || item[0] || item;
|
|
61529
61772
|
|
|
61530
|
-
const getPosition = (path
|
|
61773
|
+
const getPosition = (path) => {
|
|
61531
61774
|
const parsedPath = getPath(path);
|
|
61532
61775
|
|
|
61533
61776
|
validatePath(parsedPath);
|
|
@@ -61537,14 +61780,14 @@ const getPosition = (path, shebang) => {
|
|
|
61537
61780
|
|
|
61538
61781
|
if (!loc)
|
|
61539
61782
|
return {
|
|
61540
|
-
line:
|
|
61783
|
+
line: 1,
|
|
61541
61784
|
column: 1,
|
|
61542
61785
|
};
|
|
61543
61786
|
|
|
61544
61787
|
const {line, column} = node.loc.start;
|
|
61545
61788
|
|
|
61546
61789
|
return {
|
|
61547
|
-
line
|
|
61790
|
+
line,
|
|
61548
61791
|
column: column + 1,
|
|
61549
61792
|
};
|
|
61550
61793
|
};
|
|
@@ -61554,8 +61797,8 @@ function validatePath(path) {
|
|
|
61554
61797
|
throw Error(`☝️ Looks like 'push' called without a 'path' argument.`);
|
|
61555
61798
|
}
|
|
61556
61799
|
|
|
61557
|
-
const {isArray: isArray$
|
|
61558
|
-
const maybeArray$3 = (a) => isArray$
|
|
61800
|
+
const {isArray: isArray$8} = Array;
|
|
61801
|
+
const maybeArray$3 = (a) => isArray$8(a) ? a : [a];
|
|
61559
61802
|
|
|
61560
61803
|
var maybeArray$4 = (a) => {
|
|
61561
61804
|
if (!a)
|
|
@@ -61566,15 +61809,23 @@ var maybeArray$4 = (a) => {
|
|
|
61566
61809
|
|
|
61567
61810
|
const isFn$3 = (a) => typeof a === 'function';
|
|
61568
61811
|
const {stringify: stringify$4} = JSON;
|
|
61812
|
+
const {isArray: isArray$7} = Array;
|
|
61569
61813
|
|
|
61570
61814
|
const validate = (name, fn) => {
|
|
61815
|
+
if (name === 'include-items') {
|
|
61816
|
+
if (!isArray$7(fn))
|
|
61817
|
+
throw Error(`☝️ Looks like 'include' does not return an 'array'. More on using Includer: https://git.io/JqcMn`);
|
|
61818
|
+
|
|
61819
|
+
return;
|
|
61820
|
+
}
|
|
61821
|
+
|
|
61571
61822
|
if (!isFn$3(fn))
|
|
61572
61823
|
throw Error(`☝️ Looks like '${name}' is not a 'function' but '${typeof fn}' with value: '${stringify$4(fn)}'. More on using Includer: https://git.io/JqcMn`);
|
|
61573
61824
|
};
|
|
61574
61825
|
|
|
61575
61826
|
const {
|
|
61576
61827
|
values,
|
|
61577
|
-
entries: entries$
|
|
61828
|
+
entries: entries$6,
|
|
61578
61829
|
assign: assign$2,
|
|
61579
61830
|
} = Object;
|
|
61580
61831
|
|
|
@@ -61633,7 +61884,7 @@ function createStore({set, get}) {
|
|
|
61633
61884
|
map = {};
|
|
61634
61885
|
};
|
|
61635
61886
|
|
|
61636
|
-
fn.entries = () => entries$
|
|
61887
|
+
fn.entries = () => entries$6(map);
|
|
61637
61888
|
|
|
61638
61889
|
return fn;
|
|
61639
61890
|
};
|
|
@@ -61678,7 +61929,7 @@ const parse$3 = (name, plugin, options) => {
|
|
|
61678
61929
|
return list;
|
|
61679
61930
|
};
|
|
61680
61931
|
|
|
61681
|
-
var mergeVisitors = (pluginsToMerge, {fix,
|
|
61932
|
+
var mergeVisitors = (pluginsToMerge, {fix, template}) => {
|
|
61682
61933
|
const mergeItems = [];
|
|
61683
61934
|
const pushed = {};
|
|
61684
61935
|
|
|
@@ -61694,7 +61945,6 @@ var mergeVisitors = (pluginsToMerge, {fix, shebang, template}) => {
|
|
|
61694
61945
|
} = getStore(plugin, {
|
|
61695
61946
|
fix,
|
|
61696
61947
|
rule,
|
|
61697
|
-
shebang,
|
|
61698
61948
|
msg,
|
|
61699
61949
|
options,
|
|
61700
61950
|
});
|
|
@@ -61737,7 +61987,7 @@ var mergeVisitors = (pluginsToMerge, {fix, shebang, template}) => {
|
|
|
61737
61987
|
};
|
|
61738
61988
|
};
|
|
61739
61989
|
|
|
61740
|
-
function getStore(plugin, {fix, rule,
|
|
61990
|
+
function getStore(plugin, {fix, rule, msg, options}) {
|
|
61741
61991
|
const store = mapStore();
|
|
61742
61992
|
const list = listStore();
|
|
61743
61993
|
const upstore = upStore();
|
|
@@ -61746,8 +61996,11 @@ function getStore(plugin, {fix, rule, shebang, msg, options}) {
|
|
|
61746
61996
|
const paths = pathStore();
|
|
61747
61997
|
|
|
61748
61998
|
const push = (path, pathOptions) => {
|
|
61749
|
-
const position = getPosition(path
|
|
61750
|
-
const message = msg || plugin.report(path,
|
|
61999
|
+
const position = getPosition(path);
|
|
62000
|
+
const message = msg || plugin.report(path, {
|
|
62001
|
+
options,
|
|
62002
|
+
...pathOptions,
|
|
62003
|
+
});
|
|
61751
62004
|
|
|
61752
62005
|
placesStore({
|
|
61753
62006
|
message,
|
|
@@ -61794,7 +62047,7 @@ function superFind({rule, find, ast, options, template, traverse = traverse3}) {
|
|
|
61794
62047
|
};
|
|
61795
62048
|
|
|
61796
62049
|
const returnItems = find(ast, {
|
|
61797
|
-
traverse: createTraverse$
|
|
62050
|
+
traverse: createTraverse$5({
|
|
61798
62051
|
rule,
|
|
61799
62052
|
options,
|
|
61800
62053
|
template,
|
|
@@ -61812,7 +62065,7 @@ function superFind({rule, find, ast, options, template, traverse = traverse3}) {
|
|
|
61812
62065
|
];
|
|
61813
62066
|
}
|
|
61814
62067
|
|
|
61815
|
-
const createTraverse$
|
|
62068
|
+
const createTraverse$5 = ({rule, options, template, traverse}) => (ast, visitor) => {
|
|
61816
62069
|
const templateVisitors = merge$1(template({
|
|
61817
62070
|
rule,
|
|
61818
62071
|
visitor,
|
|
@@ -61822,7 +62075,7 @@ const createTraverse$4 = ({rule, options, template, traverse}) => (ast, visitor)
|
|
|
61822
62075
|
return traverse(ast, templateVisitors);
|
|
61823
62076
|
};
|
|
61824
62077
|
|
|
61825
|
-
const isString$
|
|
62078
|
+
const isString$7 = (a) => typeof a === 'string';
|
|
61826
62079
|
const isUndefined = (a) => typeof a === 'undefined';
|
|
61827
62080
|
const isEmpty = (obj) => !Object.keys(obj).length;
|
|
61828
62081
|
|
|
@@ -61832,7 +62085,7 @@ function jessy(selector, divider, value) {
|
|
|
61832
62085
|
divider = '.';
|
|
61833
62086
|
}
|
|
61834
62087
|
|
|
61835
|
-
check$
|
|
62088
|
+
check$6(selector, value);
|
|
61836
62089
|
|
|
61837
62090
|
if (!selector)
|
|
61838
62091
|
return value;
|
|
@@ -61865,8 +62118,8 @@ function jessy(selector, divider, value) {
|
|
|
61865
62118
|
return value;
|
|
61866
62119
|
}
|
|
61867
62120
|
|
|
61868
|
-
function check$
|
|
61869
|
-
if (!isString$
|
|
62121
|
+
function check$6(selector, obj) {
|
|
62122
|
+
if (!isString$7(selector))
|
|
61870
62123
|
throw Error('selector should be string!');
|
|
61871
62124
|
|
|
61872
62125
|
if (typeof obj !== 'object')
|
|
@@ -61875,7 +62128,7 @@ function check$7(selector, obj) {
|
|
|
61875
62128
|
|
|
61876
62129
|
const isNumber$1 = (a) => !Number.isNaN(a) && typeof a === 'number';
|
|
61877
62130
|
const isNumberLike = (a, b = Number(a)) => isNumber$1(b);
|
|
61878
|
-
const isString$
|
|
62131
|
+
const isString$6 = (a) => typeof a === 'string';
|
|
61879
62132
|
const notSecure = (a) => /__proto__|prototype/.test(a);
|
|
61880
62133
|
|
|
61881
62134
|
function nessy(selector, value, divider, obj) {
|
|
@@ -61886,7 +62139,7 @@ function nessy(selector, value, divider, obj) {
|
|
|
61886
62139
|
|
|
61887
62140
|
const result = obj;
|
|
61888
62141
|
|
|
61889
|
-
check$
|
|
62142
|
+
check$5(selector);
|
|
61890
62143
|
|
|
61891
62144
|
const array = selector
|
|
61892
62145
|
.split(divider)
|
|
@@ -61911,8 +62164,8 @@ function nessy(selector, value, divider, obj) {
|
|
|
61911
62164
|
|
|
61912
62165
|
return result;
|
|
61913
62166
|
}
|
|
61914
|
-
function check$
|
|
61915
|
-
if (!isString$
|
|
62167
|
+
function check$5(selector) {
|
|
62168
|
+
if (!isString$6(selector))
|
|
61916
62169
|
throw Error('selector should be string!');
|
|
61917
62170
|
}
|
|
61918
62171
|
|
|
@@ -61990,14 +62243,14 @@ const isTemplate = (a) => /[(;={.\s]/.test(a) || !/^[A-Z]/.test(a);
|
|
|
61990
62243
|
|
|
61991
62244
|
const is = (str, array = ALL) => {
|
|
61992
62245
|
for (const item of array) {
|
|
61993
|
-
if (check$
|
|
62246
|
+
if (check$4(str, item))
|
|
61994
62247
|
return true;
|
|
61995
62248
|
}
|
|
61996
62249
|
|
|
61997
62250
|
return false;
|
|
61998
62251
|
};
|
|
61999
62252
|
|
|
62000
|
-
function check$
|
|
62253
|
+
function check$4(str, item) {
|
|
62001
62254
|
if (isStr(item))
|
|
62002
62255
|
return str === item;
|
|
62003
62256
|
|
|
@@ -62298,15 +62551,15 @@ const {
|
|
|
62298
62551
|
|
|
62299
62552
|
const {extractExpression: extractExpression$1} = template$1;
|
|
62300
62553
|
|
|
62301
|
-
const {entries: entries$
|
|
62554
|
+
const {entries: entries$5} = Object;
|
|
62302
62555
|
const isNumber = (a) => typeof a === 'number';
|
|
62303
|
-
const isString$
|
|
62556
|
+
const isString$5 = (a) => typeof a === 'string';
|
|
62304
62557
|
|
|
62305
62558
|
const parseNode$1 = (a) => a.node || a;
|
|
62306
62559
|
const {stringify: stringify$3} = JSON;
|
|
62307
62560
|
|
|
62308
62561
|
const getTemplateValues = (node, str) => {
|
|
62309
|
-
if (!isString$
|
|
62562
|
+
if (!isString$5(str))
|
|
62310
62563
|
throw Error(`☝️ Looks like argument 'template' of 'getTemplateValues(node, template)': is not a string, but '${stringify$3(str)}'`);
|
|
62311
62564
|
|
|
62312
62565
|
node = parseNode$1(node);
|
|
@@ -62383,7 +62636,7 @@ function findVarsWays(node) {
|
|
|
62383
62636
|
function getValues({waysFrom, node}) {
|
|
62384
62637
|
const result = {};
|
|
62385
62638
|
|
|
62386
|
-
for (const [name, ways] of entries$
|
|
62639
|
+
for (const [name, ways] of entries$5(waysFrom)) {
|
|
62387
62640
|
for (let way of ways) {
|
|
62388
62641
|
if (isImportsStr(name))
|
|
62389
62642
|
way = way.replace(/\.0.local$/, '');
|
|
@@ -62410,7 +62663,7 @@ const makeRaw = (a) => a.replace('`', '\\`');
|
|
|
62410
62663
|
function setValues({waysTo, values, path}) {
|
|
62411
62664
|
const node = extractExpression$1(path.node);
|
|
62412
62665
|
|
|
62413
|
-
for (const [name, ways] of entries$
|
|
62666
|
+
for (const [name, ways] of entries$5(waysTo)) {
|
|
62414
62667
|
for (let way of ways) {
|
|
62415
62668
|
if (!way) {
|
|
62416
62669
|
replaceWith(path, values[name]);
|
|
@@ -62903,7 +63156,7 @@ function superCompareIterate(node, template) {
|
|
|
62903
63156
|
|
|
62904
63157
|
const debug$2 = createDebug$1('putout:runner:template');
|
|
62905
63158
|
|
|
62906
|
-
const {entries: entries$
|
|
63159
|
+
const {entries: entries$4} = Object;
|
|
62907
63160
|
const isFn$2 = (a) => typeof a === 'function';
|
|
62908
63161
|
|
|
62909
63162
|
const log$3 = (rule, path) => {
|
|
@@ -62935,7 +63188,7 @@ var template = ({rule, visitor, options}) => {
|
|
|
62935
63188
|
const nodesExclude = maybeArray$4(options.exclude);
|
|
62936
63189
|
const nodesInclude = maybeArray$4(options.include);
|
|
62937
63190
|
|
|
62938
|
-
for (const [tmpl, fn] of entries$
|
|
63191
|
+
for (const [tmpl, fn] of entries$4(visitor)) {
|
|
62939
63192
|
if (!tmpl)
|
|
62940
63193
|
continue;
|
|
62941
63194
|
|
|
@@ -63542,6 +63795,10 @@ const include$1 = ({rule, plugin, msg, options}) => {
|
|
|
63542
63795
|
validate('include', include);
|
|
63543
63796
|
validate('report', report);
|
|
63544
63797
|
|
|
63798
|
+
const includeItems = include();
|
|
63799
|
+
|
|
63800
|
+
validate('include-items', includeItems);
|
|
63801
|
+
|
|
63545
63802
|
const traverse = getTraverse(include(), filter, rule);
|
|
63546
63803
|
|
|
63547
63804
|
return {
|
|
@@ -63586,123 +63843,6 @@ const getTraverse = (include, filter, rule) => ({push, options}) => {
|
|
|
63586
63843
|
return result;
|
|
63587
63844
|
};
|
|
63588
63845
|
|
|
63589
|
-
const wrap = (fn) => (...a) => (...b) => fn(...a, ...b);
|
|
63590
|
-
|
|
63591
|
-
var wraptile = (fn, ...a) => {
|
|
63592
|
-
check$4(fn);
|
|
63593
|
-
|
|
63594
|
-
if (a.length)
|
|
63595
|
-
return wrap(fn)(...a);
|
|
63596
|
-
|
|
63597
|
-
return wrap(fn);
|
|
63598
|
-
};
|
|
63599
|
-
|
|
63600
|
-
function check$4(fn) {
|
|
63601
|
-
if (typeof fn !== 'function')
|
|
63602
|
-
throw Error('fn should be a function!');
|
|
63603
|
-
}
|
|
63604
|
-
|
|
63605
|
-
var wraptile$1 = wraptile;
|
|
63606
|
-
|
|
63607
|
-
const {entries: entries$4} = Object;
|
|
63608
|
-
const {isArray: isArray$3} = Array;
|
|
63609
|
-
|
|
63610
|
-
var findPath = (parentPath) => {
|
|
63611
|
-
let current = {
|
|
63612
|
-
parentPath,
|
|
63613
|
-
};
|
|
63614
|
-
|
|
63615
|
-
const path = [];
|
|
63616
|
-
|
|
63617
|
-
while (current = current.parentPath) {
|
|
63618
|
-
path.unshift(findKey(current, current.parent));
|
|
63619
|
-
}
|
|
63620
|
-
|
|
63621
|
-
return path.join('.');
|
|
63622
|
-
};
|
|
63623
|
-
|
|
63624
|
-
function findKey(path, parent) {
|
|
63625
|
-
const {node} = path;
|
|
63626
|
-
let key;
|
|
63627
|
-
let value;
|
|
63628
|
-
|
|
63629
|
-
for ([key, value] of entries$4(parent)) {
|
|
63630
|
-
if (isArray$3(value)) {
|
|
63631
|
-
const index = value.indexOf(node);
|
|
63632
|
-
|
|
63633
|
-
if (index >= 0)
|
|
63634
|
-
return `${key}.${index}`;
|
|
63635
|
-
|
|
63636
|
-
continue;
|
|
63637
|
-
}
|
|
63638
|
-
|
|
63639
|
-
if (value === node)
|
|
63640
|
-
break;
|
|
63641
|
-
}
|
|
63642
|
-
|
|
63643
|
-
return key;
|
|
63644
|
-
}
|
|
63645
|
-
|
|
63646
|
-
const {isProgram: isProgram$2} = lib_exports;
|
|
63647
|
-
const name = '__putout_runner_replace';
|
|
63648
|
-
const hasWatermark = (watermark) => (path) => path.node?.[name]?.has(watermark);
|
|
63649
|
-
|
|
63650
|
-
const watermark = (from, to, path) => {
|
|
63651
|
-
const {watermark, highWatermark} = create(from, to, path);
|
|
63652
|
-
const program = path.findParent(isProgram$2);
|
|
63653
|
-
const options = {
|
|
63654
|
-
watermark,
|
|
63655
|
-
highWatermark,
|
|
63656
|
-
program,
|
|
63657
|
-
path,
|
|
63658
|
-
};
|
|
63659
|
-
|
|
63660
|
-
return {
|
|
63661
|
-
init: wraptile$1(init, options),
|
|
63662
|
-
has: wraptile$1(has, options),
|
|
63663
|
-
add: wraptile$1(add, options),
|
|
63664
|
-
};
|
|
63665
|
-
};
|
|
63666
|
-
|
|
63667
|
-
const REPLACE_WATERMARK = name;
|
|
63668
|
-
|
|
63669
|
-
function create(from, to, path) {
|
|
63670
|
-
const watermark = `${from} -> ${to}`;
|
|
63671
|
-
const highWatermark = `${findPath(path)}: ${watermark}`;
|
|
63672
|
-
|
|
63673
|
-
return {
|
|
63674
|
-
watermark,
|
|
63675
|
-
highWatermark,
|
|
63676
|
-
};
|
|
63677
|
-
}
|
|
63678
|
-
|
|
63679
|
-
function init({path, program}) {
|
|
63680
|
-
if (path.node)
|
|
63681
|
-
path.node[name] = path.node[name] || new Set();
|
|
63682
|
-
|
|
63683
|
-
program.node[name] = program.node[name] || new Set();
|
|
63684
|
-
}
|
|
63685
|
-
|
|
63686
|
-
function add({path, program, watermark, highWatermark}) {
|
|
63687
|
-
init({
|
|
63688
|
-
path,
|
|
63689
|
-
program,
|
|
63690
|
-
});
|
|
63691
|
-
|
|
63692
|
-
path?.node[name].add(watermark);
|
|
63693
|
-
program.node[name].add(highWatermark);
|
|
63694
|
-
}
|
|
63695
|
-
|
|
63696
|
-
function has({path, program, watermark, highWatermark}) {
|
|
63697
|
-
const {node} = path;
|
|
63698
|
-
const {loc} = node;
|
|
63699
|
-
|
|
63700
|
-
if (node?.[name].has(watermark) || path.findParent(hasWatermark(watermark)) && !loc)
|
|
63701
|
-
return true;
|
|
63702
|
-
|
|
63703
|
-
return program.node[name].has(highWatermark);
|
|
63704
|
-
}
|
|
63705
|
-
|
|
63706
63846
|
const debug$1 = createDebug$1('putout:runner:replace');
|
|
63707
63847
|
|
|
63708
63848
|
const log$1 = (from, path) => {
|
|
@@ -63726,7 +63866,7 @@ const PRINT_OPTIONS = {
|
|
|
63726
63866
|
}],
|
|
63727
63867
|
};
|
|
63728
63868
|
|
|
63729
|
-
const isString$
|
|
63869
|
+
const isString$4 = (a) => typeof a === 'string';
|
|
63730
63870
|
|
|
63731
63871
|
const {keys: keys$1, entries: entries$3} = Object;
|
|
63732
63872
|
const {stringify: stringify$1} = JSON;
|
|
@@ -63775,10 +63915,6 @@ const replace = ({rule, plugin, msg, options}) => {
|
|
|
63775
63915
|
};
|
|
63776
63916
|
};
|
|
63777
63917
|
|
|
63778
|
-
const clearWatermark = (ast) => {
|
|
63779
|
-
delete ast.program[REPLACE_WATERMARK];
|
|
63780
|
-
};
|
|
63781
|
-
|
|
63782
63918
|
const isFn$1 = (a) => typeof a === 'function';
|
|
63783
63919
|
|
|
63784
63920
|
const parseExpression = (nodeFrom, {node}) => {
|
|
@@ -63788,7 +63924,7 @@ const parseExpression = (nodeFrom, {node}) => {
|
|
|
63788
63924
|
return node;
|
|
63789
63925
|
};
|
|
63790
63926
|
|
|
63791
|
-
const fix$
|
|
63927
|
+
const fix$b = (from, to, path) => {
|
|
63792
63928
|
const nodeFrom = template$1.ast(from);
|
|
63793
63929
|
const mark = watermark(from, to, path);
|
|
63794
63930
|
|
|
@@ -63843,7 +63979,7 @@ const getFix = (items, match) => (path) => {
|
|
|
63843
63979
|
const matchFn = match[from];
|
|
63844
63980
|
|
|
63845
63981
|
if (!matchFn || runMatch(path, nodeFrom, matchFn))
|
|
63846
|
-
fix$
|
|
63982
|
+
fix$b(from, to, path);
|
|
63847
63983
|
}
|
|
63848
63984
|
}
|
|
63849
63985
|
};
|
|
@@ -63888,7 +64024,7 @@ function parseTo(to, values, path) {
|
|
|
63888
64024
|
return toStr;
|
|
63889
64025
|
}
|
|
63890
64026
|
|
|
63891
|
-
if (!isString$
|
|
64027
|
+
if (!isString$4(toStr))
|
|
63892
64028
|
throw Error(`☝️ Looks like you passed 'replace' value with a wrong type. Allowed: 'string', 'node' and 'path'. Received: '${typeof toStr}' with value '${toStr}'.`);
|
|
63893
64029
|
|
|
63894
64030
|
return template$1.ast.fresh(toStr);
|
|
@@ -63960,7 +64096,7 @@ const {
|
|
|
63960
64096
|
} = lib_exports;
|
|
63961
64097
|
|
|
63962
64098
|
const {keys} = Object;
|
|
63963
|
-
const isString$
|
|
64099
|
+
const isString$3 = (a) => typeof a === 'string';
|
|
63964
64100
|
|
|
63965
64101
|
const getLastVarPath = (bodyPath) => bodyPath
|
|
63966
64102
|
.filter(isVariableDeclaration)
|
|
@@ -63986,13 +64122,13 @@ const TS_EXCLUDE = [
|
|
|
63986
64122
|
];
|
|
63987
64123
|
|
|
63988
64124
|
const declare$1 = (declarations) => ({
|
|
63989
|
-
report: report$
|
|
64125
|
+
report: report$6,
|
|
63990
64126
|
include,
|
|
63991
|
-
fix: fix$
|
|
64127
|
+
fix: fix$a(declarations),
|
|
63992
64128
|
filter: filter(declarations),
|
|
63993
64129
|
});
|
|
63994
64130
|
|
|
63995
|
-
const report$
|
|
64131
|
+
const report$6 = (path) => {
|
|
63996
64132
|
const {name} = path.node;
|
|
63997
64133
|
const peaceOfName = cutName(name);
|
|
63998
64134
|
|
|
@@ -64032,7 +64168,7 @@ const filter = (declarations) => (path, {options}) => {
|
|
|
64032
64168
|
return parseCode(type, allDeclarations[name]);
|
|
64033
64169
|
};
|
|
64034
64170
|
|
|
64035
|
-
const fix$
|
|
64171
|
+
const fix$a = (declarations) => (path, {options}) => {
|
|
64036
64172
|
const type = getModuleType(path);
|
|
64037
64173
|
|
|
64038
64174
|
const allDeclarations = {
|
|
@@ -64054,7 +64190,7 @@ const fix$9 = (declarations) => (path, {options}) => {
|
|
|
64054
64190
|
};
|
|
64055
64191
|
|
|
64056
64192
|
const parseCode = (type, current) => {
|
|
64057
|
-
if (isString$
|
|
64193
|
+
if (isString$3(current))
|
|
64058
64194
|
return current;
|
|
64059
64195
|
|
|
64060
64196
|
return current[type];
|
|
@@ -64215,7 +64351,7 @@ const {entries: entries$2} = Object;
|
|
|
64215
64351
|
|
|
64216
64352
|
const isPath = (path) => Boolean(path.node);
|
|
64217
64353
|
|
|
64218
|
-
const createTraverse$
|
|
64354
|
+
const createTraverse$4 = (path) => {
|
|
64219
64355
|
if (isPath(path))
|
|
64220
64356
|
return path.traverse.bind(path);
|
|
64221
64357
|
|
|
@@ -64232,7 +64368,7 @@ const createTraverse$3 = (path) => {
|
|
|
64232
64368
|
const getTemplate = ([a]) => a;
|
|
64233
64369
|
|
|
64234
64370
|
function traverse$3(basePath, visitor) {
|
|
64235
|
-
const traverse = createTraverse$
|
|
64371
|
+
const traverse = createTraverse$4(basePath);
|
|
64236
64372
|
const items = [];
|
|
64237
64373
|
const parsedVisitors = entries$2(visitor);
|
|
64238
64374
|
|
|
@@ -64340,11 +64476,11 @@ const {
|
|
|
64340
64476
|
objectExpression: objectExpression$1,
|
|
64341
64477
|
} = lib_exports;
|
|
64342
64478
|
|
|
64343
|
-
const isString$
|
|
64479
|
+
const isString$2 = (a) => typeof a === 'string';
|
|
64344
64480
|
const isSet = (a) => a instanceof Set;
|
|
64345
|
-
const {isArray: isArray$
|
|
64481
|
+
const {isArray: isArray$3} = Array;
|
|
64346
64482
|
|
|
64347
|
-
const maybeArray$1 = (a) => isArray$
|
|
64483
|
+
const maybeArray$1 = (a) => isArray$3(a) ? a : [a];
|
|
64348
64484
|
const maybeArrayFrom = (a) => isSet(a) ? Array.from(a) : maybeArray$1(a);
|
|
64349
64485
|
|
|
64350
64486
|
const escape = (a) => encodeURIComponent(a).replaceAll('%', '+');
|
|
@@ -64413,7 +64549,7 @@ function parseFindFileOptions(options) {
|
|
|
64413
64549
|
excluded: [],
|
|
64414
64550
|
};
|
|
64415
64551
|
|
|
64416
|
-
if (isArray$
|
|
64552
|
+
if (isArray$3(options))
|
|
64417
64553
|
return {
|
|
64418
64554
|
exclude: options,
|
|
64419
64555
|
};
|
|
@@ -64457,7 +64593,7 @@ function findFile(node, name, options) {
|
|
|
64457
64593
|
}
|
|
64458
64594
|
|
|
64459
64595
|
function checkName(name) {
|
|
64460
|
-
if (!isString$
|
|
64596
|
+
if (!isString$2(name) && !isArray$3(name) && !isSet(name))
|
|
64461
64597
|
throw Error(`☝️ Looks like you forget to pass the 'name' of a file to 'findFile(filePath: Path|FilePath, name: string | string[] | Set<string>): FilePath'`);
|
|
64462
64598
|
}
|
|
64463
64599
|
|
|
@@ -64486,7 +64622,7 @@ function getFileContent(filePath) {
|
|
|
64486
64622
|
}
|
|
64487
64623
|
|
|
64488
64624
|
function checkRenameFileName(name) {
|
|
64489
|
-
if (!isString$
|
|
64625
|
+
if (!isString$2(name))
|
|
64490
64626
|
throw Error(`☝️ Looks like you forget to pass the 'name' of a file to 'renameFile(filePath: FilePath, name: string)'`);
|
|
64491
64627
|
}
|
|
64492
64628
|
|
|
@@ -64631,7 +64767,7 @@ const createFile = (dirPath, name, content) => {
|
|
|
64631
64767
|
|
|
64632
64768
|
const filePath = dirPathFiles.get('value.elements').at(-1);
|
|
64633
64769
|
|
|
64634
|
-
if (isString$
|
|
64770
|
+
if (isString$2(content))
|
|
64635
64771
|
writeFileContent(filePath, content);
|
|
64636
64772
|
|
|
64637
64773
|
return filePath;
|
|
@@ -64817,7 +64953,7 @@ const {
|
|
|
64817
64953
|
objectExpression,
|
|
64818
64954
|
arrayExpression: arrayExpression$1,
|
|
64819
64955
|
stringLiteral: stringLiteral$4,
|
|
64820
|
-
isArrayExpression,
|
|
64956
|
+
isArrayExpression: isArrayExpression$1,
|
|
64821
64957
|
isStringLiteral,
|
|
64822
64958
|
isTemplateLiteral,
|
|
64823
64959
|
objectProperty: objectProperty$1,
|
|
@@ -64855,7 +64991,7 @@ function parseContent(node, path) {
|
|
|
64855
64991
|
throw Error(`☝️ Looks like wrong content type: '${node.type}' from file: '${path}'`);
|
|
64856
64992
|
}
|
|
64857
64993
|
|
|
64858
|
-
const fix$
|
|
64994
|
+
const fix$9 = (path) => {
|
|
64859
64995
|
const array = arrayExpression$1([]);
|
|
64860
64996
|
|
|
64861
64997
|
for (const element of path.get('elements')) {
|
|
@@ -64945,7 +65081,7 @@ function buildTree(path, list) {
|
|
|
64945
65081
|
}
|
|
64946
65082
|
|
|
64947
65083
|
const isTwoElementsTuple = (a) => {
|
|
64948
|
-
if (!isArrayExpression(a))
|
|
65084
|
+
if (!isArrayExpression$1(a))
|
|
64949
65085
|
return false;
|
|
64950
65086
|
|
|
64951
65087
|
const {elements} = a.node;
|
|
@@ -64954,7 +65090,7 @@ const isTwoElementsTuple = (a) => {
|
|
|
64954
65090
|
};
|
|
64955
65091
|
|
|
64956
65092
|
const isOneElementTuple = (a) => {
|
|
64957
|
-
if (!isArrayExpression(a))
|
|
65093
|
+
if (!isArrayExpression$1(a))
|
|
64958
65094
|
return false;
|
|
64959
65095
|
|
|
64960
65096
|
const {elements} = a.node;
|
|
@@ -64968,9 +65104,9 @@ function check$3(filename) {
|
|
|
64968
65104
|
}
|
|
64969
65105
|
|
|
64970
65106
|
var fromSimple = /*#__PURE__*/Object.freeze({
|
|
64971
|
-
|
|
64972
|
-
|
|
64973
|
-
|
|
65107
|
+
__proto__: null,
|
|
65108
|
+
fix: fix$9,
|
|
65109
|
+
traverse: traverse$2
|
|
64974
65110
|
});
|
|
64975
65111
|
|
|
64976
65112
|
const {
|
|
@@ -64978,10 +65114,10 @@ const {
|
|
|
64978
65114
|
arrayExpression,
|
|
64979
65115
|
} = lib_exports;
|
|
64980
65116
|
|
|
64981
|
-
const {isArray: isArray$
|
|
65117
|
+
const {isArray: isArray$2} = Array;
|
|
64982
65118
|
const maybeAddSlash = (a) => a === '/' ? a : `${a}/`;
|
|
64983
65119
|
|
|
64984
|
-
const fix$
|
|
65120
|
+
const fix$8 = (root, {files}) => {
|
|
64985
65121
|
const names = [];
|
|
64986
65122
|
|
|
64987
65123
|
for (const file of files) {
|
|
@@ -65006,7 +65142,7 @@ const fix$7 = (root, {files}) => {
|
|
|
65006
65142
|
const list = [];
|
|
65007
65143
|
|
|
65008
65144
|
for (const name of names) {
|
|
65009
|
-
if (isArray$
|
|
65145
|
+
if (isArray$2(name)) {
|
|
65010
65146
|
list.push(arrayExpression([
|
|
65011
65147
|
stringLiteral$3(name[0]),
|
|
65012
65148
|
stringLiteral$3(name[1]),
|
|
@@ -65032,9 +65168,9 @@ const traverse$1 = ({push}) => ({
|
|
|
65032
65168
|
});
|
|
65033
65169
|
|
|
65034
65170
|
var toSimple = /*#__PURE__*/Object.freeze({
|
|
65035
|
-
|
|
65036
|
-
|
|
65037
|
-
|
|
65171
|
+
__proto__: null,
|
|
65172
|
+
fix: fix$8,
|
|
65173
|
+
traverse: traverse$1
|
|
65038
65174
|
});
|
|
65039
65175
|
|
|
65040
65176
|
const log = createDebug$1('putout:runner:scanner');
|
|
@@ -65048,7 +65184,7 @@ const scan$2 = ({rule, plugin, msg, options}, {progress}) => {
|
|
|
65048
65184
|
|
|
65049
65185
|
progress.inc();
|
|
65050
65186
|
|
|
65051
|
-
const traverse = createTraverse$
|
|
65187
|
+
const traverse = createTraverse$3({
|
|
65052
65188
|
scan,
|
|
65053
65189
|
rule,
|
|
65054
65190
|
progress,
|
|
@@ -65105,7 +65241,7 @@ const createTrackFile = ({fileProgress, crawled}) => function*(...a) {
|
|
|
65105
65241
|
}
|
|
65106
65242
|
};
|
|
65107
65243
|
|
|
65108
|
-
const createTraverse$
|
|
65244
|
+
const createTraverse$3 = ({scan, rule, progress}) => ({push, options}) => ({
|
|
65109
65245
|
[`${__filesystem_name}(__)`](path) {
|
|
65110
65246
|
log(rule);
|
|
65111
65247
|
progress.start(rule);
|
|
@@ -65203,7 +65339,7 @@ function parseVisitor(visitors) {
|
|
|
65203
65339
|
const debug = createDebug$1('putout:runner:find');
|
|
65204
65340
|
const isRemoved = (a) => a?.removed;
|
|
65205
65341
|
|
|
65206
|
-
const runPlugins = ({ast,
|
|
65342
|
+
const runPlugins = ({ast, fix, fixCount = 2, plugins, progress = createProgress(), traverse = traverse3}) => {
|
|
65207
65343
|
let places = [];
|
|
65208
65344
|
|
|
65209
65345
|
const merge = onceExports(mergeVisitors);
|
|
@@ -65218,7 +65354,6 @@ const runPlugins = ({ast, shebang, fix, fixCount = 2, plugins, progress = create
|
|
|
65218
65354
|
places = run({
|
|
65219
65355
|
ast,
|
|
65220
65356
|
fix,
|
|
65221
|
-
shebang,
|
|
65222
65357
|
pluginsFind,
|
|
65223
65358
|
pluginsTraverse,
|
|
65224
65359
|
merge,
|
|
@@ -65231,17 +65366,18 @@ const runPlugins = ({ast, shebang, fix, fixCount = 2, plugins, progress = create
|
|
|
65231
65366
|
if (!fix || !places.length)
|
|
65232
65367
|
return places;
|
|
65233
65368
|
|
|
65234
|
-
|
|
65369
|
+
const {program} = ast;
|
|
65370
|
+
|
|
65371
|
+
clearWatermark(program);
|
|
65235
65372
|
}
|
|
65236
65373
|
|
|
65237
65374
|
return places;
|
|
65238
65375
|
};
|
|
65239
65376
|
|
|
65240
|
-
const run = ({ast, fix,
|
|
65377
|
+
const run = ({ast, fix, pluginsFind, pluginsTraverse, template, merge, traverse}) => [
|
|
65241
65378
|
...runWithoutMerge({
|
|
65242
65379
|
ast,
|
|
65243
65380
|
fix,
|
|
65244
|
-
shebang,
|
|
65245
65381
|
template,
|
|
65246
65382
|
pluginsFind,
|
|
65247
65383
|
traverse,
|
|
@@ -65249,7 +65385,6 @@ const run = ({ast, fix, shebang, pluginsFind, pluginsTraverse, template, merge,
|
|
|
65249
65385
|
...runWithMerge({
|
|
65250
65386
|
ast,
|
|
65251
65387
|
fix,
|
|
65252
|
-
shebang,
|
|
65253
65388
|
template,
|
|
65254
65389
|
pluginsTraverse,
|
|
65255
65390
|
merge,
|
|
@@ -65257,10 +65392,9 @@ const run = ({ast, fix, shebang, pluginsFind, pluginsTraverse, template, merge,
|
|
|
65257
65392
|
}),
|
|
65258
65393
|
];
|
|
65259
65394
|
|
|
65260
|
-
function runWithMerge({ast, fix,
|
|
65395
|
+
function runWithMerge({ast, fix, template, pluginsTraverse, merge, traverse}) {
|
|
65261
65396
|
const {entries, visitor} = merge(pluginsTraverse, {
|
|
65262
65397
|
fix,
|
|
65263
|
-
shebang,
|
|
65264
65398
|
template,
|
|
65265
65399
|
});
|
|
65266
65400
|
|
|
@@ -65283,7 +65417,7 @@ function runWithMerge({ast, fix, shebang, template, pluginsTraverse, merge, trav
|
|
|
65283
65417
|
return places;
|
|
65284
65418
|
}
|
|
65285
65419
|
|
|
65286
|
-
function runWithoutMerge({ast, fix,
|
|
65420
|
+
function runWithoutMerge({ast, fix, template, pluginsFind, traverse}) {
|
|
65287
65421
|
const places = [];
|
|
65288
65422
|
|
|
65289
65423
|
for (const {rule, plugin, msg, options} of pluginsFind) {
|
|
@@ -65297,7 +65431,6 @@ function runWithoutMerge({ast, fix, shebang, template, pluginsFind, traverse}) {
|
|
|
65297
65431
|
ast,
|
|
65298
65432
|
options,
|
|
65299
65433
|
fix,
|
|
65300
|
-
shebang,
|
|
65301
65434
|
template,
|
|
65302
65435
|
traverse,
|
|
65303
65436
|
});
|
|
@@ -65308,7 +65441,7 @@ function runWithoutMerge({ast, fix, shebang, template, pluginsFind, traverse}) {
|
|
|
65308
65441
|
for (const item of items) {
|
|
65309
65442
|
const message = msg || report(item);
|
|
65310
65443
|
const {parentPath} = getPath(item);
|
|
65311
|
-
const position = getPosition(item
|
|
65444
|
+
const position = getPosition(item);
|
|
65312
65445
|
|
|
65313
65446
|
places.push({
|
|
65314
65447
|
rule,
|
|
@@ -65425,16 +65558,7 @@ const cutBrackets = (a) => a.replace(/\s\(\d:\d+\)/, '');
|
|
|
65425
65558
|
|
|
65426
65559
|
const maybeParseError = (a) => !a ? [] : parseError$1(a, 'loader');
|
|
65427
65560
|
|
|
65428
|
-
|
|
65429
|
-
// because we need to calculate position in a right way
|
|
65430
|
-
// and determine is shebang is existing
|
|
65431
|
-
//
|
|
65432
|
-
// 25 return {¬
|
|
65433
|
-
// 26 line: shebang ? line + 1 : line,¬
|
|
65434
|
-
// 27 column,¬
|
|
65435
|
-
// 28 };¬
|
|
65436
|
-
//
|
|
65437
|
-
const transform = (ast, source, opts) => {
|
|
65561
|
+
const transform = (ast, opts) => {
|
|
65438
65562
|
opts = defaultOptions(opts);
|
|
65439
65563
|
|
|
65440
65564
|
const {
|
|
@@ -65447,8 +65571,6 @@ const transform = (ast, source, opts) => {
|
|
|
65447
65571
|
progress,
|
|
65448
65572
|
} = opts;
|
|
65449
65573
|
|
|
65450
|
-
const [, shebang] = cutShebang(source);
|
|
65451
|
-
|
|
65452
65574
|
const [validationError] = tryCatch(validateRulesRelations, {
|
|
65453
65575
|
rules,
|
|
65454
65576
|
pluginNames,
|
|
@@ -65461,7 +65583,6 @@ const transform = (ast, source, opts) => {
|
|
|
65461
65583
|
|
|
65462
65584
|
const places = runPlugins({
|
|
65463
65585
|
ast,
|
|
65464
|
-
shebang,
|
|
65465
65586
|
fix,
|
|
65466
65587
|
fixCount,
|
|
65467
65588
|
plugins,
|
|
@@ -65474,7 +65595,7 @@ const transform = (ast, source, opts) => {
|
|
|
65474
65595
|
];
|
|
65475
65596
|
};
|
|
65476
65597
|
|
|
65477
|
-
const transformAsync = async (ast,
|
|
65598
|
+
const transformAsync = async (ast, opts) => {
|
|
65478
65599
|
opts = defaultOptions(opts);
|
|
65479
65600
|
|
|
65480
65601
|
const {
|
|
@@ -65487,8 +65608,6 @@ const transformAsync = async (ast, source, opts) => {
|
|
|
65487
65608
|
progress,
|
|
65488
65609
|
} = opts;
|
|
65489
65610
|
|
|
65490
|
-
const [, shebang] = cutShebang(source);
|
|
65491
|
-
|
|
65492
65611
|
const [validationError] = tryCatch(validateRulesRelations, {
|
|
65493
65612
|
rules,
|
|
65494
65613
|
pluginNames,
|
|
@@ -65501,7 +65620,6 @@ const transformAsync = async (ast, source, opts) => {
|
|
|
65501
65620
|
|
|
65502
65621
|
const places = runPlugins({
|
|
65503
65622
|
ast,
|
|
65504
|
-
shebang,
|
|
65505
65623
|
fix,
|
|
65506
65624
|
fixCount,
|
|
65507
65625
|
plugins,
|
|
@@ -65525,16 +65643,14 @@ const putout = (source, opts) => {
|
|
|
65525
65643
|
printer,
|
|
65526
65644
|
} = opts;
|
|
65527
65645
|
|
|
65528
|
-
const
|
|
65529
|
-
|
|
65530
|
-
const ast = parse$4(clearSource, {
|
|
65646
|
+
const ast = parse$4(source, {
|
|
65531
65647
|
parser,
|
|
65532
65648
|
isTS,
|
|
65533
65649
|
isJSX,
|
|
65534
65650
|
printer,
|
|
65535
65651
|
});
|
|
65536
65652
|
|
|
65537
|
-
const places = transform(ast,
|
|
65653
|
+
const places = transform(ast, opts);
|
|
65538
65654
|
|
|
65539
65655
|
if (!opts.fix)
|
|
65540
65656
|
return {
|
|
@@ -65542,13 +65658,11 @@ const putout = (source, opts) => {
|
|
|
65542
65658
|
places,
|
|
65543
65659
|
};
|
|
65544
65660
|
|
|
65545
|
-
const
|
|
65661
|
+
const code = print(ast, {
|
|
65546
65662
|
printer,
|
|
65547
65663
|
source,
|
|
65548
65664
|
});
|
|
65549
65665
|
|
|
65550
|
-
const code = mergeShebang(shebang, printed);
|
|
65551
|
-
|
|
65552
65666
|
return {
|
|
65553
65667
|
code,
|
|
65554
65668
|
places,
|
|
@@ -65566,16 +65680,14 @@ const putoutAsync = async (source, opts) => {
|
|
|
65566
65680
|
printer,
|
|
65567
65681
|
} = opts;
|
|
65568
65682
|
|
|
65569
|
-
const
|
|
65570
|
-
|
|
65571
|
-
const ast = parse$4(clearSource, {
|
|
65683
|
+
const ast = parse$4(source, {
|
|
65572
65684
|
parser,
|
|
65573
65685
|
isTS,
|
|
65574
65686
|
isJSX,
|
|
65575
65687
|
printer,
|
|
65576
65688
|
});
|
|
65577
65689
|
|
|
65578
|
-
const places = await transformAsync(ast,
|
|
65690
|
+
const places = await transformAsync(ast, opts);
|
|
65579
65691
|
|
|
65580
65692
|
if (!opts.fix)
|
|
65581
65693
|
return {
|
|
@@ -65583,22 +65695,20 @@ const putoutAsync = async (source, opts) => {
|
|
|
65583
65695
|
places,
|
|
65584
65696
|
};
|
|
65585
65697
|
|
|
65586
|
-
const
|
|
65698
|
+
const code = print(ast, {
|
|
65587
65699
|
printer,
|
|
65588
65700
|
});
|
|
65589
65701
|
|
|
65590
|
-
const code = mergeShebang(shebang, printed);
|
|
65591
|
-
|
|
65592
65702
|
return {
|
|
65593
65703
|
code,
|
|
65594
65704
|
places,
|
|
65595
65705
|
};
|
|
65596
65706
|
};
|
|
65597
65707
|
|
|
65598
|
-
const isString = (a) => typeof a === 'string';
|
|
65708
|
+
const isString$1 = (a) => typeof a === 'string';
|
|
65599
65709
|
|
|
65600
65710
|
function check$2(source) {
|
|
65601
|
-
if (!isString(source))
|
|
65711
|
+
if (!isString$1(source))
|
|
65602
65712
|
throw Error(`☝️ Looks like 'source' has type '${typeof source}', expected: 'string'`);
|
|
65603
65713
|
}
|
|
65604
65714
|
|
|
@@ -71616,6 +71726,9 @@ function check$1(regExpTransformer) {
|
|
|
71616
71726
|
throw Error('☝️ Looks like RegExpTransformer is missing');
|
|
71617
71727
|
}
|
|
71618
71728
|
|
|
71729
|
+
const isString = (a) => typeof a === 'string';
|
|
71730
|
+
const {isArray: isArray$1} = Array;
|
|
71731
|
+
|
|
71619
71732
|
const {
|
|
71620
71733
|
isBlockStatement,
|
|
71621
71734
|
isFunction,
|
|
@@ -71636,15 +71749,15 @@ const isCall = (path) => {
|
|
|
71636
71749
|
return isCallExpression(path.find(isCallOrStatement));
|
|
71637
71750
|
};
|
|
71638
71751
|
|
|
71639
|
-
const report$
|
|
71752
|
+
const report$5 = ({name}) => `Argument '${name}' is missing`;
|
|
71640
71753
|
|
|
71641
71754
|
const addArgs = (args) => ({
|
|
71642
|
-
report: report$
|
|
71643
|
-
fix: fix$
|
|
71755
|
+
report: report$5,
|
|
71756
|
+
fix: fix$7,
|
|
71644
71757
|
traverse: traverse(args),
|
|
71645
71758
|
});
|
|
71646
71759
|
|
|
71647
|
-
const fix$
|
|
71760
|
+
const fix$7 = ({declaration, path, pattern, params, index}) => {
|
|
71648
71761
|
const declarationNode = template$1.ast.fresh(declaration);
|
|
71649
71762
|
|
|
71650
71763
|
if (isSequenceExpression(declarationNode)) {
|
|
@@ -71679,7 +71792,9 @@ const traverse = (args) => ({push, options}) => {
|
|
|
71679
71792
|
|
|
71680
71793
|
return {
|
|
71681
71794
|
ReferencedIdentifier(path) {
|
|
71682
|
-
for (const [name,
|
|
71795
|
+
for (const [name, config] of entries$1(allArgs)) {
|
|
71796
|
+
const [declaration, include, exclude] = parseConfig(config);
|
|
71797
|
+
|
|
71683
71798
|
if (path.node.name !== name)
|
|
71684
71799
|
continue;
|
|
71685
71800
|
|
|
@@ -71696,7 +71811,7 @@ const traverse = (args) => ({push, options}) => {
|
|
|
71696
71811
|
|
|
71697
71812
|
const {block} = fnPath.scope;
|
|
71698
71813
|
|
|
71699
|
-
if (!compareAny(path.scope.path,
|
|
71814
|
+
if (!compareAny(path.scope.path, include))
|
|
71700
71815
|
continue;
|
|
71701
71816
|
|
|
71702
71817
|
if (compareAny(path.scope.path, exclude))
|
|
@@ -71756,6 +71871,25 @@ function getObjectPattern(params) {
|
|
|
71756
71871
|
];
|
|
71757
71872
|
}
|
|
71758
71873
|
|
|
71874
|
+
function parseConfig(config) {
|
|
71875
|
+
const [declaration, patternsInclude, patternsExclude] = config;
|
|
71876
|
+
|
|
71877
|
+
if (isArray$1(patternsInclude) || isString(patternsInclude))
|
|
71878
|
+
return [
|
|
71879
|
+
declaration,
|
|
71880
|
+
patternsInclude,
|
|
71881
|
+
patternsExclude,
|
|
71882
|
+
];
|
|
71883
|
+
|
|
71884
|
+
const {include, exclude} = patternsInclude;
|
|
71885
|
+
|
|
71886
|
+
return [
|
|
71887
|
+
declaration,
|
|
71888
|
+
include,
|
|
71889
|
+
exclude,
|
|
71890
|
+
];
|
|
71891
|
+
}
|
|
71892
|
+
|
|
71759
71893
|
const moduleDeclarations = [
|
|
71760
71894
|
'import',
|
|
71761
71895
|
'export',
|
|
@@ -71853,15 +71987,15 @@ const isLegacyKeyword = (name) => {
|
|
|
71853
71987
|
return legacyKeywords.includes(name);
|
|
71854
71988
|
};
|
|
71855
71989
|
|
|
71856
|
-
const findPlaces = (ast,
|
|
71857
|
-
return transform(ast,
|
|
71990
|
+
const findPlaces = (ast, opts) => {
|
|
71991
|
+
return transform(ast, {
|
|
71858
71992
|
...opts,
|
|
71859
71993
|
fix: false,
|
|
71860
71994
|
});
|
|
71861
71995
|
};
|
|
71862
71996
|
|
|
71863
|
-
const findPlacesAsync = async (ast,
|
|
71864
|
-
return await transformAsync(ast,
|
|
71997
|
+
const findPlacesAsync = async (ast, opts) => {
|
|
71998
|
+
return await transformAsync(ast, {
|
|
71865
71999
|
...opts,
|
|
71866
72000
|
fix: false,
|
|
71867
72001
|
});
|
|
@@ -71897,7 +72031,7 @@ const {join} = path;
|
|
|
71897
72031
|
|
|
71898
72032
|
const isObject$1 = (a) => a && typeof a === 'object';
|
|
71899
72033
|
const {entries} = Object;
|
|
71900
|
-
const report$
|
|
72034
|
+
const report$4 = (path, {message}) => message;
|
|
71901
72035
|
|
|
71902
72036
|
const matchFiles = (options) => {
|
|
71903
72037
|
const {filename} = options;
|
|
@@ -71913,14 +72047,14 @@ const matchFiles = (options) => {
|
|
|
71913
72047
|
});
|
|
71914
72048
|
|
|
71915
72049
|
return {
|
|
71916
|
-
fix: fix$
|
|
72050
|
+
fix: fix$6,
|
|
71917
72051
|
scan,
|
|
71918
|
-
report: report$
|
|
72052
|
+
report: report$4,
|
|
71919
72053
|
};
|
|
71920
72054
|
};
|
|
71921
72055
|
|
|
71922
|
-
function fix$
|
|
71923
|
-
transform(matchedAST,
|
|
72056
|
+
function fix$6(inputFile, {dirPath, matchInputFilename, outputFilename, matchedAST, options, rawOptions}) {
|
|
72057
|
+
transform(matchedAST, options);
|
|
71924
72058
|
|
|
71925
72059
|
const matchedJSON = magicPrint(outputFilename, matchedAST, rawOptions);
|
|
71926
72060
|
const outputFile = getOutputFile({
|
|
@@ -71989,7 +72123,7 @@ const createScan$3 = ({files, exclude, defaultFilename}) => (mainPath, {push, pr
|
|
|
71989
72123
|
const [matchedJS, matchedAST] = magicParse(inputFilename, fileContent);
|
|
71990
72124
|
|
|
71991
72125
|
const options = parseOptions(inputFilename, rawOptions);
|
|
71992
|
-
const places = findPlaces(matchedAST,
|
|
72126
|
+
const places = findPlaces(matchedAST, options);
|
|
71993
72127
|
|
|
71994
72128
|
if (!places.length)
|
|
71995
72129
|
continue;
|
|
@@ -72091,9 +72225,9 @@ function parseOptions(inputFilename, rawOptions) {
|
|
|
72091
72225
|
|
|
72092
72226
|
const {parse: parse$2} = JSON;
|
|
72093
72227
|
|
|
72094
|
-
const report$
|
|
72228
|
+
const report$3 = (file, {from, to}) => `Rename '${from}' to '${to}'`;
|
|
72095
72229
|
|
|
72096
|
-
const fix$
|
|
72230
|
+
const fix$5 = (file, {to}) => {
|
|
72097
72231
|
renameFile(file, to);
|
|
72098
72232
|
};
|
|
72099
72233
|
|
|
@@ -72145,22 +72279,22 @@ function findUpPackage(file) {
|
|
|
72145
72279
|
}
|
|
72146
72280
|
|
|
72147
72281
|
var renameFileWithFn = /*#__PURE__*/Object.freeze({
|
|
72148
|
-
|
|
72149
|
-
|
|
72150
|
-
|
|
72151
|
-
|
|
72282
|
+
__proto__: null,
|
|
72283
|
+
createScan: createScan$2,
|
|
72284
|
+
fix: fix$5,
|
|
72285
|
+
report: report$3
|
|
72152
72286
|
});
|
|
72153
72287
|
|
|
72154
72288
|
const returns = (a) => () => a;
|
|
72155
72289
|
|
|
72156
|
-
const report$
|
|
72290
|
+
const report$2 = (path, {mask, from, to}) => {
|
|
72157
72291
|
if (!mask)
|
|
72158
72292
|
return `Rename '${from}' to '${to}'`;
|
|
72159
72293
|
|
|
72160
72294
|
return `Rename '${mask}' to '${mask.replace(from, to)}'`;
|
|
72161
72295
|
};
|
|
72162
72296
|
|
|
72163
|
-
const fix$
|
|
72297
|
+
const fix$4 = (path, {from, to}) => {
|
|
72164
72298
|
const filename = getFilename(path);
|
|
72165
72299
|
const newFilename = filename.replace(from, to);
|
|
72166
72300
|
|
|
@@ -72206,10 +72340,10 @@ const createCheckNear = (near) => (file) => {
|
|
|
72206
72340
|
};
|
|
72207
72341
|
|
|
72208
72342
|
var renameFileByMask = /*#__PURE__*/Object.freeze({
|
|
72209
|
-
|
|
72210
|
-
|
|
72211
|
-
|
|
72212
|
-
|
|
72343
|
+
__proto__: null,
|
|
72344
|
+
createScan: createScan$1,
|
|
72345
|
+
fix: fix$4,
|
|
72346
|
+
report: report$2
|
|
72213
72347
|
});
|
|
72214
72348
|
|
|
72215
72349
|
const renameFiles = ({type, mask, rename, from, to, near} = {}) => {
|
|
@@ -74350,8 +74484,8 @@ const difference$1 = (a, b) => new Set(a).difference(new Set(b));
|
|
|
74350
74484
|
|
|
74351
74485
|
const ignore = ({name, property, list, type = __ignore}) => ({
|
|
74352
74486
|
report: createReport$1(name),
|
|
74353
|
-
fix: fix$
|
|
74354
|
-
traverse: createTraverse$
|
|
74487
|
+
fix: fix$3,
|
|
74488
|
+
traverse: createTraverse$2({
|
|
74355
74489
|
type,
|
|
74356
74490
|
property,
|
|
74357
74491
|
list,
|
|
@@ -74375,12 +74509,12 @@ const createReport$1 = (filename) => ({name, matchedElements}) => {
|
|
|
74375
74509
|
return `Add '${name}'${insteadOf} to '${filename}'`;
|
|
74376
74510
|
};
|
|
74377
74511
|
|
|
74378
|
-
const fix$
|
|
74512
|
+
const fix$3 = ({path, name, matchedElements}) => {
|
|
74379
74513
|
path.node.elements.push(stringLiteral$1(name));
|
|
74380
74514
|
matchedElements.map(remove);
|
|
74381
74515
|
};
|
|
74382
74516
|
|
|
74383
|
-
const createTraverse$
|
|
74517
|
+
const createTraverse$2 = ({type, property, list}) => ({push, options}) => {
|
|
74384
74518
|
const {dismiss = []} = options;
|
|
74385
74519
|
const newNames = filterNames(list, dismiss);
|
|
74386
74520
|
|
|
@@ -74531,15 +74665,18 @@ const findFileUp = (file, name) => {
|
|
|
74531
74665
|
return findFileUp(parentDirectory, name);
|
|
74532
74666
|
};
|
|
74533
74667
|
|
|
74534
|
-
const {
|
|
74668
|
+
const {
|
|
74669
|
+
stringLiteral,
|
|
74670
|
+
isArrayExpression,
|
|
74671
|
+
} = lib_exports;
|
|
74535
74672
|
|
|
74536
74673
|
const sortIgnore = ({name, property, type = __ignore}) => ({
|
|
74537
74674
|
report: createReport({
|
|
74538
74675
|
name,
|
|
74539
74676
|
property,
|
|
74540
74677
|
}),
|
|
74541
|
-
fix: fix$
|
|
74542
|
-
traverse: createTraverse({
|
|
74678
|
+
fix: fix$2,
|
|
74679
|
+
traverse: createTraverse$1({
|
|
74543
74680
|
type,
|
|
74544
74681
|
property,
|
|
74545
74682
|
}),
|
|
@@ -74552,11 +74689,11 @@ const createReport = ({name, property}) => () => {
|
|
|
74552
74689
|
return `Sort '${name}'`;
|
|
74553
74690
|
};
|
|
74554
74691
|
|
|
74555
|
-
const fix$
|
|
74692
|
+
const fix$2 = ({path, sortedElements}) => {
|
|
74556
74693
|
path.node.elements = sortedElements;
|
|
74557
74694
|
};
|
|
74558
74695
|
|
|
74559
|
-
const createTraverse = ({type, property}) => ({push}) => ({
|
|
74696
|
+
const createTraverse$1 = ({type, property}) => ({push}) => ({
|
|
74560
74697
|
[type]: (path) => {
|
|
74561
74698
|
const parentOfElements = parseElements(path, {
|
|
74562
74699
|
property,
|
|
@@ -74600,7 +74737,12 @@ function parseElements(path, {property}) {
|
|
|
74600
74737
|
if (!prop)
|
|
74601
74738
|
return null;
|
|
74602
74739
|
|
|
74603
|
-
|
|
74740
|
+
const arrayPath = prop.get('value');
|
|
74741
|
+
|
|
74742
|
+
if (!isArrayExpression(arrayPath))
|
|
74743
|
+
return null;
|
|
74744
|
+
|
|
74745
|
+
return arrayPath;
|
|
74604
74746
|
}
|
|
74605
74747
|
|
|
74606
74748
|
function cleverSort(elements, {separate}) {
|
|
@@ -74715,15 +74857,15 @@ const difference = (a, b) => new Set(a).difference(new Set(b));
|
|
|
74715
74857
|
const {isArray} = Array;
|
|
74716
74858
|
const maybeArray = (a) => isArray(a) ? a : [a];
|
|
74717
74859
|
|
|
74718
|
-
const report = (file) => `Remove files: '${getFilename(file)}'`;
|
|
74860
|
+
const report$1 = (file) => `Remove files: '${getFilename(file)}'`;
|
|
74719
74861
|
|
|
74720
|
-
const fix = (file) => {
|
|
74862
|
+
const fix$1 = (file) => {
|
|
74721
74863
|
removeFile(file);
|
|
74722
74864
|
};
|
|
74723
74865
|
|
|
74724
74866
|
const removeFiles = (defaultNames) => ({
|
|
74725
|
-
report,
|
|
74726
|
-
fix,
|
|
74867
|
+
report: report$1,
|
|
74868
|
+
fix: fix$1,
|
|
74727
74869
|
scan: createScan(defaultNames),
|
|
74728
74870
|
});
|
|
74729
74871
|
|
|
@@ -74748,112 +74890,144 @@ const createScan = (defaultNames = []) => (path, {push, trackFile, options}) =>
|
|
|
74748
74890
|
}
|
|
74749
74891
|
};
|
|
74750
74892
|
|
|
74893
|
+
const renameProperties = (tuples) => ({
|
|
74894
|
+
report,
|
|
74895
|
+
fix,
|
|
74896
|
+
traverse: createTraverse(tuples),
|
|
74897
|
+
});
|
|
74898
|
+
|
|
74899
|
+
const report = ({from, to}) => `Rename property: '${from}' -> '${to}'`;
|
|
74900
|
+
|
|
74901
|
+
const fix = ({path, to}) => {
|
|
74902
|
+
if (!to) {
|
|
74903
|
+
remove(path);
|
|
74904
|
+
return;
|
|
74905
|
+
}
|
|
74906
|
+
|
|
74907
|
+
setLiteralValue(path.node.key, to);
|
|
74908
|
+
};
|
|
74909
|
+
|
|
74910
|
+
const createTraverse = (tuples) => ({push}) => ({
|
|
74911
|
+
[__json](mainPath) {
|
|
74912
|
+
for (const [from, to] of tuples) {
|
|
74913
|
+
for (const path of traverseProperties(mainPath, from)) {
|
|
74914
|
+
push({
|
|
74915
|
+
path,
|
|
74916
|
+
from,
|
|
74917
|
+
to,
|
|
74918
|
+
});
|
|
74919
|
+
}
|
|
74920
|
+
}
|
|
74921
|
+
},
|
|
74922
|
+
});
|
|
74923
|
+
|
|
74751
74924
|
var operator = /*#__PURE__*/Object.freeze({
|
|
74752
|
-
|
|
74753
|
-
|
|
74754
|
-
|
|
74755
|
-
|
|
74756
|
-
|
|
74757
|
-
|
|
74758
|
-
|
|
74759
|
-
|
|
74760
|
-
|
|
74761
|
-
|
|
74762
|
-
|
|
74763
|
-
|
|
74764
|
-
|
|
74765
|
-
|
|
74766
|
-
|
|
74767
|
-
|
|
74768
|
-
|
|
74769
|
-
|
|
74770
|
-
|
|
74771
|
-
|
|
74772
|
-
|
|
74773
|
-
|
|
74774
|
-
|
|
74775
|
-
|
|
74776
|
-
|
|
74777
|
-
|
|
74778
|
-
|
|
74779
|
-
|
|
74780
|
-
|
|
74781
|
-
|
|
74782
|
-
|
|
74783
|
-
|
|
74784
|
-
|
|
74785
|
-
|
|
74786
|
-
|
|
74787
|
-
|
|
74788
|
-
|
|
74789
|
-
|
|
74790
|
-
|
|
74791
|
-
|
|
74792
|
-
|
|
74793
|
-
|
|
74794
|
-
|
|
74795
|
-
|
|
74796
|
-
|
|
74797
|
-
|
|
74798
|
-
|
|
74799
|
-
|
|
74800
|
-
|
|
74801
|
-
|
|
74802
|
-
|
|
74803
|
-
|
|
74804
|
-
|
|
74805
|
-
|
|
74806
|
-
|
|
74807
|
-
|
|
74808
|
-
|
|
74809
|
-
|
|
74810
|
-
|
|
74811
|
-
|
|
74812
|
-
|
|
74813
|
-
|
|
74814
|
-
|
|
74815
|
-
|
|
74816
|
-
|
|
74817
|
-
|
|
74818
|
-
|
|
74819
|
-
|
|
74820
|
-
|
|
74821
|
-
|
|
74822
|
-
|
|
74823
|
-
|
|
74824
|
-
|
|
74825
|
-
|
|
74826
|
-
|
|
74827
|
-
|
|
74828
|
-
|
|
74829
|
-
|
|
74830
|
-
|
|
74831
|
-
|
|
74832
|
-
|
|
74833
|
-
|
|
74834
|
-
|
|
74835
|
-
|
|
74836
|
-
|
|
74837
|
-
|
|
74838
|
-
|
|
74839
|
-
|
|
74840
|
-
|
|
74841
|
-
|
|
74842
|
-
|
|
74843
|
-
|
|
74844
|
-
|
|
74845
|
-
|
|
74846
|
-
|
|
74847
|
-
|
|
74848
|
-
|
|
74849
|
-
|
|
74850
|
-
|
|
74851
|
-
|
|
74852
|
-
|
|
74853
|
-
|
|
74854
|
-
|
|
74855
|
-
|
|
74856
|
-
|
|
74925
|
+
__proto__: null,
|
|
74926
|
+
__filesystem: __filesystem,
|
|
74927
|
+
__filesystem_name: __filesystem_name,
|
|
74928
|
+
__ignore: __ignore,
|
|
74929
|
+
__ignore_name: __ignore_name,
|
|
74930
|
+
__json: __json,
|
|
74931
|
+
__json_name: __json_name,
|
|
74932
|
+
__toml: __toml,
|
|
74933
|
+
__toml_name: __toml_name,
|
|
74934
|
+
__yaml: __yaml,
|
|
74935
|
+
__yaml_name: __yaml_name,
|
|
74936
|
+
addArgs: addArgs,
|
|
74937
|
+
addAttribute: addAttribute,
|
|
74938
|
+
addAttributeValue: addAttributeValue,
|
|
74939
|
+
addClassName: addClassName,
|
|
74940
|
+
addParens: addParens,
|
|
74941
|
+
compare: compare,
|
|
74942
|
+
compareAll: compareAll,
|
|
74943
|
+
compareAny: compareAny,
|
|
74944
|
+
compute: compute,
|
|
74945
|
+
contains: contains,
|
|
74946
|
+
containsClassName: containsClassName,
|
|
74947
|
+
copyFile: copyFile,
|
|
74948
|
+
crawlDirectory: crawlDirectory,
|
|
74949
|
+
createDirectory: createDirectory,
|
|
74950
|
+
createFile: createFile,
|
|
74951
|
+
createNestedDirectory: createNestedDirectory,
|
|
74952
|
+
declare: declare$1,
|
|
74953
|
+
extract: extract,
|
|
74954
|
+
findBinding: findBinding,
|
|
74955
|
+
findFile: findFile,
|
|
74956
|
+
findFileUp: findFileUp,
|
|
74957
|
+
findVarsWays: findVarsWays,
|
|
74958
|
+
fix: fix$3,
|
|
74959
|
+
fromJS: fromJS,
|
|
74960
|
+
getAttributeNode: getAttributeNode,
|
|
74961
|
+
getAttributePath: getAttributePath,
|
|
74962
|
+
getAttributeValue: getAttributeValue,
|
|
74963
|
+
getBinding: getBinding,
|
|
74964
|
+
getBindingPath: getBindingPath,
|
|
74965
|
+
getClassName: getClassName,
|
|
74966
|
+
getExportDefault: getExportDefault,
|
|
74967
|
+
getFile: getFile,
|
|
74968
|
+
getFileContent: getFileContent,
|
|
74969
|
+
getFileType: getFileType,
|
|
74970
|
+
getFilename: getFilename,
|
|
74971
|
+
getLiteralRaw: getLiteralRaw,
|
|
74972
|
+
getParentDirectory: getParentDirectory,
|
|
74973
|
+
getPathAfterImports: getPathAfterImports,
|
|
74974
|
+
getPathAfterRequires: getPathAfterRequires,
|
|
74975
|
+
getProperties: getProperties,
|
|
74976
|
+
getProperty: getProperty,
|
|
74977
|
+
getRootDirectory: getRootDirectory,
|
|
74978
|
+
getTemplateValues: getTemplateValues,
|
|
74979
|
+
getValues: getValues,
|
|
74980
|
+
hasAttributeValue: hasAttributeValue,
|
|
74981
|
+
hasDataName: hasDataName,
|
|
74982
|
+
hasParens: hasParens,
|
|
74983
|
+
hasTagName: hasTagName,
|
|
74984
|
+
ignore: ignore,
|
|
74985
|
+
insertAfter: insertAfter,
|
|
74986
|
+
insertBefore: insertBefore,
|
|
74987
|
+
isConditionKeyword: isConditionKeyword,
|
|
74988
|
+
isDeclarationKeyword: isDeclarationKeyword,
|
|
74989
|
+
isESM: isESM,
|
|
74990
|
+
isJSON: isJSON,
|
|
74991
|
+
isJSONGroup: isJSONGroup,
|
|
74992
|
+
isKeyword: isKeyword,
|
|
74993
|
+
isLegacyKeyword: isLegacyKeyword,
|
|
74994
|
+
isModuleDeclarationKeyword: isModuleDeclarationKeyword,
|
|
74995
|
+
isModuleExports: isModuleExports,
|
|
74996
|
+
isSimple: isSimple,
|
|
74997
|
+
isSimpleRegExp: isSimpleRegExp,
|
|
74998
|
+
isStatementKeyword: isStatementKeyword,
|
|
74999
|
+
isTOML: isTOML,
|
|
75000
|
+
isTSKeyword: isTSKeyword,
|
|
75001
|
+
isTemplate: isTemplate,
|
|
75002
|
+
matchFiles: matchFiles,
|
|
75003
|
+
moveFile: moveFile,
|
|
75004
|
+
parseTemplate: parseTemplate,
|
|
75005
|
+
readDirectory: readDirectory,
|
|
75006
|
+
readFileContent: readFileContent,
|
|
75007
|
+
remove: remove,
|
|
75008
|
+
removeAttributeValue: removeAttributeValue,
|
|
75009
|
+
removeClassName: removeClassName,
|
|
75010
|
+
removeEmptyDirectory: removeEmptyDirectory,
|
|
75011
|
+
removeFile: removeFile,
|
|
75012
|
+
removeFiles: removeFiles,
|
|
75013
|
+
removeParens: removeParens,
|
|
75014
|
+
rename: rename,
|
|
75015
|
+
renameFile: renameFile,
|
|
75016
|
+
renameFiles: renameFiles,
|
|
75017
|
+
renameProperties: renameProperties,
|
|
75018
|
+
renameProperty: renameProperty,
|
|
75019
|
+
replaceWith: replaceWith,
|
|
75020
|
+
replaceWithMultiple: replaceWithMultiple,
|
|
75021
|
+
setAttributeValue: setAttributeValue,
|
|
75022
|
+
setLiteralValue: setLiteralValue,
|
|
75023
|
+
setValues: setValues,
|
|
75024
|
+
sortIgnore: sortIgnore,
|
|
75025
|
+
toExpression: toExpression,
|
|
75026
|
+
toJS: toJS,
|
|
75027
|
+
transformRegExp: transformRegExp,
|
|
75028
|
+
traverse: traverse$3,
|
|
75029
|
+
traverseProperties: traverseProperties,
|
|
75030
|
+
writeFileContent: writeFileContent
|
|
74857
75031
|
});
|
|
74858
75032
|
|
|
74859
75033
|
const codeframe = ({source, error, highlightCode = true}) => {
|
|
@@ -74873,20 +75047,20 @@ const codeframe = ({source, error, highlightCode = true}) => {
|
|
|
74873
75047
|
};
|
|
74874
75048
|
|
|
74875
75049
|
var exports$1 = /*#__PURE__*/Object.freeze({
|
|
74876
|
-
|
|
74877
|
-
|
|
74878
|
-
|
|
74879
|
-
|
|
74880
|
-
|
|
74881
|
-
|
|
74882
|
-
|
|
74883
|
-
|
|
74884
|
-
|
|
74885
|
-
|
|
74886
|
-
|
|
74887
|
-
|
|
74888
|
-
|
|
74889
|
-
|
|
75050
|
+
__proto__: null,
|
|
75051
|
+
codeframe: codeframe,
|
|
75052
|
+
findPlaces: findPlaces,
|
|
75053
|
+
findPlacesAsync: findPlacesAsync,
|
|
75054
|
+
generate: generate,
|
|
75055
|
+
operator: operator,
|
|
75056
|
+
parse: parse$4,
|
|
75057
|
+
print: print,
|
|
75058
|
+
putoutAsync: putoutAsync,
|
|
75059
|
+
template: template$1,
|
|
75060
|
+
transform: transform,
|
|
75061
|
+
transformAsync: transformAsync,
|
|
75062
|
+
traverse: traverse3,
|
|
75063
|
+
types: lib_exports
|
|
74890
75064
|
});
|
|
74891
75065
|
|
|
74892
75066
|
Object.assign(putout, exports$1);
|