@putout/bundle 5.3.1 → 5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/putout.js +307 -218
- package/bundle/putout.min.js +2 -2
- package/bundle/putout.slim.js +307 -218
- package/package.json +4 -4
package/bundle/putout.slim.js
CHANGED
|
@@ -216,7 +216,7 @@ function write (buffer, value, offset, isLE, mLen, nBytes) {
|
|
|
216
216
|
|
|
217
217
|
var toString = {}.toString;
|
|
218
218
|
|
|
219
|
-
var isArray$
|
|
219
|
+
var isArray$e = Array.isArray || function (arr) {
|
|
220
220
|
return toString.call(arr) == '[object Array]';
|
|
221
221
|
};
|
|
222
222
|
|
|
@@ -500,7 +500,7 @@ function fromObject (that, obj) {
|
|
|
500
500
|
return fromArrayLike(that, obj)
|
|
501
501
|
}
|
|
502
502
|
|
|
503
|
-
if (obj.type === 'Buffer' && isArray$
|
|
503
|
+
if (obj.type === 'Buffer' && isArray$e(obj.data)) {
|
|
504
504
|
return fromArrayLike(that, obj.data)
|
|
505
505
|
}
|
|
506
506
|
}
|
|
@@ -565,7 +565,7 @@ Buffer.isEncoding = function isEncoding (encoding) {
|
|
|
565
565
|
};
|
|
566
566
|
|
|
567
567
|
Buffer.concat = function concat (list, length) {
|
|
568
|
-
if (!isArray$
|
|
568
|
+
if (!isArray$e(list)) {
|
|
569
569
|
throw new TypeError('"list" argument must be an Array of Buffers')
|
|
570
570
|
}
|
|
571
571
|
|
|
@@ -2056,9 +2056,9 @@ __defProp(target, 'default', {
|
|
|
2056
2056
|
enumerable: true,
|
|
2057
2057
|
}) , mod));
|
|
2058
2058
|
|
|
2059
|
-
//
|
|
2059
|
+
// node_modules/jsesc/jsesc.js
|
|
2060
2060
|
var require_jsesc = __commonJS({
|
|
2061
|
-
'
|
|
2061
|
+
'node_modules/jsesc/jsesc.js'(exports$1, module) {
|
|
2062
2062
|
|
|
2063
2063
|
var object = {};
|
|
2064
2064
|
var hasOwnProperty = object.hasOwnProperty;
|
|
@@ -2122,6 +2122,10 @@ var require_jsesc = __commonJS({
|
|
|
2122
2122
|
return typeof value == 'number' || toString.call(value) == '[object Number]';
|
|
2123
2123
|
};
|
|
2124
2124
|
|
|
2125
|
+
var isBigInt = (value) => {
|
|
2126
|
+
return typeof value == 'bigint';
|
|
2127
|
+
};
|
|
2128
|
+
|
|
2125
2129
|
var isFunction5 = (value) => {
|
|
2126
2130
|
return typeof value == 'function';
|
|
2127
2131
|
};
|
|
@@ -2270,32 +2274,41 @@ var require_jsesc = __commonJS({
|
|
|
2270
2274
|
}
|
|
2271
2275
|
|
|
2272
2276
|
return '[' + newLine + result.join(',' + newLine) + newLine + (compact ? '' : oldIndent) + ']';
|
|
2273
|
-
} else if (isNumber2(argument)) {
|
|
2277
|
+
} else if (isNumber2(argument) || isBigInt(argument)) {
|
|
2274
2278
|
if (json) {
|
|
2275
|
-
return JSON.stringify(argument);
|
|
2279
|
+
return JSON.stringify(Number(argument));
|
|
2276
2280
|
}
|
|
2277
2281
|
|
|
2278
|
-
|
|
2279
|
-
return String(argument);
|
|
2280
|
-
}
|
|
2282
|
+
let result2;
|
|
2281
2283
|
|
|
2282
|
-
if (
|
|
2284
|
+
if (useDecNumbers) {
|
|
2285
|
+
result2 = String(argument);
|
|
2286
|
+
} else if (useHexNumbers) {
|
|
2283
2287
|
let hexadecimal2 = argument.toString(16);
|
|
2284
2288
|
|
|
2285
2289
|
if (!lowercaseHex) {
|
|
2286
2290
|
hexadecimal2 = hexadecimal2.toUpperCase();
|
|
2287
2291
|
}
|
|
2288
2292
|
|
|
2289
|
-
|
|
2293
|
+
result2 = '0x' + hexadecimal2;
|
|
2294
|
+
} else if (useBinNumbers) {
|
|
2295
|
+
result2 = '0b' + argument.toString(2);
|
|
2296
|
+
} else if (useOctNumbers) {
|
|
2297
|
+
result2 = '0o' + argument.toString(8);
|
|
2290
2298
|
}
|
|
2299
|
+
|
|
2291
2300
|
|
|
2292
|
-
if (
|
|
2293
|
-
return
|
|
2301
|
+
if (isBigInt(argument)) {
|
|
2302
|
+
return result2 + 'n';
|
|
2294
2303
|
}
|
|
2295
2304
|
|
|
2296
|
-
|
|
2297
|
-
|
|
2305
|
+
return result2;
|
|
2306
|
+
} else if (isBigInt(argument)) {
|
|
2307
|
+
if (json) {
|
|
2308
|
+
return JSON.stringify(Number(argument));
|
|
2298
2309
|
}
|
|
2310
|
+
|
|
2311
|
+
return argument + 'n';
|
|
2299
2312
|
} else if (!isObject(argument)) {
|
|
2300
2313
|
if (json) {
|
|
2301
2314
|
return JSON.stringify(argument) || 'null';
|
|
@@ -2318,6 +2331,7 @@ var require_jsesc = __commonJS({
|
|
|
2318
2331
|
return '{' + newLine + result.join(',' + newLine) + newLine + (compact ? '' : oldIndent) + '}';
|
|
2319
2332
|
}
|
|
2320
2333
|
|
|
2334
|
+
|
|
2321
2335
|
}
|
|
2322
2336
|
|
|
2323
2337
|
const regex = options.escapeEverything ? escapeEverythingRegex : escapeNonAsciiRegex;
|
|
@@ -2404,7 +2418,7 @@ var require_jsesc = __commonJS({
|
|
|
2404
2418
|
},
|
|
2405
2419
|
});
|
|
2406
2420
|
|
|
2407
|
-
//
|
|
2421
|
+
// node_modules/@babel/types/lib/index.js
|
|
2408
2422
|
var lib_exports = {};
|
|
2409
2423
|
|
|
2410
2424
|
__export(lib_exports, {
|
|
@@ -3653,7 +3667,7 @@ __export(lib_exports, {
|
|
|
3653
3667
|
yieldExpression: () => yieldExpression,
|
|
3654
3668
|
});
|
|
3655
3669
|
|
|
3656
|
-
//
|
|
3670
|
+
// node_modules/@babel/helper-validator-identifier/lib/index.js
|
|
3657
3671
|
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';
|
|
3658
3672
|
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';
|
|
3659
3673
|
var nonASCIIidentifierStart = new RegExp('[' + nonASCIIidentifierStartChars + ']');
|
|
@@ -4771,7 +4785,7 @@ function isKeyword$1(word) {
|
|
|
4771
4785
|
return keywords$1.has(word);
|
|
4772
4786
|
}
|
|
4773
4787
|
|
|
4774
|
-
//
|
|
4788
|
+
// node_modules/@babel/helper-string-parser/lib/index.js
|
|
4775
4789
|
var _isDigit = function isDigit(code2) {
|
|
4776
4790
|
return code2 >= 48 && code2 <= 57;
|
|
4777
4791
|
};
|
|
@@ -5072,7 +5086,7 @@ function readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors) {
|
|
|
5072
5086
|
};
|
|
5073
5087
|
}
|
|
5074
5088
|
|
|
5075
|
-
//
|
|
5089
|
+
// node_modules/@babel/types/lib/index.js
|
|
5076
5090
|
function shallowEqual(actual, expected) {
|
|
5077
5091
|
const keys2 = Object.keys(expected);
|
|
5078
5092
|
|
|
@@ -18882,8 +18896,8 @@ function toExpression$1(node) {
|
|
|
18882
18896
|
return node;
|
|
18883
18897
|
}
|
|
18884
18898
|
|
|
18885
|
-
var _skip = Symbol();
|
|
18886
|
-
var _stop = Symbol();
|
|
18899
|
+
var _skip = /* @__PURE__ */Symbol();
|
|
18900
|
+
var _stop = /* @__PURE__ */Symbol();
|
|
18887
18901
|
|
|
18888
18902
|
function traverseFast(node, enter, opts) {
|
|
18889
18903
|
if (!node)
|
|
@@ -19757,7 +19771,7 @@ var react = {
|
|
|
19757
19771
|
buildChildren,
|
|
19758
19772
|
};
|
|
19759
19773
|
|
|
19760
|
-
//
|
|
19774
|
+
// node_modules/@babel/parser/lib/index.js
|
|
19761
19775
|
var Position = class {
|
|
19762
19776
|
line;
|
|
19763
19777
|
column;
|
|
@@ -20210,8 +20224,7 @@ var estree = (superClass) => class ESTreeParserMixin extends superClass {
|
|
|
20210
20224
|
regex = new RegExp(pattern, flags);
|
|
20211
20225
|
} catch {}
|
|
20212
20226
|
|
|
20213
|
-
|
|
20214
|
-
const node = this.estreeParseLiteral(regex);
|
|
20227
|
+
const node = this.estreeParseLiteral(regex);
|
|
20215
20228
|
|
|
20216
20229
|
node.regex = {
|
|
20217
20230
|
pattern,
|
|
@@ -20229,8 +20242,7 @@ var estree = (superClass) => class ESTreeParserMixin extends superClass {
|
|
|
20229
20242
|
bigInt = null;
|
|
20230
20243
|
}
|
|
20231
20244
|
|
|
20232
|
-
|
|
20233
|
-
const node = this.estreeParseLiteral(bigInt);
|
|
20245
|
+
const node = this.estreeParseLiteral(bigInt);
|
|
20234
20246
|
|
|
20235
20247
|
node.bigint = String(node.value || value);
|
|
20236
20248
|
return node;
|
|
@@ -31879,8 +31891,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
31879
31891
|
bigInt = null;
|
|
31880
31892
|
}
|
|
31881
31893
|
|
|
31882
|
-
|
|
31883
|
-
const node = this.parseLiteral(bigInt, 'BigIntLiteral');
|
|
31894
|
+
const node = this.parseLiteral(bigInt, 'BigIntLiteral');
|
|
31884
31895
|
|
|
31885
31896
|
return node;
|
|
31886
31897
|
}
|
|
@@ -32869,8 +32880,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
32869
32880
|
} finally {
|
|
32870
32881
|
revertScopes();
|
|
32871
32882
|
}
|
|
32872
|
-
|
|
32873
|
-
|
|
32883
|
+
|
|
32874
32884
|
return this.finishNode(node, 'ModuleExpression');
|
|
32875
32885
|
}
|
|
32876
32886
|
|
|
@@ -35194,8 +35204,7 @@ function parse$b(input, options) {
|
|
|
35194
35204
|
return getParser$1(options, input).parse();
|
|
35195
35205
|
} catch {}
|
|
35196
35206
|
|
|
35197
|
-
|
|
35198
|
-
throw moduleError;
|
|
35207
|
+
throw moduleError;
|
|
35199
35208
|
}
|
|
35200
35209
|
} else {
|
|
35201
35210
|
return getParser$1(options, input).parse();
|
|
@@ -35266,7 +35275,7 @@ function getParserClass(pluginsMap) {
|
|
|
35266
35275
|
return cls;
|
|
35267
35276
|
}
|
|
35268
35277
|
|
|
35269
|
-
//
|
|
35278
|
+
// node_modules/@babel/code-frame/lib/common-BO7XIBW3.js
|
|
35270
35279
|
var NEWLINE$1 = /\r\n|[\n\r\u2028\u2029]/;
|
|
35271
35280
|
|
|
35272
35281
|
function getMarkerLines(loc, source, opts, startLineBaseZero) {
|
|
@@ -35424,7 +35433,7 @@ ${frame}`;
|
|
|
35424
35433
|
return defs2.reset(frame);
|
|
35425
35434
|
}
|
|
35426
35435
|
|
|
35427
|
-
const {styleText = (a, b) => b} = util;//
|
|
35436
|
+
const {styleText = (a, b) => b} = util;// node_modules/js-tokens/index.js
|
|
35428
35437
|
var HashbangComment;
|
|
35429
35438
|
var Identifier2;
|
|
35430
35439
|
var JSXIdentifier2;
|
|
@@ -35934,7 +35943,7 @@ jsTokens = function*(input, {jsx: jsx2 = false} = {}) {
|
|
|
35934
35943
|
};
|
|
35935
35944
|
var js_tokens_default = jsTokens;
|
|
35936
35945
|
|
|
35937
|
-
//
|
|
35946
|
+
// node_modules/@babel/code-frame/lib/index.js
|
|
35938
35947
|
function isColorSupported() {
|
|
35939
35948
|
return styleText('red', '-') !== '-';
|
|
35940
35949
|
}
|
|
@@ -36113,7 +36122,7 @@ function codeFrameColumns(rawLines, loc, opts = {}) {
|
|
|
36113
36122
|
} : void 0);
|
|
36114
36123
|
}
|
|
36115
36124
|
|
|
36116
|
-
//
|
|
36125
|
+
// node_modules/@babel/template/lib/index.js
|
|
36117
36126
|
var {assertExpressionStatement: assertExpressionStatement2} = lib_exports;
|
|
36118
36127
|
|
|
36119
36128
|
function makeStatementFormatter(fn) {
|
|
@@ -36752,7 +36761,7 @@ var index = Object.assign(smart.bind(void 0), {
|
|
|
36752
36761
|
ast: smart.ast,
|
|
36753
36762
|
});
|
|
36754
36763
|
|
|
36755
|
-
//
|
|
36764
|
+
// node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
|
|
36756
36765
|
var comma = ','.charCodeAt(0);
|
|
36757
36766
|
var semicolon = ';'.charCodeAt(0);
|
|
36758
36767
|
var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
|
@@ -37001,7 +37010,7 @@ function encode(decoded) {
|
|
|
37001
37010
|
return writer.flush();
|
|
37002
37011
|
}
|
|
37003
37012
|
|
|
37004
|
-
//
|
|
37013
|
+
// node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs
|
|
37005
37014
|
var schemeRegex = /^[\w+.-]+:\/\//;
|
|
37006
37015
|
var urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/;
|
|
37007
37016
|
var fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;
|
|
@@ -37221,7 +37230,7 @@ case 2:
|
|
|
37221
37230
|
}
|
|
37222
37231
|
}
|
|
37223
37232
|
|
|
37224
|
-
//
|
|
37233
|
+
// node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs
|
|
37225
37234
|
function stripFilename(path) {
|
|
37226
37235
|
if (!path)
|
|
37227
37236
|
return '';
|
|
@@ -37493,7 +37502,7 @@ function traceSegmentInternal(segments, memo, line, column, bias) {
|
|
|
37493
37502
|
return index3;
|
|
37494
37503
|
}
|
|
37495
37504
|
|
|
37496
|
-
//
|
|
37505
|
+
// node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs
|
|
37497
37506
|
var SetArray = class {
|
|
37498
37507
|
constructor() {
|
|
37499
37508
|
this._indexes = {
|
|
@@ -37762,7 +37771,7 @@ function addMappingInternal(skipable, map, mapping) {
|
|
|
37762
37771
|
return addSegmentInternal(skipable, map, generated.line - 1, generated.column, source, original.line - 1, original.column, name, content);
|
|
37763
37772
|
}
|
|
37764
37773
|
|
|
37765
|
-
//
|
|
37774
|
+
// node_modules/@babel/generator/lib/index.js
|
|
37766
37775
|
var import_jsesc = __toESM(require_jsesc());
|
|
37767
37776
|
|
|
37768
37777
|
var SourceMap = class {
|
|
@@ -43607,7 +43616,7 @@ function generate$1(ast, opts = {}, code2) {
|
|
|
43607
43616
|
return printer.generate(ast);
|
|
43608
43617
|
}
|
|
43609
43618
|
|
|
43610
|
-
//
|
|
43619
|
+
// node_modules/obug/dist/core.js
|
|
43611
43620
|
function selectColor(colors2, namespace) {
|
|
43612
43621
|
let hash = 0;
|
|
43613
43622
|
|
|
@@ -43654,7 +43663,7 @@ function enable(namespaces$1) {
|
|
|
43654
43663
|
names.push(ns);
|
|
43655
43664
|
}
|
|
43656
43665
|
|
|
43657
|
-
//
|
|
43666
|
+
// node_modules/obug/dist/node.js
|
|
43658
43667
|
var colors = [];
|
|
43659
43668
|
|
|
43660
43669
|
var inspectOpts = {};
|
|
@@ -43701,7 +43710,7 @@ function createDebug2(namespace, options) {
|
|
|
43701
43710
|
}
|
|
43702
43711
|
|
|
43703
43712
|
enable(browser$1.env.DEBUG || '');
|
|
43704
|
-
//
|
|
43713
|
+
// node_modules/@babel/helper-globals/data/builtin-lower.json
|
|
43705
43714
|
|
|
43706
43715
|
var builtin_lower_default = [
|
|
43707
43716
|
'decodeURI',
|
|
@@ -43719,7 +43728,7 @@ var builtin_lower_default = [
|
|
|
43719
43728
|
'unescape',
|
|
43720
43729
|
];
|
|
43721
43730
|
|
|
43722
|
-
//
|
|
43731
|
+
// node_modules/@babel/helper-globals/data/builtin-upper.json
|
|
43723
43732
|
var builtin_upper_default = [
|
|
43724
43733
|
'AggregateError',
|
|
43725
43734
|
'Array',
|
|
@@ -43772,7 +43781,7 @@ var builtin_upper_default = [
|
|
|
43772
43781
|
'WeakSet',
|
|
43773
43782
|
];
|
|
43774
43783
|
|
|
43775
|
-
//
|
|
43784
|
+
// node_modules/@babel/traverse/lib/index.js
|
|
43776
43785
|
var ReferencedIdentifier = [
|
|
43777
43786
|
'Identifier',
|
|
43778
43787
|
'JSXIdentifier',
|
|
@@ -44307,7 +44316,7 @@ function verify$1(visitor) {
|
|
|
44307
44316
|
continue;
|
|
44308
44317
|
|
|
44309
44318
|
if (!TYPES2.includes(nodeType)) {
|
|
44310
|
-
throw new Error(`You gave us a visitor for the node type ${nodeType} but it's not a valid type in @babel/traverse ${'8.0.0-rc.
|
|
44319
|
+
throw new Error(`You gave us a visitor for the node type ${nodeType} but it's not a valid type in @babel/traverse ${'8.0.0-rc.2'}`);
|
|
44311
44320
|
}
|
|
44312
44321
|
|
|
44313
44322
|
const visitors2 = visitor[nodeType];
|
|
@@ -47227,8 +47236,7 @@ function replaceWithSourceString(replacement) {
|
|
|
47227
47236
|
throw err;
|
|
47228
47237
|
}
|
|
47229
47238
|
|
|
47230
|
-
|
|
47231
|
-
const expressionAST = ast.program.body[0].expression;
|
|
47239
|
+
const expressionAST = ast.program.body[0].expression;
|
|
47232
47240
|
traverse3.removeProperties(expressionAST);
|
|
47233
47241
|
return this.replaceWith(expressionAST);
|
|
47234
47242
|
}
|
|
@@ -48890,7 +48898,7 @@ function isExecutionUncertainInList(paths, maxIndex) {
|
|
|
48890
48898
|
return false;
|
|
48891
48899
|
}
|
|
48892
48900
|
|
|
48893
|
-
var SYMBOL_CHECKING = Symbol();
|
|
48901
|
+
var SYMBOL_CHECKING = /* @__PURE__ */Symbol();
|
|
48894
48902
|
|
|
48895
48903
|
function _guessExecutionStatusRelativeTo(target) {
|
|
48896
48904
|
return _guessExecutionStatusRelativeToCached(this, target, /* @__PURE__ */new Map());
|
|
@@ -51812,12 +51820,12 @@ const ClassDeclaration = {
|
|
|
51812
51820
|
},
|
|
51813
51821
|
};
|
|
51814
51822
|
|
|
51815
|
-
const {isArray: isArray$
|
|
51823
|
+
const {isArray: isArray$d} = Array;
|
|
51816
51824
|
|
|
51817
51825
|
const parseArgs = (path) => {
|
|
51818
51826
|
const argsPath = path.get('arguments');
|
|
51819
51827
|
|
|
51820
|
-
if (!isArray$
|
|
51828
|
+
if (!isArray$d(argsPath))
|
|
51821
51829
|
return [];
|
|
51822
51830
|
|
|
51823
51831
|
return argsPath;
|
|
@@ -56839,9 +56847,13 @@ const TSDeclareFunction = {
|
|
|
56839
56847
|
|
|
56840
56848
|
printParams(path, printer, semantics);
|
|
56841
56849
|
|
|
56842
|
-
|
|
56843
|
-
|
|
56844
|
-
|
|
56850
|
+
const {returnType} = path.node;
|
|
56851
|
+
|
|
56852
|
+
if (returnType) {
|
|
56853
|
+
print(':');
|
|
56854
|
+
print.space();
|
|
56855
|
+
print('__returnType');
|
|
56856
|
+
}
|
|
56845
56857
|
}),
|
|
56846
56858
|
afterIf: (path) => !isInsideDefaultExport(path),
|
|
56847
56859
|
after: (path, {print}) => {
|
|
@@ -58035,15 +58047,14 @@ const isString$c = (a) => typeof a === 'string';
|
|
|
58035
58047
|
const constant = (a) => () => a;
|
|
58036
58048
|
const {keys: keys$3} = Object;
|
|
58037
58049
|
|
|
58038
|
-
|
|
58050
|
+
const rendy = (template, values, modifiers) => {
|
|
58039
58051
|
check$e(template, values);
|
|
58040
58052
|
|
|
58041
58053
|
let result = template;
|
|
58042
|
-
|
|
58043
|
-
const names = !modifiers ? keys$3(values) : template.match(/{{(.*?)}}/g);
|
|
58054
|
+
const names = keys$3(values) ;
|
|
58044
58055
|
|
|
58045
58056
|
for (const key of names) {
|
|
58046
|
-
const [parsedKey, value] = parseValue$1(key, values
|
|
58057
|
+
const [parsedKey, value] = parseValue$1(key, values);
|
|
58047
58058
|
const str = constant(value);
|
|
58048
58059
|
|
|
58049
58060
|
while (result.includes(parsedKey))
|
|
@@ -58065,34 +58076,12 @@ function check$e(template, values) {
|
|
|
58065
58076
|
}
|
|
58066
58077
|
|
|
58067
58078
|
function parseValue$1(key, values, modifiers) {
|
|
58068
|
-
|
|
58069
|
-
return [
|
|
58079
|
+
return [
|
|
58070
58080
|
`{{ ${key} }}`,
|
|
58071
58081
|
values[key],
|
|
58072
58082
|
];
|
|
58073
|
-
|
|
58074
|
-
const preparedKey = key
|
|
58075
|
-
.replaceAll('{{', '')
|
|
58076
|
-
.replaceAll('}}', '')
|
|
58077
|
-
.replaceAll(' ', '');
|
|
58078
|
-
|
|
58079
|
-
const value = values[preparedKey] || '';
|
|
58080
|
-
|
|
58081
|
-
if (!preparedKey.includes('|'))
|
|
58082
|
-
return [key, value];
|
|
58083
|
-
|
|
58084
|
-
const [name, modifierName] = preparedKey.split('|');
|
|
58085
|
-
const fn = modifiers[modifierName];
|
|
58086
|
-
const currentValue = values[name];
|
|
58087
|
-
|
|
58088
|
-
if (!fn)
|
|
58089
|
-
return [key, currentValue];
|
|
58090
|
-
|
|
58091
|
-
return [key, fn(currentValue)];
|
|
58092
58083
|
}
|
|
58093
58084
|
|
|
58094
|
-
var rendy$1 = rendy.default;
|
|
58095
|
-
|
|
58096
58085
|
var maybeSatisfy = (plugin) => {
|
|
58097
58086
|
if (!plugin.afterSatisfy && !plugin.beforeSatisfy && !plugin.satisfy)
|
|
58098
58087
|
return plugin;
|
|
@@ -58130,7 +58119,7 @@ const maybeThrow = (a, path, b) => {
|
|
|
58130
58119
|
if (!a)
|
|
58131
58120
|
return;
|
|
58132
58121
|
|
|
58133
|
-
throw Error(rendy
|
|
58122
|
+
throw Error(rendy(b, {
|
|
58134
58123
|
path,
|
|
58135
58124
|
type: path.type,
|
|
58136
58125
|
}));
|
|
@@ -58882,12 +58871,12 @@ const print$1 = (ast, options) => {
|
|
|
58882
58871
|
return alignSpaces(code);
|
|
58883
58872
|
};
|
|
58884
58873
|
|
|
58885
|
-
const {isArray: isArray$
|
|
58874
|
+
const {isArray: isArray$c} = Array;
|
|
58886
58875
|
|
|
58887
|
-
const maybeArray$
|
|
58876
|
+
const maybeArray$5 = (a) => isArray$c(a) ? a : [a, {}];
|
|
58888
58877
|
|
|
58889
58878
|
const print = (ast, options = {}) => {
|
|
58890
|
-
const [printer = 'putout', printerOptions] = maybeArray$
|
|
58879
|
+
const [printer = 'putout', printerOptions] = maybeArray$5(options.printer);
|
|
58891
58880
|
|
|
58892
58881
|
if (printer === 'babel')
|
|
58893
58882
|
return print$1(ast, {
|
|
@@ -60449,7 +60438,7 @@ function buildPluginsDirs(name) {
|
|
|
60449
60438
|
}
|
|
60450
60439
|
|
|
60451
60440
|
const isStr$2 = (a) => typeof a === 'string';
|
|
60452
|
-
const {isArray: isArray$
|
|
60441
|
+
const {isArray: isArray$b} = Array;
|
|
60453
60442
|
const {entries: entries$a} = Object;
|
|
60454
60443
|
|
|
60455
60444
|
const parsePluginNames = (plugins) => {
|
|
@@ -60461,7 +60450,7 @@ const parsePluginNames = (plugins) => {
|
|
|
60461
60450
|
continue;
|
|
60462
60451
|
}
|
|
60463
60452
|
|
|
60464
|
-
if (isArray$
|
|
60453
|
+
if (isArray$b(plugin)) {
|
|
60465
60454
|
const [pluginName, fn] = plugin;
|
|
60466
60455
|
result.push([pluginName, fn]);
|
|
60467
60456
|
continue;
|
|
@@ -60473,7 +60462,7 @@ const parsePluginNames = (plugins) => {
|
|
|
60473
60462
|
return result;
|
|
60474
60463
|
};
|
|
60475
60464
|
|
|
60476
|
-
const {isArray: isArray$
|
|
60465
|
+
const {isArray: isArray$a} = Array;
|
|
60477
60466
|
const isBool$1 = (a) => typeof a === 'boolean';
|
|
60478
60467
|
const isStr$1 = (a) => typeof a === 'string';
|
|
60479
60468
|
const isObj = (a) => typeof a === 'object';
|
|
@@ -60527,7 +60516,7 @@ const parseRules = (rules) => {
|
|
|
60527
60516
|
continue;
|
|
60528
60517
|
}
|
|
60529
60518
|
|
|
60530
|
-
const looksLikeArray = isArray$
|
|
60519
|
+
const looksLikeArray = isArray$a(value);
|
|
60531
60520
|
const looksLikeNormalArray = looksLikeArray && value.length;
|
|
60532
60521
|
|
|
60533
60522
|
if (looksLikeNormalArray) {
|
|
@@ -60590,7 +60579,7 @@ function validateState(rule, value) {
|
|
|
60590
60579
|
}
|
|
60591
60580
|
|
|
60592
60581
|
function check$9(rules) {
|
|
60593
|
-
if (isArray$
|
|
60582
|
+
if (isArray$a(rules))
|
|
60594
60583
|
throw Error(`☝️Looks like type of 'rules' passed to @putout/engine-loader is 'array', expected: 'object'.`);
|
|
60595
60584
|
}
|
|
60596
60585
|
|
|
@@ -60774,8 +60763,8 @@ var validatePlugin = ({plugin, rule}) => {
|
|
|
60774
60763
|
throw Error(`☝️ Cannot determine type of plugin '${rule}'. Here is list of supported plugins: https://git.io/JqcMn`);
|
|
60775
60764
|
};
|
|
60776
60765
|
|
|
60777
|
-
const {isArray: isArray$
|
|
60778
|
-
const maybeTuple = (a) => isArray$
|
|
60766
|
+
const {isArray: isArray$9} = Array;
|
|
60767
|
+
const maybeTuple = (a) => isArray$9(a) ? a : ['on', a];
|
|
60779
60768
|
|
|
60780
60769
|
// Would be great to have ability to filter
|
|
60781
60770
|
// disabled plugins and prevent them from loading
|
|
@@ -60910,7 +60899,7 @@ function parseRuleName(rule) {
|
|
|
60910
60899
|
return rule;
|
|
60911
60900
|
}
|
|
60912
60901
|
|
|
60913
|
-
const {isArray: isArray$
|
|
60902
|
+
const {isArray: isArray$8} = Array;
|
|
60914
60903
|
|
|
60915
60904
|
const loadPlugins = (options) => {
|
|
60916
60905
|
check$8(options);
|
|
@@ -60942,7 +60931,7 @@ const parseRule = (rule) => rule
|
|
|
60942
60931
|
.replace('import:@putout/plugin-', '')
|
|
60943
60932
|
.replace('@putout/plugin-', '');
|
|
60944
60933
|
|
|
60945
|
-
const maybeFromTuple = (a) => isArray$
|
|
60934
|
+
const maybeFromTuple = (a) => isArray$8(a) ? a[1] : a;
|
|
60946
60935
|
|
|
60947
60936
|
function loadAllPlugins({items, loadedRules}) {
|
|
60948
60937
|
const plugins = [];
|
|
@@ -61118,14 +61107,14 @@ function validatePath(path) {
|
|
|
61118
61107
|
throw Error(`☝️ Looks like 'push' called without a 'path' argument.`);
|
|
61119
61108
|
}
|
|
61120
61109
|
|
|
61121
|
-
const {isArray: isArray$
|
|
61122
|
-
const maybeArray$
|
|
61110
|
+
const {isArray: isArray$7} = Array;
|
|
61111
|
+
const maybeArray$3 = (a) => isArray$7(a) ? a : [a];
|
|
61123
61112
|
|
|
61124
|
-
var maybeArray$
|
|
61113
|
+
var maybeArray$4 = (a) => {
|
|
61125
61114
|
if (!a)
|
|
61126
61115
|
return [];
|
|
61127
61116
|
|
|
61128
|
-
return maybeArray$
|
|
61117
|
+
return maybeArray$3(a);
|
|
61129
61118
|
};
|
|
61130
61119
|
|
|
61131
61120
|
const isFn$3 = (a) => typeof a === 'function';
|
|
@@ -61233,11 +61222,11 @@ const parse$3 = (name, plugin, options) => {
|
|
|
61233
61222
|
|
|
61234
61223
|
if (plugin[name]) {
|
|
61235
61224
|
validate(name, plugin[name]);
|
|
61236
|
-
list.push(...maybeArray$
|
|
61225
|
+
list.push(...maybeArray$4(plugin[name]()));
|
|
61237
61226
|
}
|
|
61238
61227
|
|
|
61239
61228
|
if (options[name])
|
|
61240
|
-
list.push(...maybeArray$
|
|
61229
|
+
list.push(...maybeArray$4(options[name]));
|
|
61241
61230
|
|
|
61242
61231
|
return list;
|
|
61243
61232
|
};
|
|
@@ -61616,7 +61605,7 @@ const isBool = (a, b) => {
|
|
|
61616
61605
|
};
|
|
61617
61606
|
|
|
61618
61607
|
const isEqualType = (a, b) => a.type === b.type;
|
|
61619
|
-
const {isArray: isArray$
|
|
61608
|
+
const {isArray: isArray$6} = Array;
|
|
61620
61609
|
|
|
61621
61610
|
const isAny = (a) => {
|
|
61622
61611
|
if (isIdentifier$4(a, {name: ANY}))
|
|
@@ -61635,7 +61624,7 @@ const isAnyLiteral = (a, b) => {
|
|
|
61635
61624
|
};
|
|
61636
61625
|
|
|
61637
61626
|
const isArgs = (a) => {
|
|
61638
|
-
const b = !isArray$
|
|
61627
|
+
const b = !isArray$6(a) ? a : a[0];
|
|
61639
61628
|
|
|
61640
61629
|
return isIdentifier$4(b, {
|
|
61641
61630
|
name: ARGS,
|
|
@@ -61665,12 +61654,12 @@ const isEqualTypeParams = (a, b) => {
|
|
|
61665
61654
|
};
|
|
61666
61655
|
|
|
61667
61656
|
const isLinkedArgs = (a) => {
|
|
61668
|
-
const b = !isArray$
|
|
61657
|
+
const b = !isArray$6(a) ? a : a[0];
|
|
61669
61658
|
return isIdentifier$4(b) && LINKED_ARGS.test(b.name);
|
|
61670
61659
|
};
|
|
61671
61660
|
|
|
61672
61661
|
const isJSXChildren = (a) => {
|
|
61673
|
-
const b = !isArray$
|
|
61662
|
+
const b = !isArray$6(a) ? a : a[0];
|
|
61674
61663
|
|
|
61675
61664
|
return isJSXText$2(b, {
|
|
61676
61665
|
value: JSX_CHILDREN,
|
|
@@ -61678,7 +61667,7 @@ const isJSXChildren = (a) => {
|
|
|
61678
61667
|
};
|
|
61679
61668
|
|
|
61680
61669
|
const isJSXAttributes = (a) => {
|
|
61681
|
-
const b = !isArray$
|
|
61670
|
+
const b = !isArray$6(a) ? a : a[0];
|
|
61682
61671
|
|
|
61683
61672
|
if (!isJSXAttribute$1(b))
|
|
61684
61673
|
return false;
|
|
@@ -61715,21 +61704,21 @@ const isObject$4 = (a) => {
|
|
|
61715
61704
|
if (!a)
|
|
61716
61705
|
return false;
|
|
61717
61706
|
|
|
61718
|
-
if (isArray$
|
|
61707
|
+
if (isArray$6(a))
|
|
61719
61708
|
return false;
|
|
61720
61709
|
|
|
61721
61710
|
return typeof a === 'object';
|
|
61722
61711
|
};
|
|
61723
61712
|
|
|
61724
61713
|
const isArrays = (a, b) => {
|
|
61725
|
-
if (!isArray$
|
|
61714
|
+
if (!isArray$6(a) || !isArray$6(b))
|
|
61726
61715
|
return false;
|
|
61727
61716
|
|
|
61728
61717
|
return a.length === b.length;
|
|
61729
61718
|
};
|
|
61730
61719
|
|
|
61731
61720
|
const isImports = (a) => {
|
|
61732
|
-
const b = !isArray$
|
|
61721
|
+
const b = !isArray$6(a) ? a : a[0];
|
|
61733
61722
|
|
|
61734
61723
|
if (!isImportDefaultSpecifier(b))
|
|
61735
61724
|
return false;
|
|
@@ -61740,7 +61729,7 @@ const isImports = (a) => {
|
|
|
61740
61729
|
};
|
|
61741
61730
|
|
|
61742
61731
|
const isExports = (a) => {
|
|
61743
|
-
const b = !isArray$
|
|
61732
|
+
const b = !isArray$6(a) ? a : a[0];
|
|
61744
61733
|
|
|
61745
61734
|
if (isExportSpecifier(b))
|
|
61746
61735
|
return isIdentifier$4(b.local, {
|
|
@@ -62041,7 +62030,7 @@ const createDebug = (namespace) => {
|
|
|
62041
62030
|
|
|
62042
62031
|
const debug$3 = createDebug('putout:compare');
|
|
62043
62032
|
|
|
62044
|
-
const {isArray: isArray$
|
|
62033
|
+
const {isArray: isArray$5} = Array;
|
|
62045
62034
|
const isObject$3 = (a) => a && typeof a === 'object';
|
|
62046
62035
|
|
|
62047
62036
|
var log$4 = (a, b) => {
|
|
@@ -62055,7 +62044,7 @@ var log$4 = (a, b) => {
|
|
|
62055
62044
|
};
|
|
62056
62045
|
|
|
62057
62046
|
function parseValue(a) {
|
|
62058
|
-
if (isArray$
|
|
62047
|
+
if (isArray$5(a) && a[0]) {
|
|
62059
62048
|
const [{
|
|
62060
62049
|
type,
|
|
62061
62050
|
name,
|
|
@@ -62325,13 +62314,13 @@ const {extractExpression} = template$1;
|
|
|
62325
62314
|
const addWaterMark = (a) => a;
|
|
62326
62315
|
|
|
62327
62316
|
const {keys: keys$2} = Object;
|
|
62328
|
-
const {isArray: isArray$
|
|
62317
|
+
const {isArray: isArray$4} = Array;
|
|
62329
62318
|
const noop$1 = () => {};
|
|
62330
|
-
const isEmptyArray = (a) => isArray$
|
|
62319
|
+
const isEmptyArray = (a) => isArray$4(a) && !a.length;
|
|
62331
62320
|
|
|
62332
62321
|
const compareType = (type) => (path) => path.type === type;
|
|
62333
62322
|
const superPush = (array) => (a, b, c = {}) => array.push([a, b, c]);
|
|
62334
|
-
const maybeArray$
|
|
62323
|
+
const maybeArray$2 = (a) => isArray$4(a) ? a : [a];
|
|
62335
62324
|
|
|
62336
62325
|
const findParent = (path, type) => {
|
|
62337
62326
|
const newPathNode = path.findParent(compareType(type));
|
|
@@ -62389,7 +62378,7 @@ function compare(path, template, options = {}, equal = noop$1) {
|
|
|
62389
62378
|
}
|
|
62390
62379
|
|
|
62391
62380
|
const compareAny = (path, templateNodes, options) => {
|
|
62392
|
-
templateNodes = maybeArray$
|
|
62381
|
+
templateNodes = maybeArray$2(templateNodes);
|
|
62393
62382
|
|
|
62394
62383
|
for (const template of templateNodes) {
|
|
62395
62384
|
if (compare(path, template, options))
|
|
@@ -62400,7 +62389,7 @@ const compareAny = (path, templateNodes, options) => {
|
|
|
62400
62389
|
};
|
|
62401
62390
|
|
|
62402
62391
|
const compareAll = (path, templateNodes, options) => {
|
|
62403
|
-
templateNodes = maybeArray$
|
|
62392
|
+
templateNodes = maybeArray$2(templateNodes);
|
|
62404
62393
|
|
|
62405
62394
|
for (const template of templateNodes) {
|
|
62406
62395
|
if (!compare(path, template, options))
|
|
@@ -62496,8 +62485,8 @@ const exclude = ({rule, tmpl, fn, nodesExclude}) => {
|
|
|
62496
62485
|
|
|
62497
62486
|
var template = ({rule, visitor, options}) => {
|
|
62498
62487
|
const parsed = [];
|
|
62499
|
-
const nodesExclude = maybeArray$
|
|
62500
|
-
const nodesInclude = maybeArray$
|
|
62488
|
+
const nodesExclude = maybeArray$4(options.exclude);
|
|
62489
|
+
const nodesInclude = maybeArray$4(options.include);
|
|
62501
62490
|
|
|
62502
62491
|
for (const [tmpl, fn] of entries$5(visitor)) {
|
|
62503
62492
|
if (!tmpl)
|
|
@@ -63115,7 +63104,7 @@ const include$1 = ({rule, plugin, msg, options}) => {
|
|
|
63115
63104
|
...options,
|
|
63116
63105
|
exclude: [
|
|
63117
63106
|
...exclude(),
|
|
63118
|
-
...maybeArray$
|
|
63107
|
+
...maybeArray$4(options.exclude),
|
|
63119
63108
|
],
|
|
63120
63109
|
},
|
|
63121
63110
|
plugin: {
|
|
@@ -63169,7 +63158,7 @@ function check$4(fn) {
|
|
|
63169
63158
|
var wraptile$1 = wraptile;
|
|
63170
63159
|
|
|
63171
63160
|
const {entries: entries$4} = Object;
|
|
63172
|
-
const {isArray: isArray$
|
|
63161
|
+
const {isArray: isArray$3} = Array;
|
|
63173
63162
|
|
|
63174
63163
|
var findPath = (parentPath) => {
|
|
63175
63164
|
let current = {
|
|
@@ -63191,7 +63180,7 @@ function findKey(path, parent) {
|
|
|
63191
63180
|
let value;
|
|
63192
63181
|
|
|
63193
63182
|
for ([key, value] of entries$4(parent)) {
|
|
63194
|
-
if (isArray$
|
|
63183
|
+
if (isArray$3(value)) {
|
|
63195
63184
|
const index = value.indexOf(node);
|
|
63196
63185
|
|
|
63197
63186
|
if (index >= 0)
|
|
@@ -63327,7 +63316,7 @@ const replace = ({rule, plugin, msg, options}) => {
|
|
|
63327
63316
|
...options,
|
|
63328
63317
|
exclude: [
|
|
63329
63318
|
...exclude(),
|
|
63330
|
-
...maybeArray$
|
|
63319
|
+
...maybeArray$4(options.exclude),
|
|
63331
63320
|
],
|
|
63332
63321
|
},
|
|
63333
63322
|
plugin: {
|
|
@@ -63352,7 +63341,7 @@ const parseExpression = (nodeFrom, {node}) => {
|
|
|
63352
63341
|
return node;
|
|
63353
63342
|
};
|
|
63354
63343
|
|
|
63355
|
-
const fix$
|
|
63344
|
+
const fix$a = (from, to, path) => {
|
|
63356
63345
|
const nodeFrom = template$1.ast(from);
|
|
63357
63346
|
const mark = watermark(from, to, path);
|
|
63358
63347
|
|
|
@@ -63407,7 +63396,7 @@ const getFix = (items, match) => (path) => {
|
|
|
63407
63396
|
const matchFn = match[from];
|
|
63408
63397
|
|
|
63409
63398
|
if (!matchFn || runMatch(path, nodeFrom, matchFn))
|
|
63410
|
-
fix$
|
|
63399
|
+
fix$a(from, to, path);
|
|
63411
63400
|
}
|
|
63412
63401
|
}
|
|
63413
63402
|
};
|
|
@@ -63550,13 +63539,13 @@ const TS_EXCLUDE = [
|
|
|
63550
63539
|
];
|
|
63551
63540
|
|
|
63552
63541
|
const declare$1 = (declarations) => ({
|
|
63553
|
-
report: report$
|
|
63542
|
+
report: report$5,
|
|
63554
63543
|
include,
|
|
63555
|
-
fix: fix$
|
|
63544
|
+
fix: fix$9(declarations),
|
|
63556
63545
|
filter: filter(declarations),
|
|
63557
63546
|
});
|
|
63558
63547
|
|
|
63559
|
-
const report$
|
|
63548
|
+
const report$5 = (path) => {
|
|
63560
63549
|
const {name} = path.node;
|
|
63561
63550
|
const peaceOfName = cutName(name);
|
|
63562
63551
|
|
|
@@ -63596,7 +63585,7 @@ const filter = (declarations) => (path, {options}) => {
|
|
|
63596
63585
|
return parseCode(type, allDeclarations[name]);
|
|
63597
63586
|
};
|
|
63598
63587
|
|
|
63599
|
-
const fix$
|
|
63588
|
+
const fix$9 = (declarations) => (path, {options}) => {
|
|
63600
63589
|
const type = getModuleType(path);
|
|
63601
63590
|
|
|
63602
63591
|
const allDeclarations = {
|
|
@@ -63905,8 +63894,11 @@ const {
|
|
|
63905
63894
|
} = lib_exports;
|
|
63906
63895
|
|
|
63907
63896
|
const isString$1 = (a) => typeof a === 'string';
|
|
63908
|
-
const
|
|
63909
|
-
const
|
|
63897
|
+
const isSet = (a) => a instanceof Set;
|
|
63898
|
+
const {isArray: isArray$2} = Array;
|
|
63899
|
+
|
|
63900
|
+
const maybeArray$1 = (a) => isArray$2(a) ? a : [a];
|
|
63901
|
+
const maybeArrayFrom = (a) => isSet(a) ? Array.from(a) : maybeArray$1(a);
|
|
63910
63902
|
|
|
63911
63903
|
const escape = (a) => encodeURIComponent(a).replaceAll('%', '+');
|
|
63912
63904
|
const unescape = (a) => decodeURIComponent(a.replaceAll('+', '%'));
|
|
@@ -63974,7 +63966,7 @@ function parseFindFileOptions(options) {
|
|
|
63974
63966
|
excluded: [],
|
|
63975
63967
|
};
|
|
63976
63968
|
|
|
63977
|
-
if (isArray$
|
|
63969
|
+
if (isArray$2(options))
|
|
63978
63970
|
return {
|
|
63979
63971
|
exclude: options,
|
|
63980
63972
|
};
|
|
@@ -63990,8 +63982,8 @@ function findFile(node, name, options) {
|
|
|
63990
63982
|
|
|
63991
63983
|
checkName(name);
|
|
63992
63984
|
|
|
63993
|
-
const filePaths =
|
|
63994
|
-
const names =
|
|
63985
|
+
const filePaths = new Set();
|
|
63986
|
+
const names = maybeArrayFrom(name);
|
|
63995
63987
|
|
|
63996
63988
|
for (const filenamePath of crawled) {
|
|
63997
63989
|
const {value} = filenamePath.node.value;
|
|
@@ -64009,17 +64001,17 @@ function findFile(node, name, options) {
|
|
|
64009
64001
|
if (excluded)
|
|
64010
64002
|
continue;
|
|
64011
64003
|
|
|
64012
|
-
filePaths.
|
|
64004
|
+
filePaths.add(path);
|
|
64013
64005
|
}
|
|
64014
64006
|
}
|
|
64015
64007
|
}
|
|
64016
64008
|
|
|
64017
|
-
return filePaths;
|
|
64009
|
+
return Array.from(filePaths);
|
|
64018
64010
|
}
|
|
64019
64011
|
|
|
64020
64012
|
function checkName(name) {
|
|
64021
|
-
if (!isString$1(name) && !isArray$
|
|
64022
|
-
throw Error(`☝️ Looks like you forget to pass the 'name' of a file to 'findFile(filePath: Path|FilePath, name: string | string[]): FilePath'`);
|
|
64013
|
+
if (!isString$1(name) && !isArray$2(name) && !isSet(name))
|
|
64014
|
+
throw Error(`☝️ Looks like you forget to pass the 'name' of a file to 'findFile(filePath: Path|FilePath, name: string | string[] | Set<string>): FilePath'`);
|
|
64023
64015
|
}
|
|
64024
64016
|
|
|
64025
64017
|
function getFilenamePath(filePath) {
|
|
@@ -64346,7 +64338,7 @@ function getRootDirectory(path) {
|
|
|
64346
64338
|
}
|
|
64347
64339
|
|
|
64348
64340
|
function getFile(directoryPath, name, {type} = {}) {
|
|
64349
|
-
const names = maybeArray(name);
|
|
64341
|
+
const names = maybeArray$1(name);
|
|
64350
64342
|
const files = new Map();
|
|
64351
64343
|
let count = 0;
|
|
64352
64344
|
|
|
@@ -64416,7 +64408,7 @@ function parseContent(node, path) {
|
|
|
64416
64408
|
throw Error(`☝️ Looks like wrong content type: '${node.type}' from file: '${path}'`);
|
|
64417
64409
|
}
|
|
64418
64410
|
|
|
64419
|
-
const fix$
|
|
64411
|
+
const fix$8 = (path) => {
|
|
64420
64412
|
const array = arrayExpression$1([]);
|
|
64421
64413
|
|
|
64422
64414
|
for (const element of path.get('elements')) {
|
|
@@ -64530,7 +64522,7 @@ function check$3(filename) {
|
|
|
64530
64522
|
|
|
64531
64523
|
var fromSimple = /*#__PURE__*/Object.freeze({
|
|
64532
64524
|
__proto__: null,
|
|
64533
|
-
fix: fix$
|
|
64525
|
+
fix: fix$8,
|
|
64534
64526
|
traverse: traverse$2
|
|
64535
64527
|
});
|
|
64536
64528
|
|
|
@@ -64539,10 +64531,10 @@ const {
|
|
|
64539
64531
|
arrayExpression,
|
|
64540
64532
|
} = lib_exports;
|
|
64541
64533
|
|
|
64542
|
-
const {isArray} = Array;
|
|
64534
|
+
const {isArray: isArray$1} = Array;
|
|
64543
64535
|
const maybeAddSlash = (a) => a === '/' ? a : `${a}/`;
|
|
64544
64536
|
|
|
64545
|
-
const fix$
|
|
64537
|
+
const fix$7 = (root, {files}) => {
|
|
64546
64538
|
const names = [];
|
|
64547
64539
|
|
|
64548
64540
|
for (const file of files) {
|
|
@@ -64567,7 +64559,7 @@ const fix$6 = (root, {files}) => {
|
|
|
64567
64559
|
const list = [];
|
|
64568
64560
|
|
|
64569
64561
|
for (const name of names) {
|
|
64570
|
-
if (isArray(name)) {
|
|
64562
|
+
if (isArray$1(name)) {
|
|
64571
64563
|
list.push(arrayExpression([
|
|
64572
64564
|
stringLiteral$3(name[0]),
|
|
64573
64565
|
stringLiteral$3(name[1]),
|
|
@@ -64594,7 +64586,7 @@ const traverse$1 = ({push}) => ({
|
|
|
64594
64586
|
|
|
64595
64587
|
var toSimple = /*#__PURE__*/Object.freeze({
|
|
64596
64588
|
__proto__: null,
|
|
64597
|
-
fix: fix$
|
|
64589
|
+
fix: fix$7,
|
|
64598
64590
|
traverse: traverse$1
|
|
64599
64591
|
});
|
|
64600
64592
|
|
|
@@ -71197,15 +71189,15 @@ const isCall = (path) => {
|
|
|
71197
71189
|
return isCallExpression(path.find(isCallOrStatement));
|
|
71198
71190
|
};
|
|
71199
71191
|
|
|
71200
|
-
const report$
|
|
71192
|
+
const report$4 = ({name}) => `Argument '${name}' is missing`;
|
|
71201
71193
|
|
|
71202
71194
|
const addArgs = (args) => ({
|
|
71203
|
-
report: report$
|
|
71204
|
-
fix: fix$
|
|
71195
|
+
report: report$4,
|
|
71196
|
+
fix: fix$6,
|
|
71205
71197
|
traverse: traverse(args),
|
|
71206
71198
|
});
|
|
71207
71199
|
|
|
71208
|
-
const fix$
|
|
71200
|
+
const fix$6 = ({declaration, path, pattern, params, index}) => {
|
|
71209
71201
|
const declarationNode = template$1.ast.fresh(declaration);
|
|
71210
71202
|
|
|
71211
71203
|
if (isSequenceExpression(declarationNode)) {
|
|
@@ -71458,7 +71450,7 @@ const {join} = path;
|
|
|
71458
71450
|
|
|
71459
71451
|
const isObject$1 = (a) => a && typeof a === 'object';
|
|
71460
71452
|
const {entries} = Object;
|
|
71461
|
-
const report$
|
|
71453
|
+
const report$3 = (path, {message}) => message;
|
|
71462
71454
|
|
|
71463
71455
|
const matchFiles = (options) => {
|
|
71464
71456
|
const {filename} = options;
|
|
@@ -71467,20 +71459,20 @@ const matchFiles = (options) => {
|
|
|
71467
71459
|
|
|
71468
71460
|
check(files);
|
|
71469
71461
|
|
|
71470
|
-
const scan = createScan$
|
|
71462
|
+
const scan = createScan$3({
|
|
71471
71463
|
defaultFilename: filename,
|
|
71472
71464
|
files,
|
|
71473
71465
|
exclude,
|
|
71474
71466
|
});
|
|
71475
71467
|
|
|
71476
71468
|
return {
|
|
71477
|
-
fix: fix$
|
|
71469
|
+
fix: fix$5,
|
|
71478
71470
|
scan,
|
|
71479
|
-
report: report$
|
|
71471
|
+
report: report$3,
|
|
71480
71472
|
};
|
|
71481
71473
|
};
|
|
71482
71474
|
|
|
71483
|
-
function fix$
|
|
71475
|
+
function fix$5(inputFile, {dirPath, matchInputFilename, outputFilename, matchedJS, matchedAST, options, rawOptions}) {
|
|
71484
71476
|
transform(matchedAST, matchedJS, options);
|
|
71485
71477
|
|
|
71486
71478
|
const matchedJSON = magicPrint(outputFilename, matchedAST, rawOptions);
|
|
@@ -71497,7 +71489,7 @@ function fix$4(inputFile, {dirPath, matchInputFilename, outputFilename, matchedJ
|
|
|
71497
71489
|
removeFile(inputFile);
|
|
71498
71490
|
}
|
|
71499
71491
|
|
|
71500
|
-
const createScan$
|
|
71492
|
+
const createScan$3 = ({files, exclude, defaultFilename}) => (mainPath, {push, progress, options}) => {
|
|
71501
71493
|
const allFiles = [];
|
|
71502
71494
|
const cwd = getFilename(mainPath);
|
|
71503
71495
|
|
|
@@ -71652,13 +71644,13 @@ function parseOptions(inputFilename, rawOptions) {
|
|
|
71652
71644
|
|
|
71653
71645
|
const {parse: parse$2} = JSON;
|
|
71654
71646
|
|
|
71655
|
-
const report$
|
|
71647
|
+
const report$2 = (file, {from, to}) => `Rename '${from}' to '${to}'`;
|
|
71656
71648
|
|
|
71657
|
-
const fix$
|
|
71649
|
+
const fix$4 = (file, {to}) => {
|
|
71658
71650
|
renameFile(file, to);
|
|
71659
71651
|
};
|
|
71660
71652
|
|
|
71661
|
-
const createScan$
|
|
71653
|
+
const createScan$2 = ({type, mask, rename} = {}) => (path, {push, trackFile}) => {
|
|
71662
71654
|
for (const file of trackFile(path, mask)) {
|
|
71663
71655
|
if (type && !checkType(type, file))
|
|
71664
71656
|
continue;
|
|
@@ -71707,28 +71699,28 @@ function findUpPackage(file) {
|
|
|
71707
71699
|
|
|
71708
71700
|
var renameFileWithFn = /*#__PURE__*/Object.freeze({
|
|
71709
71701
|
__proto__: null,
|
|
71710
|
-
createScan: createScan$
|
|
71711
|
-
fix: fix$
|
|
71712
|
-
report: report$
|
|
71702
|
+
createScan: createScan$2,
|
|
71703
|
+
fix: fix$4,
|
|
71704
|
+
report: report$2
|
|
71713
71705
|
});
|
|
71714
71706
|
|
|
71715
71707
|
const returns = (a) => () => a;
|
|
71716
71708
|
|
|
71717
|
-
const report = (path, {mask, from, to}) => {
|
|
71709
|
+
const report$1 = (path, {mask, from, to}) => {
|
|
71718
71710
|
if (!mask)
|
|
71719
71711
|
return `Rename '${from}' to '${to}'`;
|
|
71720
71712
|
|
|
71721
71713
|
return `Rename '${mask}' to '${mask.replace(from, to)}'`;
|
|
71722
71714
|
};
|
|
71723
71715
|
|
|
71724
|
-
const fix$
|
|
71716
|
+
const fix$3 = (path, {from, to}) => {
|
|
71725
71717
|
const filename = getFilename(path);
|
|
71726
71718
|
const newFilename = filename.replace(from, to);
|
|
71727
71719
|
|
|
71728
71720
|
renameFile(path, newFilename);
|
|
71729
71721
|
};
|
|
71730
71722
|
|
|
71731
|
-
const createScan = (baseOptions) => (rootPath, {push, options, trackFile}) => {
|
|
71723
|
+
const createScan$1 = (baseOptions) => (rootPath, {push, options, trackFile}) => {
|
|
71732
71724
|
const from = options.from || baseOptions.from;
|
|
71733
71725
|
const to = options.to || baseOptions.to;
|
|
71734
71726
|
const mask = options.mask || baseOptions.mask;
|
|
@@ -71768,9 +71760,9 @@ const createCheckNear = (near) => (file) => {
|
|
|
71768
71760
|
|
|
71769
71761
|
var renameFileByMask = /*#__PURE__*/Object.freeze({
|
|
71770
71762
|
__proto__: null,
|
|
71771
|
-
createScan: createScan,
|
|
71772
|
-
fix: fix$
|
|
71773
|
-
report: report
|
|
71763
|
+
createScan: createScan$1,
|
|
71764
|
+
fix: fix$3,
|
|
71765
|
+
report: report$1
|
|
71774
71766
|
});
|
|
71775
71767
|
|
|
71776
71768
|
const renameFiles = ({type, mask, rename, from, to, near} = {}) => {
|
|
@@ -73907,9 +73899,11 @@ var picomatch$1 = picomatch_1.default;
|
|
|
73907
73899
|
const {stringLiteral: stringLiteral$1} = lib_exports;
|
|
73908
73900
|
const getValue = ({node}) => node.value;
|
|
73909
73901
|
|
|
73902
|
+
const difference$1 = (a, b) => new Set(a).difference(new Set(b));
|
|
73903
|
+
|
|
73910
73904
|
const ignore = ({name, property, list, type = __ignore}) => ({
|
|
73911
73905
|
report: createReport$1(name),
|
|
73912
|
-
fix: fix$
|
|
73906
|
+
fix: fix$2,
|
|
73913
73907
|
traverse: createTraverse$1({
|
|
73914
73908
|
type,
|
|
73915
73909
|
property,
|
|
@@ -73934,7 +73928,7 @@ const createReport$1 = (filename) => ({name, matchedElements}) => {
|
|
|
73934
73928
|
return `Add '${name}'${insteadOf} to '${filename}'`;
|
|
73935
73929
|
};
|
|
73936
73930
|
|
|
73937
|
-
const fix$
|
|
73931
|
+
const fix$2 = ({path, name, matchedElements}) => {
|
|
73938
73932
|
path.node.elements.push(stringLiteral$1(name));
|
|
73939
73933
|
matchedElements.map(remove);
|
|
73940
73934
|
};
|
|
@@ -73957,10 +73951,7 @@ const createTraverse$1 = ({type, property, list}) => ({push, options}) => {
|
|
|
73957
73951
|
|
|
73958
73952
|
const list = elements.map(getValue);
|
|
73959
73953
|
|
|
73960
|
-
for (const name of newNames) {
|
|
73961
|
-
if (list.includes(name))
|
|
73962
|
-
continue;
|
|
73963
|
-
|
|
73954
|
+
for (const name of difference$1(newNames, list)) {
|
|
73964
73955
|
const match = picomatch$1(name);
|
|
73965
73956
|
const matchedElements = [];
|
|
73966
73957
|
|
|
@@ -74100,7 +74091,7 @@ const sortIgnore = ({name, property, type = __ignore}) => ({
|
|
|
74100
74091
|
name,
|
|
74101
74092
|
property,
|
|
74102
74093
|
}),
|
|
74103
|
-
fix,
|
|
74094
|
+
fix: fix$1,
|
|
74104
74095
|
traverse: createTraverse({
|
|
74105
74096
|
type,
|
|
74106
74097
|
property,
|
|
@@ -74114,17 +74105,12 @@ const createReport = ({name, property}) => () => {
|
|
|
74114
74105
|
return `Sort '${name}'`;
|
|
74115
74106
|
};
|
|
74116
74107
|
|
|
74117
|
-
const fix = ({path, sortedElements}) => {
|
|
74108
|
+
const fix$1 = ({path, sortedElements}) => {
|
|
74118
74109
|
path.node.elements = sortedElements;
|
|
74119
74110
|
};
|
|
74120
74111
|
|
|
74121
74112
|
const createTraverse = ({type, property}) => ({push}) => ({
|
|
74122
74113
|
[type]: (path) => {
|
|
74123
|
-
const masks = [];
|
|
74124
|
-
const hidden = [];
|
|
74125
|
-
const files = [];
|
|
74126
|
-
const dirs = [];
|
|
74127
|
-
|
|
74128
74114
|
const parentOfElements = parseElements(path, {
|
|
74129
74115
|
property,
|
|
74130
74116
|
});
|
|
@@ -74134,39 +74120,9 @@ const createTraverse = ({type, property}) => ({push}) => ({
|
|
|
74134
74120
|
|
|
74135
74121
|
const {elements} = parentOfElements.node;
|
|
74136
74122
|
|
|
74137
|
-
|
|
74138
|
-
|
|
74139
|
-
|
|
74140
|
-
if (!value)
|
|
74141
|
-
continue;
|
|
74142
|
-
|
|
74143
|
-
if (value.startsWith('*')) {
|
|
74144
|
-
masks.push(element);
|
|
74145
|
-
continue;
|
|
74146
|
-
}
|
|
74147
|
-
|
|
74148
|
-
if (value.startsWith('.')) {
|
|
74149
|
-
hidden.push(element);
|
|
74150
|
-
continue;
|
|
74151
|
-
}
|
|
74152
|
-
|
|
74153
|
-
if (value.includes('.')) {
|
|
74154
|
-
files.push(element);
|
|
74155
|
-
continue;
|
|
74156
|
-
}
|
|
74157
|
-
|
|
74158
|
-
if (value.startsWith('#'))
|
|
74159
|
-
continue;
|
|
74160
|
-
|
|
74161
|
-
dirs.push(element);
|
|
74162
|
-
}
|
|
74163
|
-
|
|
74164
|
-
const sortedElements = [
|
|
74165
|
-
...maybeSeparate(masks, property),
|
|
74166
|
-
...maybeSeparate(hidden, property),
|
|
74167
|
-
...maybeSeparate(files, property),
|
|
74168
|
-
...dirs,
|
|
74169
|
-
];
|
|
74123
|
+
const sortedElements = cleverSort(elements, {
|
|
74124
|
+
separate: !property,
|
|
74125
|
+
});
|
|
74170
74126
|
|
|
74171
74127
|
for (const [index, {value}] of elements.entries()) {
|
|
74172
74128
|
const current = sortedElements[index];
|
|
@@ -74200,8 +74156,93 @@ function parseElements(path, {property}) {
|
|
|
74200
74156
|
return prop.get('value');
|
|
74201
74157
|
}
|
|
74202
74158
|
|
|
74203
|
-
function
|
|
74204
|
-
|
|
74159
|
+
function cleverSort(elements, {separate}) {
|
|
74160
|
+
const twoStars = [];
|
|
74161
|
+
const noStars = [];
|
|
74162
|
+
|
|
74163
|
+
for (const element of elements) {
|
|
74164
|
+
const {value} = element;
|
|
74165
|
+
|
|
74166
|
+
if (value.startsWith('**/')) {
|
|
74167
|
+
twoStars.push(element);
|
|
74168
|
+
continue;
|
|
74169
|
+
}
|
|
74170
|
+
|
|
74171
|
+
noStars.push(element);
|
|
74172
|
+
}
|
|
74173
|
+
|
|
74174
|
+
const sortedElements = [
|
|
74175
|
+
...sortElements(twoStars, {
|
|
74176
|
+
separate,
|
|
74177
|
+
}),
|
|
74178
|
+
...sortElements(noStars, {
|
|
74179
|
+
separate,
|
|
74180
|
+
}),
|
|
74181
|
+
];
|
|
74182
|
+
|
|
74183
|
+
if (!sortedElements.length)
|
|
74184
|
+
return elements;
|
|
74185
|
+
|
|
74186
|
+
if (!sortedElements.at(-1).value)
|
|
74187
|
+
return sortedElements.slice(0, -1);
|
|
74188
|
+
|
|
74189
|
+
return sortedElements;
|
|
74190
|
+
}
|
|
74191
|
+
|
|
74192
|
+
function sortElements(elements, {separate} = {}) {
|
|
74193
|
+
const masks = [];
|
|
74194
|
+
const hidden = [];
|
|
74195
|
+
const files = [];
|
|
74196
|
+
const dirs = [];
|
|
74197
|
+
const allowed = [];
|
|
74198
|
+
|
|
74199
|
+
for (const element of elements) {
|
|
74200
|
+
const value = cutStars(element);
|
|
74201
|
+
|
|
74202
|
+
if (!value)
|
|
74203
|
+
continue;
|
|
74204
|
+
|
|
74205
|
+
if (value.startsWith('*')) {
|
|
74206
|
+
masks.push(element);
|
|
74207
|
+
continue;
|
|
74208
|
+
}
|
|
74209
|
+
|
|
74210
|
+
if (value.startsWith('.')) {
|
|
74211
|
+
hidden.push(element);
|
|
74212
|
+
continue;
|
|
74213
|
+
}
|
|
74214
|
+
|
|
74215
|
+
if (value.startsWith('!')) {
|
|
74216
|
+
allowed.push(element);
|
|
74217
|
+
continue;
|
|
74218
|
+
}
|
|
74219
|
+
|
|
74220
|
+
if (value.includes('.')) {
|
|
74221
|
+
files.push(element);
|
|
74222
|
+
continue;
|
|
74223
|
+
}
|
|
74224
|
+
|
|
74225
|
+
if (value.startsWith('#'))
|
|
74226
|
+
continue;
|
|
74227
|
+
|
|
74228
|
+
dirs.push(element);
|
|
74229
|
+
}
|
|
74230
|
+
|
|
74231
|
+
const sortedElements = [
|
|
74232
|
+
masks,
|
|
74233
|
+
hidden,
|
|
74234
|
+
files,
|
|
74235
|
+
dirs,
|
|
74236
|
+
allowed,
|
|
74237
|
+
];
|
|
74238
|
+
|
|
74239
|
+
return sortedElements.flatMap(maybeSeparate({
|
|
74240
|
+
separate,
|
|
74241
|
+
}));
|
|
74242
|
+
}
|
|
74243
|
+
|
|
74244
|
+
const maybeSeparate = ({separate} = {}) => (array) => {
|
|
74245
|
+
if (!separate)
|
|
74205
74246
|
return array;
|
|
74206
74247
|
|
|
74207
74248
|
if (!array.length)
|
|
@@ -74211,7 +74252,54 @@ function maybeSeparate(array, property) {
|
|
|
74211
74252
|
...array,
|
|
74212
74253
|
stringLiteral(''),
|
|
74213
74254
|
];
|
|
74214
|
-
}
|
|
74255
|
+
};
|
|
74256
|
+
|
|
74257
|
+
const cutStars = ({value}) => {
|
|
74258
|
+
if (!value)
|
|
74259
|
+
return '';
|
|
74260
|
+
|
|
74261
|
+
if (value.startsWith('**/'))
|
|
74262
|
+
return value.slice(3);
|
|
74263
|
+
|
|
74264
|
+
return value;
|
|
74265
|
+
};
|
|
74266
|
+
|
|
74267
|
+
const difference = (a, b) => new Set(a).difference(new Set(b));
|
|
74268
|
+
const {isArray} = Array;
|
|
74269
|
+
const maybeArray = (a) => isArray(a) ? a : [a];
|
|
74270
|
+
|
|
74271
|
+
const report = (file) => `Remove files: '${getFilename(file)}'`;
|
|
74272
|
+
|
|
74273
|
+
const fix = (file) => {
|
|
74274
|
+
removeFile(file);
|
|
74275
|
+
};
|
|
74276
|
+
|
|
74277
|
+
const removeFiles = (defaultNames) => ({
|
|
74278
|
+
report,
|
|
74279
|
+
fix,
|
|
74280
|
+
scan: createScan(defaultNames),
|
|
74281
|
+
});
|
|
74282
|
+
|
|
74283
|
+
const createScan = (defaultNames = []) => (path, {push, trackFile, options}) => {
|
|
74284
|
+
const {names, dismiss} = options;
|
|
74285
|
+
const allNames = [
|
|
74286
|
+
maybeArray(defaultNames),
|
|
74287
|
+
maybeArray(names),
|
|
74288
|
+
];
|
|
74289
|
+
|
|
74290
|
+
const flatNames = allNames
|
|
74291
|
+
.flat()
|
|
74292
|
+
.filter(Boolean);
|
|
74293
|
+
|
|
74294
|
+
if (!flatNames.length)
|
|
74295
|
+
return;
|
|
74296
|
+
|
|
74297
|
+
for (const file of trackFile(path, difference(flatNames, dismiss))) {
|
|
74298
|
+
push(file, {
|
|
74299
|
+
names: allNames,
|
|
74300
|
+
});
|
|
74301
|
+
}
|
|
74302
|
+
};
|
|
74215
74303
|
|
|
74216
74304
|
var operator = /*#__PURE__*/Object.freeze({
|
|
74217
74305
|
__proto__: null,
|
|
@@ -74247,7 +74335,7 @@ var operator = /*#__PURE__*/Object.freeze({
|
|
|
74247
74335
|
findFile: findFile,
|
|
74248
74336
|
findFileUp: findFileUp,
|
|
74249
74337
|
findVarsWays: findVarsWays,
|
|
74250
|
-
fix: fix$
|
|
74338
|
+
fix: fix$2,
|
|
74251
74339
|
fromJS: fromJS,
|
|
74252
74340
|
getAttributeNode: getAttributeNode,
|
|
74253
74341
|
getAttributePath: getAttributePath,
|
|
@@ -74301,6 +74389,7 @@ var operator = /*#__PURE__*/Object.freeze({
|
|
|
74301
74389
|
removeClassName: removeClassName,
|
|
74302
74390
|
removeEmptyDirectory: removeEmptyDirectory,
|
|
74303
74391
|
removeFile: removeFile,
|
|
74392
|
+
removeFiles: removeFiles,
|
|
74304
74393
|
removeParens: removeParens,
|
|
74305
74394
|
rename: rename,
|
|
74306
74395
|
renameFile: renameFile,
|