@putout/bundle 3.18.4 → 3.18.6
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 +732 -1854
- package/bundle/putout.min.js +1 -1
- package/package.json +4 -3
package/bundle/putout.js
CHANGED
|
@@ -174,15 +174,15 @@ var versions = {};
|
|
|
174
174
|
var release$1 = {};
|
|
175
175
|
var config = {};
|
|
176
176
|
|
|
177
|
-
function noop$
|
|
177
|
+
function noop$4() {}
|
|
178
178
|
|
|
179
|
-
var on = noop$
|
|
180
|
-
var addListener = noop$
|
|
181
|
-
var once$a = noop$
|
|
182
|
-
var off = noop$
|
|
183
|
-
var removeListener = noop$
|
|
184
|
-
var removeAllListeners = noop$
|
|
185
|
-
var emit = noop$
|
|
179
|
+
var on = noop$4;
|
|
180
|
+
var addListener = noop$4;
|
|
181
|
+
var once$a = noop$4;
|
|
182
|
+
var off = noop$4;
|
|
183
|
+
var removeListener = noop$4;
|
|
184
|
+
var removeAllListeners = noop$4;
|
|
185
|
+
var emit = noop$4;
|
|
186
186
|
|
|
187
187
|
function binding(name) {
|
|
188
188
|
throw new Error('process.binding is not supported');
|
|
@@ -257,7 +257,7 @@ var lookup = [];
|
|
|
257
257
|
var revLookup = [];
|
|
258
258
|
var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;
|
|
259
259
|
var inited = false;
|
|
260
|
-
function init$
|
|
260
|
+
function init$2 () {
|
|
261
261
|
inited = true;
|
|
262
262
|
var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
|
263
263
|
for (var i = 0, len = code.length; i < len; ++i) {
|
|
@@ -271,7 +271,7 @@ function init$5 () {
|
|
|
271
271
|
|
|
272
272
|
function toByteArray (b64) {
|
|
273
273
|
if (!inited) {
|
|
274
|
-
init$
|
|
274
|
+
init$2();
|
|
275
275
|
}
|
|
276
276
|
var i, j, l, tmp, placeHolders, arr;
|
|
277
277
|
var len = b64.length;
|
|
@@ -330,7 +330,7 @@ function encodeChunk (uint8, start, end) {
|
|
|
330
330
|
|
|
331
331
|
function fromByteArray (uint8) {
|
|
332
332
|
if (!inited) {
|
|
333
|
-
init$
|
|
333
|
+
init$2();
|
|
334
334
|
}
|
|
335
335
|
var tmp;
|
|
336
336
|
var len = uint8.length;
|
|
@@ -450,7 +450,7 @@ function write (buffer, value, offset, isLE, mLen, nBytes) {
|
|
|
450
450
|
|
|
451
451
|
var toString = {}.toString;
|
|
452
452
|
|
|
453
|
-
var isArray$
|
|
453
|
+
var isArray$g = Array.isArray || function (arr) {
|
|
454
454
|
return toString.call(arr) == '[object Array]';
|
|
455
455
|
};
|
|
456
456
|
|
|
@@ -734,7 +734,7 @@ function fromObject (that, obj) {
|
|
|
734
734
|
return fromArrayLike(that, obj)
|
|
735
735
|
}
|
|
736
736
|
|
|
737
|
-
if (obj.type === 'Buffer' && isArray$
|
|
737
|
+
if (obj.type === 'Buffer' && isArray$g(obj.data)) {
|
|
738
738
|
return fromArrayLike(that, obj.data)
|
|
739
739
|
}
|
|
740
740
|
}
|
|
@@ -799,7 +799,7 @@ Buffer.isEncoding = function isEncoding (encoding) {
|
|
|
799
799
|
};
|
|
800
800
|
|
|
801
801
|
Buffer.concat = function concat (list, length) {
|
|
802
|
-
if (!isArray$
|
|
802
|
+
if (!isArray$g(list)) {
|
|
803
803
|
throw new TypeError('"list" argument must be an Array of Buffers')
|
|
804
804
|
}
|
|
805
805
|
|
|
@@ -2448,7 +2448,7 @@ var getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors ||
|
|
|
2448
2448
|
|
|
2449
2449
|
var formatRegExp = /%[sdj%]/g;
|
|
2450
2450
|
function format(f) {
|
|
2451
|
-
if (!isString$
|
|
2451
|
+
if (!isString$c(f)) {
|
|
2452
2452
|
var objects = [];
|
|
2453
2453
|
for (var i = 0; i < arguments.length; i++) {
|
|
2454
2454
|
objects.push(inspect(arguments[i]));
|
|
@@ -2641,7 +2641,7 @@ function formatValue(ctx, value, recurseTimes) {
|
|
|
2641
2641
|
// Also filter out any prototype objects using the circular check.
|
|
2642
2642
|
!(value.constructor && value.constructor.prototype === value)) {
|
|
2643
2643
|
var ret = value.inspect(recurseTimes, ctx);
|
|
2644
|
-
if (!isString$
|
|
2644
|
+
if (!isString$c(ret)) {
|
|
2645
2645
|
ret = formatValue(ctx, ret, recurseTimes);
|
|
2646
2646
|
}
|
|
2647
2647
|
return ret;
|
|
@@ -2688,7 +2688,7 @@ function formatValue(ctx, value, recurseTimes) {
|
|
|
2688
2688
|
var base = '', array = false, braces = ['{', '}'];
|
|
2689
2689
|
|
|
2690
2690
|
// Make Array say that they are Array
|
|
2691
|
-
if (isArray$
|
|
2691
|
+
if (isArray$f(value)) {
|
|
2692
2692
|
array = true;
|
|
2693
2693
|
braces = ['[', ']'];
|
|
2694
2694
|
}
|
|
@@ -2746,7 +2746,7 @@ function formatValue(ctx, value, recurseTimes) {
|
|
|
2746
2746
|
function formatPrimitive(ctx, value) {
|
|
2747
2747
|
if (isUndefined(value))
|
|
2748
2748
|
return ctx.stylize('undefined', 'undefined');
|
|
2749
|
-
if (isString$
|
|
2749
|
+
if (isString$c(value)) {
|
|
2750
2750
|
var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
|
|
2751
2751
|
.replace(/'/g, "\\'")
|
|
2752
2752
|
.replace(/\\"/g, '"') + '\'';
|
|
@@ -2867,7 +2867,7 @@ function reduceToSingleString(output, base, braces) {
|
|
|
2867
2867
|
|
|
2868
2868
|
// NOTE: These type checking functions intentionally don't use `instanceof`
|
|
2869
2869
|
// because it is fragile and can be easily faked with `Object.create()`.
|
|
2870
|
-
function isArray$
|
|
2870
|
+
function isArray$f(ar) {
|
|
2871
2871
|
return Array.isArray(ar);
|
|
2872
2872
|
}
|
|
2873
2873
|
|
|
@@ -2887,7 +2887,7 @@ function isNumber$3(arg) {
|
|
|
2887
2887
|
return typeof arg === 'number';
|
|
2888
2888
|
}
|
|
2889
2889
|
|
|
2890
|
-
function isString$
|
|
2890
|
+
function isString$c(arg) {
|
|
2891
2891
|
return typeof arg === 'string';
|
|
2892
2892
|
}
|
|
2893
2893
|
|
|
@@ -3094,12 +3094,12 @@ var _polyfillNode_util = {
|
|
|
3094
3094
|
isRegExp: isRegExp$1,
|
|
3095
3095
|
isUndefined: isUndefined,
|
|
3096
3096
|
isSymbol: isSymbol,
|
|
3097
|
-
isString: isString$
|
|
3097
|
+
isString: isString$c,
|
|
3098
3098
|
isNumber: isNumber$3,
|
|
3099
3099
|
isNullOrUndefined: isNullOrUndefined,
|
|
3100
3100
|
isNull: isNull$1,
|
|
3101
3101
|
isBoolean: isBoolean,
|
|
3102
|
-
isArray: isArray$
|
|
3102
|
+
isArray: isArray$f,
|
|
3103
3103
|
inspect: inspect,
|
|
3104
3104
|
deprecate: deprecate,
|
|
3105
3105
|
format: format,
|
|
@@ -3118,7 +3118,7 @@ var _polyfillNode_util$1 = /*#__PURE__*/Object.freeze({
|
|
|
3118
3118
|
format: format,
|
|
3119
3119
|
inherits: inherits$1,
|
|
3120
3120
|
inspect: inspect,
|
|
3121
|
-
isArray: isArray$
|
|
3121
|
+
isArray: isArray$f,
|
|
3122
3122
|
isBoolean: isBoolean,
|
|
3123
3123
|
isBuffer: isBuffer,
|
|
3124
3124
|
isDate: isDate,
|
|
@@ -3130,7 +3130,7 @@ var _polyfillNode_util$1 = /*#__PURE__*/Object.freeze({
|
|
|
3130
3130
|
isObject: isObject$6,
|
|
3131
3131
|
isPrimitive: isPrimitive$1,
|
|
3132
3132
|
isRegExp: isRegExp$1,
|
|
3133
|
-
isString: isString$
|
|
3133
|
+
isString: isString$c,
|
|
3134
3134
|
isSymbol: isSymbol,
|
|
3135
3135
|
isUndefined: isUndefined,
|
|
3136
3136
|
log: log$6,
|
|
@@ -8990,7 +8990,7 @@ __export(lib_exports, {
|
|
|
8990
8990
|
return newExpression$1;
|
|
8991
8991
|
},
|
|
8992
8992
|
Noop: function() {
|
|
8993
|
-
return noop$
|
|
8993
|
+
return noop$3;
|
|
8994
8994
|
},
|
|
8995
8995
|
NullLiteral: function() {
|
|
8996
8996
|
return nullLiteral;
|
|
@@ -9245,7 +9245,7 @@ __export(lib_exports, {
|
|
|
9245
9245
|
return tsIndexedAccessType;
|
|
9246
9246
|
},
|
|
9247
9247
|
TSInferType: function() {
|
|
9248
|
-
return tsInferType;
|
|
9248
|
+
return tsInferType$1;
|
|
9249
9249
|
},
|
|
9250
9250
|
TSInstantiationExpression: function() {
|
|
9251
9251
|
return tsInstantiationExpression;
|
|
@@ -9302,7 +9302,7 @@ __export(lib_exports, {
|
|
|
9302
9302
|
return tsOptionalType;
|
|
9303
9303
|
},
|
|
9304
9304
|
TSParameterProperty: function() {
|
|
9305
|
-
return tsParameterProperty;
|
|
9305
|
+
return tsParameterProperty$1;
|
|
9306
9306
|
},
|
|
9307
9307
|
TSParenthesizedType: function() {
|
|
9308
9308
|
return tsParenthesizedType;
|
|
@@ -11312,7 +11312,7 @@ __export(lib_exports, {
|
|
|
11312
11312
|
return isPrivateName;
|
|
11313
11313
|
},
|
|
11314
11314
|
isProgram: function() {
|
|
11315
|
-
return isProgram$
|
|
11315
|
+
return isProgram$4;
|
|
11316
11316
|
},
|
|
11317
11317
|
isProperty: function() {
|
|
11318
11318
|
return isProperty$1;
|
|
@@ -11690,7 +11690,7 @@ __export(lib_exports, {
|
|
|
11690
11690
|
return isVariableDeclaration$2;
|
|
11691
11691
|
},
|
|
11692
11692
|
isVariableDeclarator: function() {
|
|
11693
|
-
return isVariableDeclarator$
|
|
11693
|
+
return isVariableDeclarator$3;
|
|
11694
11694
|
},
|
|
11695
11695
|
isVariance: function() {
|
|
11696
11696
|
return isVariance;
|
|
@@ -11825,7 +11825,7 @@ __export(lib_exports, {
|
|
|
11825
11825
|
return newExpression$1;
|
|
11826
11826
|
},
|
|
11827
11827
|
noop: function() {
|
|
11828
|
-
return noop$
|
|
11828
|
+
return noop$3;
|
|
11829
11829
|
},
|
|
11830
11830
|
nullLiteral: function() {
|
|
11831
11831
|
return nullLiteral;
|
|
@@ -12050,7 +12050,7 @@ __export(lib_exports, {
|
|
|
12050
12050
|
return tsIndexedAccessType;
|
|
12051
12051
|
},
|
|
12052
12052
|
tSInferType: function() {
|
|
12053
|
-
return tsInferType;
|
|
12053
|
+
return tsInferType$1;
|
|
12054
12054
|
},
|
|
12055
12055
|
tSInstantiationExpression: function() {
|
|
12056
12056
|
return tsInstantiationExpression;
|
|
@@ -12107,7 +12107,7 @@ __export(lib_exports, {
|
|
|
12107
12107
|
return tsOptionalType;
|
|
12108
12108
|
},
|
|
12109
12109
|
tSParameterProperty: function() {
|
|
12110
|
-
return tsParameterProperty;
|
|
12110
|
+
return tsParameterProperty$1;
|
|
12111
12111
|
},
|
|
12112
12112
|
tSParenthesizedType: function() {
|
|
12113
12113
|
return tsParenthesizedType;
|
|
@@ -12296,7 +12296,7 @@ __export(lib_exports, {
|
|
|
12296
12296
|
return tsIndexedAccessType;
|
|
12297
12297
|
},
|
|
12298
12298
|
tsInferType: function() {
|
|
12299
|
-
return tsInferType;
|
|
12299
|
+
return tsInferType$1;
|
|
12300
12300
|
},
|
|
12301
12301
|
tsInstantiationExpression: function() {
|
|
12302
12302
|
return tsInstantiationExpression;
|
|
@@ -12353,7 +12353,7 @@ __export(lib_exports, {
|
|
|
12353
12353
|
return tsOptionalType;
|
|
12354
12354
|
},
|
|
12355
12355
|
tsParameterProperty: function() {
|
|
12356
|
-
return tsParameterProperty;
|
|
12356
|
+
return tsParameterProperty$1;
|
|
12357
12357
|
},
|
|
12358
12358
|
tsParenthesizedType: function() {
|
|
12359
12359
|
return tsParenthesizedType;
|
|
@@ -13999,7 +13999,7 @@ function isNewExpression(node, opts) {
|
|
|
13999
13999
|
if (node.type !== "NewExpression") return false;
|
|
14000
14000
|
return opts == null || shallowEqual(node, opts);
|
|
14001
14001
|
}
|
|
14002
|
-
function isProgram$
|
|
14002
|
+
function isProgram$4(node, opts) {
|
|
14003
14003
|
if (!node) return false;
|
|
14004
14004
|
if (node.type !== "Program") return false;
|
|
14005
14005
|
return opts == null || shallowEqual(node, opts);
|
|
@@ -14079,7 +14079,7 @@ function isVariableDeclaration$2(node, opts) {
|
|
|
14079
14079
|
if (node.type !== "VariableDeclaration") return false;
|
|
14080
14080
|
return opts == null || shallowEqual(node, opts);
|
|
14081
14081
|
}
|
|
14082
|
-
function isVariableDeclarator$
|
|
14082
|
+
function isVariableDeclarator$3(node, opts) {
|
|
14083
14083
|
if (!node) return false;
|
|
14084
14084
|
if (node.type !== "VariableDeclarator") return false;
|
|
14085
14085
|
return opts == null || shallowEqual(node, opts);
|
|
@@ -23216,7 +23216,7 @@ function jsxClosingFragment() {
|
|
|
23216
23216
|
type: "JSXClosingFragment"
|
|
23217
23217
|
};
|
|
23218
23218
|
}
|
|
23219
|
-
function noop$
|
|
23219
|
+
function noop$3() {
|
|
23220
23220
|
return {
|
|
23221
23221
|
type: "Noop"
|
|
23222
23222
|
};
|
|
@@ -23363,7 +23363,7 @@ function pipelinePrimaryTopicReference() {
|
|
|
23363
23363
|
type: "PipelinePrimaryTopicReference"
|
|
23364
23364
|
};
|
|
23365
23365
|
}
|
|
23366
|
-
function tsParameterProperty(parameter) {
|
|
23366
|
+
function tsParameterProperty$1(parameter) {
|
|
23367
23367
|
var node = {
|
|
23368
23368
|
type: "TSParameterProperty",
|
|
23369
23369
|
parameter: parameter
|
|
@@ -23715,7 +23715,7 @@ function tsConditionalType$1(checkType, extendsType, trueType, falseType) {
|
|
|
23715
23715
|
validate$4(defs.falseType, node, "falseType", falseType, 1);
|
|
23716
23716
|
return node;
|
|
23717
23717
|
}
|
|
23718
|
-
function tsInferType(typeParameter2) {
|
|
23718
|
+
function tsInferType$1(typeParameter2) {
|
|
23719
23719
|
var node = {
|
|
23720
23720
|
type: "TSInferType",
|
|
23721
23721
|
typeParameter: typeParameter2
|
|
@@ -26156,7 +26156,7 @@ function getFunctionName(node, parent) {
|
|
|
26156
26156
|
id = getObjectMemberKey(node);
|
|
26157
26157
|
if (node.kind === "get") prefix2 = "get ";
|
|
26158
26158
|
else if (node.kind === "set") prefix2 = "set ";
|
|
26159
|
-
} else if (isVariableDeclarator$
|
|
26159
|
+
} else if (isVariableDeclarator$3(parent, {
|
|
26160
26160
|
init: node
|
|
26161
26161
|
})) {
|
|
26162
26162
|
id = parent.id;
|
|
@@ -27414,7 +27414,7 @@ var TokContext = function TokContext(token, preserveSpace) {
|
|
|
27414
27414
|
this.token = token;
|
|
27415
27415
|
this.preserveSpace = !!preserveSpace;
|
|
27416
27416
|
};
|
|
27417
|
-
var types$
|
|
27417
|
+
var types$y = {
|
|
27418
27418
|
brace: new TokContext("{"),
|
|
27419
27419
|
j_oTag: new TokContext("<tag"),
|
|
27420
27420
|
j_cTag: new TokContext("</tag"),
|
|
@@ -29641,7 +29641,7 @@ var State$2 = /*#__PURE__*/ function() {
|
|
|
29641
29641
|
__publicField(this, "lastTokEndLoc", null);
|
|
29642
29642
|
__publicField(this, "lastTokStartLoc", null);
|
|
29643
29643
|
__publicField(this, "context", [
|
|
29644
|
-
types$
|
|
29644
|
+
types$y.brace
|
|
29645
29645
|
]);
|
|
29646
29646
|
__publicField(this, "firstInvalidTemplateEscapePos", null);
|
|
29647
29647
|
__publicField(this, "strictErrors", /* @__PURE__ */ new Map());
|
|
@@ -34183,7 +34183,7 @@ var flow$1 = function(superClass) {
|
|
|
34183
34183
|
if (!jsx2.error) return jsx2.node;
|
|
34184
34184
|
var context = this.state.context;
|
|
34185
34185
|
var currentContext = context[context.length - 1];
|
|
34186
|
-
if (currentContext === types$
|
|
34186
|
+
if (currentContext === types$y.j_oTag || currentContext === types$y.j_expr) {
|
|
34187
34187
|
context.pop();
|
|
34188
34188
|
}
|
|
34189
34189
|
}
|
|
@@ -35399,9 +35399,9 @@ var jsx$3 = function(superClass) {
|
|
|
35399
35399
|
switch(this.state.type){
|
|
35400
35400
|
case 5:
|
|
35401
35401
|
node = this.startNode();
|
|
35402
|
-
this.setContext(types$
|
|
35402
|
+
this.setContext(types$y.brace);
|
|
35403
35403
|
this.next();
|
|
35404
|
-
node = this.jsxParseExpressionContainer(node, types$
|
|
35404
|
+
node = this.jsxParseExpressionContainer(node, types$y.j_oTag);
|
|
35405
35405
|
if (node.expression.type === "JSXEmptyExpression") {
|
|
35406
35406
|
this.raise(JsxErrors.AttributeIsEmpty, node);
|
|
35407
35407
|
}
|
|
@@ -35426,7 +35426,7 @@ var jsx$3 = function(superClass) {
|
|
|
35426
35426
|
value: function jsxParseSpreadChild(node) {
|
|
35427
35427
|
this.next();
|
|
35428
35428
|
node.expression = this.parseExpression();
|
|
35429
|
-
this.setContext(types$
|
|
35429
|
+
this.setContext(types$y.j_expr);
|
|
35430
35430
|
this.state.canStartJSXElement = true;
|
|
35431
35431
|
this.expect(8);
|
|
35432
35432
|
return this.finishNode(node, "JSXSpreadChild");
|
|
@@ -35458,11 +35458,11 @@ var jsx$3 = function(superClass) {
|
|
|
35458
35458
|
value: function jsxParseAttribute() {
|
|
35459
35459
|
var node = this.startNode();
|
|
35460
35460
|
if (this.match(5)) {
|
|
35461
|
-
this.setContext(types$
|
|
35461
|
+
this.setContext(types$y.brace);
|
|
35462
35462
|
this.next();
|
|
35463
35463
|
this.expect(21);
|
|
35464
35464
|
node.argument = this.parseMaybeAssignAllowIn();
|
|
35465
|
-
this.setContext(types$
|
|
35465
|
+
this.setContext(types$y.j_oTag);
|
|
35466
35466
|
this.state.canStartJSXElement = true;
|
|
35467
35467
|
this.expect(8);
|
|
35468
35468
|
return this.finishNode(node, "JSXSpreadAttribute");
|
|
@@ -35533,12 +35533,12 @@ var jsx$3 = function(superClass) {
|
|
|
35533
35533
|
case 5:
|
|
35534
35534
|
{
|
|
35535
35535
|
var node2 = this.startNode();
|
|
35536
|
-
this.setContext(types$
|
|
35536
|
+
this.setContext(types$y.brace);
|
|
35537
35537
|
this.next();
|
|
35538
35538
|
if (this.match(21)) {
|
|
35539
35539
|
children.push(this.jsxParseSpreadChild(node2));
|
|
35540
35540
|
} else {
|
|
35541
|
-
children.push(this.jsxParseExpressionContainer(node2, types$
|
|
35541
|
+
children.push(this.jsxParseExpressionContainer(node2, types$y.j_expr));
|
|
35542
35542
|
}
|
|
35543
35543
|
break;
|
|
35544
35544
|
}
|
|
@@ -35613,11 +35613,11 @@ var jsx$3 = function(superClass) {
|
|
|
35613
35613
|
key: "getTokenFromCode",
|
|
35614
35614
|
value: function getTokenFromCode(code2) {
|
|
35615
35615
|
var context = this.curContext();
|
|
35616
|
-
if (context === types$
|
|
35616
|
+
if (context === types$y.j_expr) {
|
|
35617
35617
|
this.jsxReadToken();
|
|
35618
35618
|
return;
|
|
35619
35619
|
}
|
|
35620
|
-
if (context === types$
|
|
35620
|
+
if (context === types$y.j_oTag || context === types$y.j_cTag) {
|
|
35621
35621
|
if (isIdentifierStart2(code2)) {
|
|
35622
35622
|
this.jsxReadWord();
|
|
35623
35623
|
return;
|
|
@@ -35627,7 +35627,7 @@ var jsx$3 = function(superClass) {
|
|
|
35627
35627
|
this.finishToken(143);
|
|
35628
35628
|
return;
|
|
35629
35629
|
}
|
|
35630
|
-
if ((code2 === 34 || code2 === 39) && context === types$
|
|
35630
|
+
if ((code2 === 34 || code2 === 39) && context === types$y.j_oTag) {
|
|
35631
35631
|
this.jsxReadString(code2);
|
|
35632
35632
|
return;
|
|
35633
35633
|
}
|
|
@@ -35645,17 +35645,17 @@ var jsx$3 = function(superClass) {
|
|
|
35645
35645
|
value: function updateContext(prevType) {
|
|
35646
35646
|
var _this_state = this.state, context = _this_state.context, type = _this_state.type;
|
|
35647
35647
|
if (type === 56 && prevType === 142) {
|
|
35648
|
-
context.splice(-2, 2, types$
|
|
35648
|
+
context.splice(-2, 2, types$y.j_cTag);
|
|
35649
35649
|
this.state.canStartJSXElement = false;
|
|
35650
35650
|
} else if (type === 142) {
|
|
35651
|
-
context.push(types$
|
|
35651
|
+
context.push(types$y.j_oTag);
|
|
35652
35652
|
} else if (type === 143) {
|
|
35653
35653
|
var out = context[context.length - 1];
|
|
35654
|
-
if (out === types$
|
|
35654
|
+
if (out === types$y.j_oTag && prevType === 56 || out === types$y.j_cTag) {
|
|
35655
35655
|
context.pop();
|
|
35656
|
-
this.state.canStartJSXElement = context[context.length - 1] === types$
|
|
35656
|
+
this.state.canStartJSXElement = context[context.length - 1] === types$y.j_expr;
|
|
35657
35657
|
} else {
|
|
35658
|
-
this.setContext(types$
|
|
35658
|
+
this.setContext(types$y.j_expr);
|
|
35659
35659
|
this.state.canStartJSXElement = true;
|
|
35660
35660
|
}
|
|
35661
35661
|
} else {
|
|
@@ -38157,7 +38157,7 @@ var typescript$3 = function(superClass) {
|
|
|
38157
38157
|
});
|
|
38158
38158
|
if (node.params.length === 0) {
|
|
38159
38159
|
this.raise(TSErrors.EmptyTypeArguments, node);
|
|
38160
|
-
} else if (!this.state.inType && this.curContext() === types$
|
|
38160
|
+
} else if (!this.state.inType && this.curContext() === types$y.brace) {
|
|
38161
38161
|
this.reScan_lt_gt();
|
|
38162
38162
|
}
|
|
38163
38163
|
this.expect(48);
|
|
@@ -38970,7 +38970,7 @@ var typescript$3 = function(superClass) {
|
|
|
38970
38970
|
if (!jsx2.error) return jsx2.node;
|
|
38971
38971
|
var context = this.state.context;
|
|
38972
38972
|
var currentContext = context[context.length - 1];
|
|
38973
|
-
if (currentContext === types$
|
|
38973
|
+
if (currentContext === types$y.j_oTag || currentContext === types$y.j_expr) {
|
|
38974
38974
|
context.pop();
|
|
38975
38975
|
}
|
|
38976
38976
|
}
|
|
@@ -48880,7 +48880,7 @@ function RestElement$1(node) {
|
|
|
48880
48880
|
this.token("...");
|
|
48881
48881
|
this.print(node.argument);
|
|
48882
48882
|
}
|
|
48883
|
-
function ObjectExpression$
|
|
48883
|
+
function ObjectExpression$4(node) {
|
|
48884
48884
|
var props = node.properties;
|
|
48885
48885
|
this.tokenChar(123);
|
|
48886
48886
|
if (props.length) {
|
|
@@ -48903,7 +48903,7 @@ function ObjectMethod$2(node) {
|
|
|
48903
48903
|
this.space();
|
|
48904
48904
|
this.print(node.body);
|
|
48905
48905
|
}
|
|
48906
|
-
function ObjectProperty$
|
|
48906
|
+
function ObjectProperty$4(node) {
|
|
48907
48907
|
this.printJoin(node.decorators);
|
|
48908
48908
|
if (node.computed) {
|
|
48909
48909
|
this.tokenChar(91);
|
|
@@ -48923,7 +48923,7 @@ function ObjectProperty$7(node) {
|
|
|
48923
48923
|
this.space();
|
|
48924
48924
|
this.print(node.value);
|
|
48925
48925
|
}
|
|
48926
|
-
function ArrayExpression$
|
|
48926
|
+
function ArrayExpression$5(node) {
|
|
48927
48927
|
var elems = node.elements;
|
|
48928
48928
|
var len = elems.length;
|
|
48929
48929
|
this.tokenChar(91);
|
|
@@ -49009,7 +49009,7 @@ function NumericLiteral(node) {
|
|
|
49009
49009
|
this.number(raw, value1);
|
|
49010
49010
|
}
|
|
49011
49011
|
}
|
|
49012
|
-
function StringLiteral$
|
|
49012
|
+
function StringLiteral$6(node) {
|
|
49013
49013
|
var raw = this.getPossibleRaw(node);
|
|
49014
49014
|
if (!this.format.minified && raw !== void 0) {
|
|
49015
49015
|
this.token(raw);
|
|
@@ -49905,7 +49905,7 @@ function TSTypeParameter$1(node) {
|
|
|
49905
49905
|
this.print(node.default);
|
|
49906
49906
|
}
|
|
49907
49907
|
}
|
|
49908
|
-
function TSParameterProperty(node) {
|
|
49908
|
+
function TSParameterProperty$1(node) {
|
|
49909
49909
|
if (node.accessibility) {
|
|
49910
49910
|
this.word(node.accessibility);
|
|
49911
49911
|
this.space();
|
|
@@ -50509,8 +50509,8 @@ var generatorFunctions = /* @__PURE__ */ Object.freeze({
|
|
|
50509
50509
|
__proto__: null,
|
|
50510
50510
|
AnyTypeAnnotation: AnyTypeAnnotation,
|
|
50511
50511
|
ArgumentPlaceholder: ArgumentPlaceholder,
|
|
50512
|
-
ArrayExpression: ArrayExpression$
|
|
50513
|
-
ArrayPattern: ArrayExpression$
|
|
50512
|
+
ArrayExpression: ArrayExpression$5,
|
|
50513
|
+
ArrayPattern: ArrayExpression$5,
|
|
50514
50514
|
ArrayTypeAnnotation: ArrayTypeAnnotation,
|
|
50515
50515
|
ArrowFunctionExpression: ArrowFunctionExpression$1,
|
|
50516
50516
|
AssignmentExpression: AssignmentExpression$2,
|
|
@@ -50627,10 +50627,10 @@ var generatorFunctions = /* @__PURE__ */ Object.freeze({
|
|
|
50627
50627
|
NumberLiteralTypeAnnotation: NumericLiteral,
|
|
50628
50628
|
NumberTypeAnnotation: NumberTypeAnnotation,
|
|
50629
50629
|
NumericLiteral: NumericLiteral,
|
|
50630
|
-
ObjectExpression: ObjectExpression$
|
|
50630
|
+
ObjectExpression: ObjectExpression$4,
|
|
50631
50631
|
ObjectMethod: ObjectMethod$2,
|
|
50632
|
-
ObjectPattern: ObjectExpression$
|
|
50633
|
-
ObjectProperty: ObjectProperty$
|
|
50632
|
+
ObjectPattern: ObjectExpression$4,
|
|
50633
|
+
ObjectProperty: ObjectProperty$4,
|
|
50634
50634
|
ObjectTypeAnnotation: ObjectTypeAnnotation,
|
|
50635
50635
|
ObjectTypeCallProperty: ObjectTypeCallProperty,
|
|
50636
50636
|
ObjectTypeIndexer: ObjectTypeIndexer,
|
|
@@ -50656,8 +50656,8 @@ var generatorFunctions = /* @__PURE__ */ Object.freeze({
|
|
|
50656
50656
|
SequenceExpression: SequenceExpression$2,
|
|
50657
50657
|
SpreadElement: RestElement$1,
|
|
50658
50658
|
StaticBlock: StaticBlock$1,
|
|
50659
|
-
StringLiteral: StringLiteral$
|
|
50660
|
-
StringLiteralTypeAnnotation: StringLiteral$
|
|
50659
|
+
StringLiteral: StringLiteral$6,
|
|
50660
|
+
StringLiteralTypeAnnotation: StringLiteral$6,
|
|
50661
50661
|
StringTypeAnnotation: StringTypeAnnotation,
|
|
50662
50662
|
Super: Super,
|
|
50663
50663
|
SwitchCase: SwitchCase,
|
|
@@ -50705,7 +50705,7 @@ var generatorFunctions = /* @__PURE__ */ Object.freeze({
|
|
|
50705
50705
|
TSNumberKeyword: TSNumberKeyword,
|
|
50706
50706
|
TSObjectKeyword: TSObjectKeyword,
|
|
50707
50707
|
TSOptionalType: TSOptionalType,
|
|
50708
|
-
TSParameterProperty: TSParameterProperty,
|
|
50708
|
+
TSParameterProperty: TSParameterProperty$1,
|
|
50709
50709
|
TSParenthesizedType: TSParenthesizedType,
|
|
50710
50710
|
TSPropertySignature: TSPropertySignature$1,
|
|
50711
50711
|
TSQualifiedName: TSQualifiedName,
|
|
@@ -58416,7 +58416,7 @@ var main = {};
|
|
|
58416
58416
|
|
|
58417
58417
|
var fork = {exports: {}};
|
|
58418
58418
|
|
|
58419
|
-
var types$
|
|
58419
|
+
var types$x = {exports: {}};
|
|
58420
58420
|
|
|
58421
58421
|
var shared = {};
|
|
58422
58422
|
|
|
@@ -58516,12 +58516,12 @@ function requireShared () {
|
|
|
58516
58516
|
return shared;
|
|
58517
58517
|
}
|
|
58518
58518
|
|
|
58519
|
-
types$
|
|
58519
|
+
types$x.exports;
|
|
58520
58520
|
|
|
58521
58521
|
var hasRequiredTypes;
|
|
58522
58522
|
|
|
58523
58523
|
function requireTypes () {
|
|
58524
|
-
if (hasRequiredTypes) return types$
|
|
58524
|
+
if (hasRequiredTypes) return types$x.exports;
|
|
58525
58525
|
hasRequiredTypes = 1;
|
|
58526
58526
|
(function (module, exports) {
|
|
58527
58527
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -59313,8 +59313,8 @@ function requireTypes () {
|
|
|
59313
59313
|
exports.default = typesPlugin;
|
|
59314
59314
|
(0, shared_1.maybeSetModuleExports)(function () { return module; });
|
|
59315
59315
|
|
|
59316
|
-
} (types$
|
|
59317
|
-
return types$
|
|
59316
|
+
} (types$x, types$x.exports));
|
|
59317
|
+
return types$x.exports;
|
|
59318
59318
|
}
|
|
59319
59319
|
|
|
59320
59320
|
var pathVisitor = {exports: {}};
|
|
@@ -78645,7 +78645,7 @@ var printer = {};
|
|
|
78645
78645
|
|
|
78646
78646
|
var tokenize$1 = {};
|
|
78647
78647
|
|
|
78648
|
-
var fullstore$
|
|
78648
|
+
var fullstore$3 = (value) => {
|
|
78649
78649
|
const data = {
|
|
78650
78650
|
value,
|
|
78651
78651
|
};
|
|
@@ -78662,9 +78662,9 @@ var fullstore$6 = (value) => {
|
|
|
78662
78662
|
};
|
|
78663
78663
|
};
|
|
78664
78664
|
|
|
78665
|
-
var types$
|
|
78665
|
+
var types$w = {};
|
|
78666
78666
|
|
|
78667
|
-
types$
|
|
78667
|
+
types$w.TYPES = {
|
|
78668
78668
|
TOKEN: 'Token',
|
|
78669
78669
|
NEWLINE: 'Newline',
|
|
78670
78670
|
LINEBREAK: 'Linebreak',
|
|
@@ -78684,7 +78684,7 @@ var arrowFunctionExpression = {};
|
|
|
78684
78684
|
|
|
78685
78685
|
var is$3 = {};
|
|
78686
78686
|
|
|
78687
|
-
const {types: types$
|
|
78687
|
+
const {types: types$v} = bundle;
|
|
78688
78688
|
const {
|
|
78689
78689
|
isStringLiteral: isStringLiteral$9,
|
|
78690
78690
|
isSpreadElement: isSpreadElement$3,
|
|
@@ -78696,7 +78696,7 @@ const {
|
|
|
78696
78696
|
isMemberExpression: isMemberExpression$5,
|
|
78697
78697
|
isArrayExpression: isArrayExpression$4,
|
|
78698
78698
|
isObjectExpression: isObjectExpression$6,
|
|
78699
|
-
} = types$
|
|
78699
|
+
} = types$v;
|
|
78700
78700
|
|
|
78701
78701
|
const isParentProgram$1 = (path) => path.parentPath?.isProgram();
|
|
78702
78702
|
const isParentBlock$3 = (path) => path.parentPath.isBlockStatement();
|
|
@@ -78733,6 +78733,10 @@ is$3.isParentLast = (path) => isLast$d(path.parentPath);
|
|
|
78733
78733
|
|
|
78734
78734
|
is$3.isIndented = (path = {}) => {
|
|
78735
78735
|
const {parentPath, node} = path;
|
|
78736
|
+
|
|
78737
|
+
if (!parentPath.node.loc)
|
|
78738
|
+
return true;
|
|
78739
|
+
|
|
78736
78740
|
return node.loc?.start.column !== parentPath.node.loc.start.column;
|
|
78737
78741
|
};
|
|
78738
78742
|
|
|
@@ -78875,7 +78879,7 @@ maybeInsideFn$1.maybeInsideFn = (insideFn, {print, indent}) => {
|
|
|
78875
78879
|
indent.dec();
|
|
78876
78880
|
};
|
|
78877
78881
|
|
|
78878
|
-
const {types: types$
|
|
78882
|
+
const {types: types$u} = bundle;
|
|
78879
78883
|
const {
|
|
78880
78884
|
hasTrailingComment: hasTrailingComment$4,
|
|
78881
78885
|
satisfy: satisfy$4,
|
|
@@ -78887,15 +78891,15 @@ const {maybeInsideFn} = maybeInsideFn$1;
|
|
|
78887
78891
|
|
|
78888
78892
|
const {
|
|
78889
78893
|
isObjectProperty: isObjectProperty$1,
|
|
78890
|
-
isVariableDeclarator: isVariableDeclarator$
|
|
78894
|
+
isVariableDeclarator: isVariableDeclarator$2,
|
|
78891
78895
|
isClassProperty,
|
|
78892
78896
|
isTSPropertySignature,
|
|
78893
78897
|
isSpreadElement: isSpreadElement$2,
|
|
78894
|
-
} = types$
|
|
78898
|
+
} = types$u;
|
|
78895
78899
|
|
|
78896
78900
|
const isProperty = satisfy$4([
|
|
78897
78901
|
isObjectProperty$1,
|
|
78898
|
-
isVariableDeclarator$
|
|
78902
|
+
isVariableDeclarator$2,
|
|
78899
78903
|
isClassProperty,
|
|
78900
78904
|
isTSPropertySignature,
|
|
78901
78905
|
isSpreadElement$2,
|
|
@@ -79075,8 +79079,10 @@ function isCommentOnNextLine(path) {
|
|
|
79075
79079
|
if (!loc)
|
|
79076
79080
|
return true;
|
|
79077
79081
|
|
|
79078
|
-
const
|
|
79079
|
-
const
|
|
79082
|
+
const startLine = loc.start.line;
|
|
79083
|
+
const endLine = loc.end.line;
|
|
79084
|
+
const isNextLine = line === startLine + 1 && line === endLine + 1;
|
|
79085
|
+
const isNextLineAfterNewline = line === startLine + 2 && line === endLine + 2;
|
|
79080
79086
|
|
|
79081
79087
|
return isNextLine || isNextLineAfterNewline;
|
|
79082
79088
|
}
|
|
@@ -79630,7 +79636,7 @@ var memberExpressions$1 = {};
|
|
|
79630
79636
|
|
|
79631
79637
|
var chain$1 = {};
|
|
79632
79638
|
|
|
79633
|
-
const {assign: assign$
|
|
79639
|
+
const {assign: assign$c} = Object;
|
|
79634
79640
|
|
|
79635
79641
|
chain$1.chain = (path) => {
|
|
79636
79642
|
const all = [
|
|
@@ -79695,7 +79701,7 @@ function build(path) {
|
|
|
79695
79701
|
};
|
|
79696
79702
|
|
|
79697
79703
|
if (path.isCallExpression())
|
|
79698
|
-
assign$
|
|
79704
|
+
assign$c(prop, {
|
|
79699
79705
|
args: path.node.arguments.length,
|
|
79700
79706
|
name: path.node.callee.property?.name || '',
|
|
79701
79707
|
});
|
|
@@ -79929,12 +79935,12 @@ var callExpression = {};
|
|
|
79929
79935
|
|
|
79930
79936
|
const {exists: exists$c} = is$3;
|
|
79931
79937
|
const {maybeParens: maybeParens$4} = maybeParens$8;
|
|
79932
|
-
const {isArray: isArray$
|
|
79938
|
+
const {isArray: isArray$e} = Array;
|
|
79933
79939
|
|
|
79934
79940
|
const parseArgs = (path) => {
|
|
79935
79941
|
const argsPath = path.get('arguments');
|
|
79936
79942
|
|
|
79937
|
-
if (!isArray$
|
|
79943
|
+
if (!isArray$e(argsPath))
|
|
79938
79944
|
return [];
|
|
79939
79945
|
|
|
79940
79946
|
return argsPath;
|
|
@@ -80071,8 +80077,8 @@ const {
|
|
|
80071
80077
|
|
|
80072
80078
|
const {parseComments: parseComments$4} = comment;
|
|
80073
80079
|
const {likeChain} = memberExpressions$1;
|
|
80074
|
-
const {types: types$
|
|
80075
|
-
const {isStringLiteral: isStringLiteral$8} = types$
|
|
80080
|
+
const {types: types$t} = bundle;
|
|
80081
|
+
const {isStringLiteral: isStringLiteral$8} = types$t;
|
|
80076
80082
|
|
|
80077
80083
|
const isBodyOfArrow = (path) => path.parentPath.node.body === path.node;
|
|
80078
80084
|
const isLogical = (path) => path.get('argument').isLogicalExpression();
|
|
@@ -80368,10 +80374,11 @@ function maybePrintTypeAnnotation$3(path, printer) {
|
|
|
80368
80374
|
|
|
80369
80375
|
var moreThenMaxPropertiesLengthInOneLine$1 = {};
|
|
80370
80376
|
|
|
80377
|
+
const {types: types$s} = bundle;
|
|
80371
80378
|
const {
|
|
80372
80379
|
isAssignmentPattern: isAssignmentPattern$1,
|
|
80373
80380
|
isIdentifier: isIdentifier$a,
|
|
80374
|
-
} =
|
|
80381
|
+
} = types$s;
|
|
80375
80382
|
|
|
80376
80383
|
moreThenMaxPropertiesLengthInOneLine$1.moreThenMaxPropertiesLengthInOneLine = (path, {maxPropertiesLengthInOneLine}) => {
|
|
80377
80384
|
const {properties} = path.node;
|
|
@@ -80405,6 +80412,7 @@ const {
|
|
|
80405
80412
|
isIdentifier: isIdentifier$9,
|
|
80406
80413
|
isObjectPattern: isObjectPattern$2,
|
|
80407
80414
|
isAssignmentPattern,
|
|
80415
|
+
isVariableDeclarator: isVariableDeclarator$1,
|
|
80408
80416
|
} = bundle.types;
|
|
80409
80417
|
|
|
80410
80418
|
const {wrongShorthand} = wrongShortand;
|
|
@@ -80416,14 +80424,12 @@ const {
|
|
|
80416
80424
|
} = is$3;
|
|
80417
80425
|
|
|
80418
80426
|
const {moreThenMaxPropertiesInOneLine} = moreThenMaxPropertiesInOneLine$1;
|
|
80427
|
+
const isInsideFn = (path) => path.parentPath.isFunction();
|
|
80419
80428
|
|
|
80420
80429
|
const {maybeTypeAnnotation: maybeTypeAnnotation$3} = maybeTypeAnnotation$4;
|
|
80421
80430
|
const {moreThenMaxPropertiesLengthInOneLine} = moreThenMaxPropertiesLengthInOneLine$1;
|
|
80422
80431
|
const {printKey: printKey$3} = printKey$7;
|
|
80423
80432
|
|
|
80424
|
-
const isTwoLevelsDeep = ({parentPath}) => parentPath.parentPath.parentPath.isObjectProperty();
|
|
80425
|
-
const isOneParentProperty = ({parentPath}) => parentPath.parentPath.node.properties?.length === 1;
|
|
80426
|
-
|
|
80427
80433
|
function isIndent(path) {
|
|
80428
80434
|
return !path.parentPath.isArrayPattern();
|
|
80429
80435
|
}
|
|
@@ -80435,6 +80441,9 @@ const isCoupleProperties = ({path, valuePath, property}) => {
|
|
|
80435
80441
|
if (exists$9(property.getPrevSibling()))
|
|
80436
80442
|
return false;
|
|
80437
80443
|
|
|
80444
|
+
if (path.parentPath.isVariableDeclarator() && !hasAssign(path.get('properties')))
|
|
80445
|
+
return false;
|
|
80446
|
+
|
|
80438
80447
|
return !path.parentPath.isObjectProperty();
|
|
80439
80448
|
};
|
|
80440
80449
|
|
|
@@ -80465,7 +80474,8 @@ objectPattern.ObjectPattern = {
|
|
|
80465
80474
|
|
|
80466
80475
|
const hasObject = n && hasObjectPattern(properties);
|
|
80467
80476
|
|
|
80468
|
-
|
|
80477
|
+
const notInsideFn = !isInsideFn(path);
|
|
80478
|
+
maybe.print.newline(is && notInsideFn);
|
|
80469
80479
|
|
|
80470
80480
|
for (const [i, property] of properties.entries()) {
|
|
80471
80481
|
if (property.isRestElement()) {
|
|
@@ -80488,7 +80498,7 @@ objectPattern.ObjectPattern = {
|
|
|
80488
80498
|
valuePath,
|
|
80489
80499
|
});
|
|
80490
80500
|
|
|
80491
|
-
maybe.indent(is);
|
|
80501
|
+
maybe.indent(is && notInsideFn);
|
|
80492
80502
|
maybe.print.breakline(couple);
|
|
80493
80503
|
|
|
80494
80504
|
printKey$3(property, printer);
|
|
@@ -80504,7 +80514,7 @@ objectPattern.ObjectPattern = {
|
|
|
80504
80514
|
maybe.print.newline(couple);
|
|
80505
80515
|
}
|
|
80506
80516
|
|
|
80507
|
-
if (is || hasObject
|
|
80517
|
+
if (is || hasObject) {
|
|
80508
80518
|
print(',');
|
|
80509
80519
|
print.newline();
|
|
80510
80520
|
|
|
@@ -80522,18 +80532,6 @@ objectPattern.ObjectPattern = {
|
|
|
80522
80532
|
maybe.indent.inc(!shouldIndent);
|
|
80523
80533
|
print('}');
|
|
80524
80534
|
}),
|
|
80525
|
-
afterIf(path) {
|
|
80526
|
-
if (!path.parentPath.isObjectProperty())
|
|
80527
|
-
return false;
|
|
80528
|
-
|
|
80529
|
-
if (isTwoLevelsDeep(path))
|
|
80530
|
-
return false;
|
|
80531
|
-
|
|
80532
|
-
return isOneParentProperty(path);
|
|
80533
|
-
},
|
|
80534
|
-
after(path, {print}) {
|
|
80535
|
-
print.newline();
|
|
80536
|
-
},
|
|
80537
80535
|
};
|
|
80538
80536
|
|
|
80539
80537
|
function checkLength(properties) {
|
|
@@ -80593,7 +80591,10 @@ function shouldAddNewline(path, semantics) {
|
|
|
80593
80591
|
|
|
80594
80592
|
const fnParam = isFunctionParam(path);
|
|
80595
80593
|
|
|
80596
|
-
if (
|
|
80594
|
+
if (hasObjectPattern(properties))
|
|
80595
|
+
return COUPLE_LINES;
|
|
80596
|
+
|
|
80597
|
+
if (moreCount && !moreLength && isVariableDeclarator$1(path.parentPath))
|
|
80597
80598
|
return ONE_LINE$1;
|
|
80598
80599
|
|
|
80599
80600
|
if (!fnParam && n && !isForOf$2(path) && checkLength(properties))
|
|
@@ -80781,13 +80782,13 @@ var operate = {};
|
|
|
80781
80782
|
|
|
80782
80783
|
var getBinding$2 = {};
|
|
80783
80784
|
|
|
80784
|
-
const {types: types$
|
|
80785
|
+
const {types: types$r} = bundle;
|
|
80785
80786
|
const {
|
|
80786
80787
|
isIdentifier: isIdentifier$8,
|
|
80787
80788
|
isMemberExpression: isMemberExpression$3,
|
|
80788
|
-
} = types$
|
|
80789
|
+
} = types$r;
|
|
80789
80790
|
|
|
80790
|
-
const isString$
|
|
80791
|
+
const isString$b = (a) => typeof a === 'string';
|
|
80791
80792
|
|
|
80792
80793
|
getBinding$2.getBinding = getBinding$1;
|
|
80793
80794
|
function getBinding$1(path, node) {
|
|
@@ -80798,7 +80799,7 @@ function getBinding$1(path, node) {
|
|
|
80798
80799
|
getBinding$2.getBindingPath = (path, name) => getBinding$1(path, name)?.path;
|
|
80799
80800
|
|
|
80800
80801
|
const parseName$1 = (node) => {
|
|
80801
|
-
if (isString$
|
|
80802
|
+
if (isString$b(node))
|
|
80802
80803
|
return node;
|
|
80803
80804
|
|
|
80804
80805
|
if (isIdentifier$8(node))
|
|
@@ -80812,13 +80813,13 @@ const parseName$1 = (node) => {
|
|
|
80812
80813
|
|
|
80813
80814
|
var isSimple$2 = {};
|
|
80814
80815
|
|
|
80815
|
-
const {types: types$
|
|
80816
|
+
const {types: types$q} = bundle;
|
|
80816
80817
|
const {
|
|
80817
80818
|
isOptionalMemberExpression,
|
|
80818
80819
|
isMemberExpression: isMemberExpression$2,
|
|
80819
80820
|
isIdentifier: isIdentifier$7,
|
|
80820
80821
|
isLiteral: isLiteral$3,
|
|
80821
|
-
} = types$
|
|
80822
|
+
} = types$q;
|
|
80822
80823
|
|
|
80823
80824
|
isSimple$2.isSimple = (a) => {
|
|
80824
80825
|
if (isLiteral$3(a))
|
|
@@ -80835,7 +80836,7 @@ isSimple$2.isSimple = (a) => {
|
|
|
80835
80836
|
|
|
80836
80837
|
var extract$6 = {};
|
|
80837
80838
|
|
|
80838
|
-
const {types: types$
|
|
80839
|
+
const {types: types$p} = bundle;
|
|
80839
80840
|
const {
|
|
80840
80841
|
isArrayExpression: isArrayExpression$3,
|
|
80841
80842
|
isLiteral: isLiteral$2,
|
|
@@ -80849,7 +80850,7 @@ const {
|
|
|
80849
80850
|
isJSXAttribute: isJSXAttribute$1,
|
|
80850
80851
|
isTSTypeReference: isTSTypeReference$2,
|
|
80851
80852
|
isTSTypeParameter,
|
|
80852
|
-
} = types$
|
|
80853
|
+
} = types$p;
|
|
80853
80854
|
|
|
80854
80855
|
extract$6.extract = extract$5;
|
|
80855
80856
|
|
|
@@ -81173,9 +81174,9 @@ rename$1.rename = (path, from, to) => {
|
|
|
81173
81174
|
bindingPath.scope.rename(from, to);
|
|
81174
81175
|
};
|
|
81175
81176
|
|
|
81176
|
-
var setLiteralValue$
|
|
81177
|
+
var setLiteralValue$2 = {};
|
|
81177
81178
|
|
|
81178
|
-
setLiteralValue$
|
|
81179
|
+
setLiteralValue$2.setLiteralValue = (path, newValue) => {
|
|
81179
81180
|
const node = path.node || path;
|
|
81180
81181
|
const {
|
|
81181
81182
|
raw,
|
|
@@ -81232,15 +81233,15 @@ function isRequire$1(path) {
|
|
|
81232
81233
|
|
|
81233
81234
|
var properties = {};
|
|
81234
81235
|
|
|
81235
|
-
var traverseProperties$
|
|
81236
|
+
var traverseProperties$4 = {};
|
|
81236
81237
|
|
|
81237
|
-
const {traverse: traverse$b, types: types$
|
|
81238
|
+
const {traverse: traverse$b, types: types$o} = bundle;
|
|
81238
81239
|
const {extract: extract$3} = extract$6;
|
|
81239
81240
|
|
|
81240
81241
|
const {
|
|
81241
81242
|
isObjectExpression: isObjectExpression$5,
|
|
81242
81243
|
isCallExpression: isCallExpression$3,
|
|
81243
|
-
} = types$
|
|
81244
|
+
} = types$o;
|
|
81244
81245
|
|
|
81245
81246
|
const nodeOrPath = (path) => path.node || path;
|
|
81246
81247
|
|
|
@@ -81257,7 +81258,7 @@ function getNode(path) {
|
|
|
81257
81258
|
};
|
|
81258
81259
|
}
|
|
81259
81260
|
|
|
81260
|
-
traverseProperties$
|
|
81261
|
+
traverseProperties$4.traverseProperties = (path, name, {firstLevel = false} = {}) => {
|
|
81261
81262
|
const collector = [];
|
|
81262
81263
|
const node = getNode(path);
|
|
81263
81264
|
|
|
@@ -81285,6 +81286,10 @@ const collect = ({name, collector}) => (path) => {
|
|
|
81285
81286
|
continue;
|
|
81286
81287
|
|
|
81287
81288
|
const keyPath = propertyPath.get('key');
|
|
81289
|
+
|
|
81290
|
+
if (keyPath.isConditionalExpression())
|
|
81291
|
+
continue;
|
|
81292
|
+
|
|
81288
81293
|
const currentName = extract$3(keyPath);
|
|
81289
81294
|
|
|
81290
81295
|
if (name === currentName)
|
|
@@ -81296,10 +81301,11 @@ const {
|
|
|
81296
81301
|
isObjectExpression: isObjectExpression$4,
|
|
81297
81302
|
isObjectPattern: isObjectPattern$1,
|
|
81298
81303
|
} = bundle.types;
|
|
81304
|
+
|
|
81299
81305
|
const {extract: extract$2} = extract$6;
|
|
81300
|
-
const {traverseProperties: traverseProperties$
|
|
81306
|
+
const {traverseProperties: traverseProperties$3} = traverseProperties$4;
|
|
81301
81307
|
|
|
81302
|
-
properties.traverseProperties = traverseProperties$
|
|
81308
|
+
properties.traverseProperties = traverseProperties$3;
|
|
81303
81309
|
|
|
81304
81310
|
properties.getProperties = (path, names) => {
|
|
81305
81311
|
const result = {};
|
|
@@ -81341,7 +81347,7 @@ properties.getProperty = (path, name) => {
|
|
|
81341
81347
|
|
|
81342
81348
|
var getLiteralRaw$1 = {};
|
|
81343
81349
|
|
|
81344
|
-
const isString$
|
|
81350
|
+
const isString$a = (a) => typeof a === 'string';
|
|
81345
81351
|
|
|
81346
81352
|
getLiteralRaw$1.getLiteralRaw = (path) => {
|
|
81347
81353
|
const {
|
|
@@ -81350,10 +81356,10 @@ getLiteralRaw$1.getLiteralRaw = (path) => {
|
|
|
81350
81356
|
value,
|
|
81351
81357
|
} = path.node || path;
|
|
81352
81358
|
|
|
81353
|
-
if (isString$
|
|
81359
|
+
if (isString$a(raw))
|
|
81354
81360
|
return raw;
|
|
81355
81361
|
|
|
81356
|
-
if (extra && isString$
|
|
81362
|
+
if (extra && isString$a(extra.raw))
|
|
81357
81363
|
return extra.raw;
|
|
81358
81364
|
|
|
81359
81365
|
return `'${maybeEncode$1(value)}'`;
|
|
@@ -81372,13 +81378,13 @@ var replaceWithMultiple$2 = {};
|
|
|
81372
81378
|
|
|
81373
81379
|
var maybeBody$2 = {};
|
|
81374
81380
|
|
|
81375
|
-
const {types: types$
|
|
81381
|
+
const {types: types$n} = bundle;
|
|
81376
81382
|
const {
|
|
81377
81383
|
isStatement: isStatement$4,
|
|
81378
81384
|
isBlockStatement: isBlockStatement$3,
|
|
81379
81385
|
BlockStatement: BlockStatement$1,
|
|
81380
81386
|
ExpressionStatement: ExpressionStatement$5,
|
|
81381
|
-
} = types$
|
|
81387
|
+
} = types$n;
|
|
81382
81388
|
|
|
81383
81389
|
maybeBody$2.maybeBody = (path, node) => {
|
|
81384
81390
|
const {parentPath} = path;
|
|
@@ -81399,12 +81405,12 @@ maybeBody$2.maybeBody = (path, node) => {
|
|
|
81399
81405
|
|
|
81400
81406
|
var toExpression$3 = {};
|
|
81401
81407
|
|
|
81402
|
-
const {types: types$
|
|
81408
|
+
const {types: types$m} = bundle;
|
|
81403
81409
|
const {
|
|
81404
81410
|
isExpression: isExpression$1,
|
|
81405
81411
|
ExpressionStatement: ExpressionStatement$4,
|
|
81406
81412
|
toStatement,
|
|
81407
|
-
} = types$
|
|
81413
|
+
} = types$m;
|
|
81408
81414
|
|
|
81409
81415
|
toExpression$3.toExpression = (el) => {
|
|
81410
81416
|
const {type} = el;
|
|
@@ -81454,7 +81460,7 @@ replaceWithMultiple$2.replaceWithMultiple = (path, nodes) => {
|
|
|
81454
81460
|
var replaceWith$6 = {};
|
|
81455
81461
|
|
|
81456
81462
|
const {maybeBody} = maybeBody$2;
|
|
81457
|
-
const {assign: assign$
|
|
81463
|
+
const {assign: assign$b} = Object;
|
|
81458
81464
|
|
|
81459
81465
|
replaceWith$6.replaceWith = (path, node) => {
|
|
81460
81466
|
if (path?.parentPath?.isExpressionStatement() && !path.parentPath.isProgram())
|
|
@@ -81465,7 +81471,7 @@ replaceWith$6.replaceWith = (path, node) => {
|
|
|
81465
81471
|
|
|
81466
81472
|
currentPath.replaceWith(node);
|
|
81467
81473
|
|
|
81468
|
-
assign$
|
|
81474
|
+
assign$b(currentPath.node, {
|
|
81469
81475
|
comments,
|
|
81470
81476
|
loc,
|
|
81471
81477
|
});
|
|
@@ -81481,7 +81487,7 @@ replaceWith$7.replaceWith = replaceWith$5;
|
|
|
81481
81487
|
replaceWith$7.replaceWithMultiple = replaceWithMultiple$1;
|
|
81482
81488
|
replaceWith$7.toExpression = toExpression$1;
|
|
81483
81489
|
|
|
81484
|
-
const {types: types$
|
|
81490
|
+
const {types: types$l} = bundle;
|
|
81485
81491
|
|
|
81486
81492
|
const {getBinding, getBindingPath} = getBinding$2;
|
|
81487
81493
|
const {isSimple: isSimple$1} = isSimple$2;
|
|
@@ -81491,13 +81497,13 @@ const {remove: remove$1} = remove$2;
|
|
|
81491
81497
|
const {getExportDefault} = getExportDefault$1;
|
|
81492
81498
|
const {rename} = rename$1;
|
|
81493
81499
|
const {renameProperty} = renameProperty$2;
|
|
81494
|
-
const {setLiteralValue: setLiteralValue$
|
|
81500
|
+
const {setLiteralValue: setLiteralValue$1} = setLiteralValue$2;
|
|
81495
81501
|
const {getPathAfterRequires} = getPathAfterRequires$1;
|
|
81496
81502
|
|
|
81497
81503
|
const {
|
|
81498
|
-
getProperty: getProperty$
|
|
81504
|
+
getProperty: getProperty$3,
|
|
81499
81505
|
getProperties,
|
|
81500
|
-
traverseProperties: traverseProperties$
|
|
81506
|
+
traverseProperties: traverseProperties$2,
|
|
81501
81507
|
} = properties;
|
|
81502
81508
|
|
|
81503
81509
|
const {getLiteralRaw} = getLiteralRaw$1;
|
|
@@ -81514,7 +81520,7 @@ const {
|
|
|
81514
81520
|
isImportDeclaration: isImportDeclaration$1,
|
|
81515
81521
|
isExportDeclaration: isExportDeclaration$4,
|
|
81516
81522
|
isStatement: isStatement$3,
|
|
81517
|
-
} = types$
|
|
81523
|
+
} = types$l;
|
|
81518
81524
|
|
|
81519
81525
|
operate.getBinding = getBinding;
|
|
81520
81526
|
operate.getBindingPath = getBindingPath;
|
|
@@ -81527,11 +81533,11 @@ operate.toExpression = toExpression;
|
|
|
81527
81533
|
operate.isSimple = isSimple$1;
|
|
81528
81534
|
operate.rename = rename;
|
|
81529
81535
|
operate.renameProperty = renameProperty;
|
|
81530
|
-
operate.setLiteralValue = setLiteralValue$
|
|
81536
|
+
operate.setLiteralValue = setLiteralValue$1;
|
|
81531
81537
|
|
|
81532
|
-
operate.getProperty = getProperty$
|
|
81538
|
+
operate.getProperty = getProperty$3;
|
|
81533
81539
|
operate.getProperties = getProperties;
|
|
81534
|
-
operate.traverseProperties = traverseProperties$
|
|
81540
|
+
operate.traverseProperties = traverseProperties$2;
|
|
81535
81541
|
|
|
81536
81542
|
operate.replaceWithMultiple = replaceWithMultiple;
|
|
81537
81543
|
|
|
@@ -81896,13 +81902,13 @@ newline.isCurrentNewLine = (path) => {
|
|
|
81896
81902
|
|
|
81897
81903
|
var indent = {};
|
|
81898
81904
|
|
|
81899
|
-
const {types: types$
|
|
81905
|
+
const {types: types$k} = bundle;
|
|
81900
81906
|
const {isIndented} = is$3;
|
|
81901
81907
|
|
|
81902
81908
|
const {
|
|
81903
81909
|
isStringLiteral: isStringLiteral$5,
|
|
81904
81910
|
isArrayExpression: isArrayExpression$1,
|
|
81905
|
-
} = types$
|
|
81911
|
+
} = types$k;
|
|
81906
81912
|
|
|
81907
81913
|
const isInsideArray$1 = (path) => path.parentPath.isArrayExpression();
|
|
81908
81914
|
|
|
@@ -81965,7 +81971,7 @@ isObjectAfterSimple$1.isObjectAfterSimple = (a) => {
|
|
|
81965
81971
|
return SIMPLE_TYPES.includes(type);
|
|
81966
81972
|
};
|
|
81967
81973
|
|
|
81968
|
-
const {types: types$
|
|
81974
|
+
const {types: types$j} = bundle;
|
|
81969
81975
|
const {
|
|
81970
81976
|
isCoupleLines: isCoupleLines$5,
|
|
81971
81977
|
isStringAndIdentifier,
|
|
@@ -81995,7 +82001,7 @@ const {
|
|
|
81995
82001
|
isStringLiteral: isStringLiteral$4,
|
|
81996
82002
|
isIdentifier: isIdentifier$5,
|
|
81997
82003
|
isFunction: isFunction$2,
|
|
81998
|
-
} = types$
|
|
82004
|
+
} = types$j;
|
|
81999
82005
|
|
|
82000
82006
|
const isNextString = (path) => isStringLiteral$4(path.getNextSibling());
|
|
82001
82007
|
const isPrevString = (path) => isStringLiteral$4(path.getPrevSibling());
|
|
@@ -82449,19 +82455,19 @@ staticBlock.StaticBlock = (path, {print, traverse}) => {
|
|
|
82449
82455
|
|
|
82450
82456
|
var recordExpression = {};
|
|
82451
82457
|
|
|
82452
|
-
const {ObjectExpression: ObjectExpression$
|
|
82458
|
+
const {ObjectExpression: ObjectExpression$3} = objectExpression;
|
|
82453
82459
|
|
|
82454
82460
|
recordExpression.RecordExpression = (path, operations, semantics) => {
|
|
82455
82461
|
const {write} = operations;
|
|
82456
82462
|
write('#');
|
|
82457
|
-
ObjectExpression$
|
|
82463
|
+
ObjectExpression$3(path, operations, semantics);
|
|
82458
82464
|
};
|
|
82459
82465
|
|
|
82460
82466
|
var tupleExpression = {};
|
|
82461
82467
|
|
|
82462
82468
|
var maybe = {};
|
|
82463
82469
|
|
|
82464
|
-
const isString$
|
|
82470
|
+
const isString$9 = (a) => typeof a === 'string';
|
|
82465
82471
|
const constant = (a) => () => a;
|
|
82466
82472
|
const {keys: keys$3} = Object;
|
|
82467
82473
|
|
|
@@ -82487,7 +82493,7 @@ var rendy$1 = (template, values, modifiers) => {
|
|
|
82487
82493
|
};
|
|
82488
82494
|
|
|
82489
82495
|
function check$c(template, values) {
|
|
82490
|
-
if (!isString$
|
|
82496
|
+
if (!isString$9(template))
|
|
82491
82497
|
throw Error('template should be a string!');
|
|
82492
82498
|
|
|
82493
82499
|
if (typeof values !== 'object')
|
|
@@ -82549,7 +82555,7 @@ const rendy = rendy$1;
|
|
|
82549
82555
|
const maybeSatisfy = satisfy_1;
|
|
82550
82556
|
|
|
82551
82557
|
const {
|
|
82552
|
-
isProgram: isProgram$
|
|
82558
|
+
isProgram: isProgram$3,
|
|
82553
82559
|
isFile: isFile$1,
|
|
82554
82560
|
File,
|
|
82555
82561
|
ExpressionStatement: ExpressionStatement$2,
|
|
@@ -82571,7 +82577,7 @@ maybe.maybeThrow = (a, path, b) => {
|
|
|
82571
82577
|
|
|
82572
82578
|
const maybeStatement = (ast) => isStatement$2(ast) ? ast : ExpressionStatement$2(ast);
|
|
82573
82579
|
|
|
82574
|
-
const maybeProgram = (ast) => isProgram$
|
|
82580
|
+
const maybeProgram = (ast) => isProgram$3(ast) ? ast : Program$1([
|
|
82575
82581
|
maybeStatement(ast),
|
|
82576
82582
|
]);
|
|
82577
82583
|
|
|
@@ -82604,13 +82610,13 @@ function objectPlugin(plugin, path, printer, options) {
|
|
|
82604
82610
|
after(path, printer);
|
|
82605
82611
|
}
|
|
82606
82612
|
|
|
82607
|
-
const {ArrayExpression: ArrayExpression$
|
|
82613
|
+
const {ArrayExpression: ArrayExpression$4} = arrayExpression;
|
|
82608
82614
|
const {maybeVisitor: maybeVisitor$2} = maybe;
|
|
82609
82615
|
|
|
82610
82616
|
tupleExpression.TupleExpression = (path, operations, semantics) => {
|
|
82611
82617
|
const {write} = operations;
|
|
82612
82618
|
write('#');
|
|
82613
|
-
maybeVisitor$2(ArrayExpression$
|
|
82619
|
+
maybeVisitor$2(ArrayExpression$4, path, operations, semantics);
|
|
82614
82620
|
};
|
|
82615
82621
|
|
|
82616
82622
|
var importExpression = {};
|
|
@@ -82648,8 +82654,8 @@ const {
|
|
|
82648
82654
|
|
|
82649
82655
|
const {NewExpression} = newExpression;
|
|
82650
82656
|
|
|
82651
|
-
const {ObjectExpression: ObjectExpression$
|
|
82652
|
-
const {ObjectProperty: ObjectProperty$
|
|
82657
|
+
const {ObjectExpression: ObjectExpression$2} = objectExpression;
|
|
82658
|
+
const {ObjectProperty: ObjectProperty$3} = objectProperty;
|
|
82653
82659
|
const {ObjectPattern: ObjectPattern$1} = objectPattern;
|
|
82654
82660
|
|
|
82655
82661
|
const {
|
|
@@ -82660,7 +82666,7 @@ const {
|
|
|
82660
82666
|
} = classProperty;
|
|
82661
82667
|
|
|
82662
82668
|
const {AssignmentExpression} = assignmentExpression;
|
|
82663
|
-
const {ArrayExpression: ArrayExpression$
|
|
82669
|
+
const {ArrayExpression: ArrayExpression$3} = arrayExpression;
|
|
82664
82670
|
const {ArrayPattern} = arrayPattern;
|
|
82665
82671
|
const {AssignmentPattern} = assignmentPattern;
|
|
82666
82672
|
const {RestElement} = restElement;
|
|
@@ -82684,7 +82690,7 @@ var expressions$1 = {
|
|
|
82684
82690
|
...unaryExpressions,
|
|
82685
82691
|
...memberExpressions,
|
|
82686
82692
|
ArrayPattern,
|
|
82687
|
-
ArrayExpression: ArrayExpression$
|
|
82693
|
+
ArrayExpression: ArrayExpression$3,
|
|
82688
82694
|
AssignmentExpression,
|
|
82689
82695
|
AssignmentPattern,
|
|
82690
82696
|
BinaryExpression,
|
|
@@ -82698,8 +82704,8 @@ var expressions$1 = {
|
|
|
82698
82704
|
NewExpression,
|
|
82699
82705
|
LogicalExpression,
|
|
82700
82706
|
OptionalCallExpression,
|
|
82701
|
-
ObjectExpression: ObjectExpression$
|
|
82702
|
-
ObjectProperty: ObjectProperty$
|
|
82707
|
+
ObjectExpression: ObjectExpression$2,
|
|
82708
|
+
ObjectProperty: ObjectProperty$3,
|
|
82703
82709
|
ObjectPattern: ObjectPattern$1,
|
|
82704
82710
|
PrivateName: PrivateName$1,
|
|
82705
82711
|
RestElement,
|
|
@@ -83774,11 +83780,11 @@ importDeclaration.ImportDeclaration = {
|
|
|
83774
83780
|
maybe.write.breakline(importsCount >= maxSpecifiersInOneLine);
|
|
83775
83781
|
|
|
83776
83782
|
wasSpecifier = true;
|
|
83777
|
-
|
|
83783
|
+
traverse(spec.get('imported'));
|
|
83778
83784
|
|
|
83779
83785
|
if (imported.name !== local.name) {
|
|
83780
83786
|
write(' as ');
|
|
83781
|
-
write(
|
|
83787
|
+
write(local.name);
|
|
83782
83788
|
}
|
|
83783
83789
|
|
|
83784
83790
|
if (importsCount < maxSpecifiersInOneLine && notLast) {
|
|
@@ -84412,7 +84418,7 @@ const {TemplateLiteral} = templateLiteral;
|
|
|
84412
84418
|
const {Identifier: Identifier$2} = identifier;
|
|
84413
84419
|
|
|
84414
84420
|
const {Decorator} = decorator;
|
|
84415
|
-
const {StringLiteral: StringLiteral$
|
|
84421
|
+
const {StringLiteral: StringLiteral$5} = stringLiteral;
|
|
84416
84422
|
|
|
84417
84423
|
var literals$1 = {
|
|
84418
84424
|
Identifier: Identifier$2,
|
|
@@ -84443,7 +84449,7 @@ var literals$1 = {
|
|
|
84443
84449
|
BooleanLiteral(path, {write}) {
|
|
84444
84450
|
write(path.node.value);
|
|
84445
84451
|
},
|
|
84446
|
-
StringLiteral: StringLiteral$
|
|
84452
|
+
StringLiteral: StringLiteral$5,
|
|
84447
84453
|
RegExpLiteral(path, {print}) {
|
|
84448
84454
|
const {raw, pattern} = path.node;
|
|
84449
84455
|
print(raw || `/${pattern}/`);
|
|
@@ -84550,8 +84556,8 @@ tsTypeAliasDeclaration.TSTypeAliasDeclaration = {
|
|
|
84550
84556
|
|
|
84551
84557
|
var tsMappedType = {};
|
|
84552
84558
|
|
|
84553
|
-
const {types: types$
|
|
84554
|
-
const {isTSConditionalType} = types$
|
|
84559
|
+
const {types: types$i} = bundle;
|
|
84560
|
+
const {isTSConditionalType} = types$i;
|
|
84555
84561
|
|
|
84556
84562
|
tsMappedType.TSMappedType = (path, {print, indent, maybe}) => {
|
|
84557
84563
|
const {
|
|
@@ -85019,20 +85025,37 @@ tsTupleType.TSTupleType = (path, {write, traverse, indent, maybe}) => {
|
|
|
85019
85025
|
|
|
85020
85026
|
write('[');
|
|
85021
85027
|
indent.inc();
|
|
85022
|
-
maybe.write.newline(elementTypes.length);
|
|
85023
85028
|
|
|
85024
|
-
|
|
85025
|
-
|
|
85029
|
+
const isSame = isSameType(elementTypes);
|
|
85030
|
+
maybe.write.newline(isSame && elementTypes.length);
|
|
85031
|
+
const n = elementTypes.length - 1;
|
|
85032
|
+
|
|
85033
|
+
for (const [i, elementType] of elementTypes.entries()) {
|
|
85034
|
+
maybe.indent(isSame);
|
|
85026
85035
|
traverse(elementType);
|
|
85027
|
-
write(',');
|
|
85028
|
-
write.newline();
|
|
85036
|
+
maybe.write(i < n || isSame, ',');
|
|
85037
|
+
maybe.write.newline(isSame);
|
|
85038
|
+
maybe.write.space(i < n && !isSame);
|
|
85029
85039
|
}
|
|
85030
85040
|
|
|
85031
85041
|
indent.dec();
|
|
85032
|
-
indent();
|
|
85042
|
+
maybe.indent(isSame && elementTypes.length);
|
|
85033
85043
|
write(']');
|
|
85034
85044
|
};
|
|
85035
85045
|
|
|
85046
|
+
function isSameType(array) {
|
|
85047
|
+
let type;
|
|
85048
|
+
|
|
85049
|
+
for (const current of array) {
|
|
85050
|
+
if (type && current.type !== type)
|
|
85051
|
+
return false;
|
|
85052
|
+
|
|
85053
|
+
({type} = current);
|
|
85054
|
+
}
|
|
85055
|
+
|
|
85056
|
+
return true;
|
|
85057
|
+
}
|
|
85058
|
+
|
|
85036
85059
|
var tsNamedTupleMember = {};
|
|
85037
85060
|
|
|
85038
85061
|
tsNamedTupleMember.TSNamedTupleMember = (path, {print}) => {
|
|
@@ -85161,15 +85184,52 @@ tsTypeReference.TSTypeReference = (path, {print}) => {
|
|
|
85161
85184
|
print('__typeParameters');
|
|
85162
85185
|
};
|
|
85163
85186
|
|
|
85164
|
-
var
|
|
85187
|
+
var tsInferType = {};
|
|
85165
85188
|
|
|
85166
85189
|
const {maybeParens} = maybeParens$8;
|
|
85167
85190
|
|
|
85168
|
-
|
|
85191
|
+
tsInferType.TSInferType = maybeParens((path, {print}) => {
|
|
85169
85192
|
print('infer ');
|
|
85170
85193
|
print('__typeParameter');
|
|
85171
85194
|
});
|
|
85172
85195
|
|
|
85196
|
+
var tsParameterProperty = {};
|
|
85197
|
+
|
|
85198
|
+
tsParameterProperty.TSParameterProperty = (path, {print, maybe}) => {
|
|
85199
|
+
const {
|
|
85200
|
+
decorators,
|
|
85201
|
+
readonly,
|
|
85202
|
+
accessibility,
|
|
85203
|
+
} = path.node;
|
|
85204
|
+
|
|
85205
|
+
const decoratorsLength = decorators?.length;
|
|
85206
|
+
|
|
85207
|
+
maybe.print.breakline(decoratorsLength);
|
|
85208
|
+
|
|
85209
|
+
if (decorators)
|
|
85210
|
+
for (const decorator of path.get('decorators')) {
|
|
85211
|
+
print.indent();
|
|
85212
|
+
print(decorator);
|
|
85213
|
+
}
|
|
85214
|
+
|
|
85215
|
+
maybe.print.breakline(decoratorsLength);
|
|
85216
|
+
maybe.indent(decoratorsLength);
|
|
85217
|
+
|
|
85218
|
+
if (accessibility) {
|
|
85219
|
+
print(accessibility);
|
|
85220
|
+
print.space();
|
|
85221
|
+
}
|
|
85222
|
+
|
|
85223
|
+
if (readonly) {
|
|
85224
|
+
print('readonly');
|
|
85225
|
+
print.space();
|
|
85226
|
+
}
|
|
85227
|
+
|
|
85228
|
+
print('__parameter');
|
|
85229
|
+
maybe.print(decoratorsLength, ',');
|
|
85230
|
+
maybe.print.breakline(decoratorsLength);
|
|
85231
|
+
};
|
|
85232
|
+
|
|
85173
85233
|
const {isNext: isNext$1} = is$3;
|
|
85174
85234
|
const {TSTypeLiteral} = tsTypeLiteral;
|
|
85175
85235
|
const {TSTypeAliasDeclaration} = tsTypeAliasDeclaration;
|
|
@@ -85209,7 +85269,8 @@ const {maybePrintTypeAnnotation} = maybeTypeAnnotation$4;
|
|
|
85209
85269
|
const {TSImportType} = tsImportType;
|
|
85210
85270
|
const {TSExportAssignment} = tsExportAssignment;
|
|
85211
85271
|
const {TSTypeReference} = tsTypeReference;
|
|
85212
|
-
const {TSInferType} =
|
|
85272
|
+
const {TSInferType} = tsInferType;
|
|
85273
|
+
const {TSParameterProperty} = tsParameterProperty;
|
|
85213
85274
|
|
|
85214
85275
|
var typescript$1 = {
|
|
85215
85276
|
TSAsExpression,
|
|
@@ -85343,14 +85404,10 @@ var typescript$1 = {
|
|
|
85343
85404
|
print('.');
|
|
85344
85405
|
print('__right');
|
|
85345
85406
|
},
|
|
85346
|
-
TSParameterProperty(path, {write, print}) {
|
|
85347
|
-
write(path.node.accessibility);
|
|
85348
|
-
write.space();
|
|
85349
|
-
print('__parameter');
|
|
85350
|
-
},
|
|
85351
85407
|
TSTypeAnnotation(path, {print}) {
|
|
85352
85408
|
print('__typeAnnotation');
|
|
85353
85409
|
},
|
|
85410
|
+
TSParameterProperty,
|
|
85354
85411
|
TSConstructSignatureDeclaration,
|
|
85355
85412
|
TSIndexSignature(path, printer) {
|
|
85356
85413
|
const {print} = printer;
|
|
@@ -85707,7 +85764,7 @@ function snakeCase(str) {
|
|
|
85707
85764
|
}
|
|
85708
85765
|
|
|
85709
85766
|
const {stringify: stringify$8} = JSON;
|
|
85710
|
-
const {TYPES: TYPES$2} = types$
|
|
85767
|
+
const {TYPES: TYPES$2} = types$w;
|
|
85711
85768
|
const toSnakeCase = justSnakeCase;
|
|
85712
85769
|
|
|
85713
85770
|
const {codeFrameColumns: codeFrameColumns$1} = bundle;
|
|
@@ -85875,10 +85932,10 @@ function initSemantics(semantics = {}) {
|
|
|
85875
85932
|
}
|
|
85876
85933
|
|
|
85877
85934
|
const {round} = Math;
|
|
85878
|
-
const fullstore$
|
|
85935
|
+
const fullstore$2 = fullstore$3;
|
|
85879
85936
|
const isObject$4 = (a) => a && typeof a === 'object';
|
|
85880
85937
|
const babelTraverse$2 = bundle.traverse;
|
|
85881
|
-
const {TYPES: TYPES$1} = types$
|
|
85938
|
+
const {TYPES: TYPES$1} = types$w;
|
|
85882
85939
|
const baseVisitors = visitors$1;
|
|
85883
85940
|
|
|
85884
85941
|
const {
|
|
@@ -85897,8 +85954,8 @@ const {
|
|
|
85897
85954
|
|
|
85898
85955
|
const {parseOverrides} = overrides;
|
|
85899
85956
|
|
|
85900
|
-
const isString$
|
|
85901
|
-
const {assign: assign$
|
|
85957
|
+
const isString$8 = (a) => typeof a === 'string';
|
|
85958
|
+
const {assign: assign$a, freeze} = Object;
|
|
85902
85959
|
|
|
85903
85960
|
const GET = '__';
|
|
85904
85961
|
const get = (path, command) => path.get(command.replace(GET, ''));
|
|
@@ -85949,7 +86006,7 @@ tokenize$1.tokenize = (ast, overrides) => {
|
|
|
85949
86006
|
});
|
|
85950
86007
|
};
|
|
85951
86008
|
|
|
85952
|
-
assign$
|
|
86009
|
+
assign$a(indent, {
|
|
85953
86010
|
inc: incIndent,
|
|
85954
86011
|
dec: decIndent,
|
|
85955
86012
|
});
|
|
@@ -85999,7 +86056,7 @@ tokenize$1.tokenize = (ast, overrides) => {
|
|
|
85999
86056
|
});
|
|
86000
86057
|
};
|
|
86001
86058
|
|
|
86002
|
-
assign$
|
|
86059
|
+
assign$a(write, {
|
|
86003
86060
|
indent,
|
|
86004
86061
|
newline,
|
|
86005
86062
|
linebreak,
|
|
@@ -86010,7 +86067,7 @@ tokenize$1.tokenize = (ast, overrides) => {
|
|
|
86010
86067
|
endOfFile,
|
|
86011
86068
|
});
|
|
86012
86069
|
|
|
86013
|
-
assign$
|
|
86070
|
+
assign$a(maybeWrite, {
|
|
86014
86071
|
newline: maybeNewline,
|
|
86015
86072
|
breakline: maybeBreakline,
|
|
86016
86073
|
linebreak: maybeLinebreak,
|
|
@@ -86024,7 +86081,7 @@ tokenize$1.tokenize = (ast, overrides) => {
|
|
|
86024
86081
|
space: maybeSpace,
|
|
86025
86082
|
};
|
|
86026
86083
|
|
|
86027
|
-
assign$
|
|
86084
|
+
assign$a(maybe.indent, {
|
|
86028
86085
|
inc: maybeIndentInc,
|
|
86029
86086
|
dec: maybeIndentDec,
|
|
86030
86087
|
});
|
|
@@ -86037,7 +86094,7 @@ tokenize$1.tokenize = (ast, overrides) => {
|
|
|
86037
86094
|
traverse,
|
|
86038
86095
|
maybe,
|
|
86039
86096
|
quote,
|
|
86040
|
-
store: fullstore$
|
|
86097
|
+
store: fullstore$2(),
|
|
86041
86098
|
});
|
|
86042
86099
|
|
|
86043
86100
|
const currentTraversers = {
|
|
@@ -86067,7 +86124,7 @@ tokenize$1.tokenize = (ast, overrides) => {
|
|
|
86067
86124
|
traverse,
|
|
86068
86125
|
});
|
|
86069
86126
|
|
|
86070
|
-
assign$
|
|
86127
|
+
assign$a(print, write, {
|
|
86071
86128
|
space,
|
|
86072
86129
|
round,
|
|
86073
86130
|
});
|
|
@@ -86079,14 +86136,14 @@ tokenize$1.tokenize = (ast, overrides) => {
|
|
|
86079
86136
|
|
|
86080
86137
|
const maybePrint = (a, b) => a && print(b);
|
|
86081
86138
|
|
|
86082
|
-
assign$
|
|
86139
|
+
assign$a(maybePrint, {
|
|
86083
86140
|
newline: maybeNewline,
|
|
86084
86141
|
breakline: maybeBreakline,
|
|
86085
86142
|
linebreak: maybeLinebreak,
|
|
86086
86143
|
space: maybeSpace,
|
|
86087
86144
|
});
|
|
86088
86145
|
|
|
86089
|
-
assign$
|
|
86146
|
+
assign$a(printer.maybe, {
|
|
86090
86147
|
print: maybePrint,
|
|
86091
86148
|
});
|
|
86092
86149
|
|
|
@@ -86129,7 +86186,7 @@ const createPrint = (path, {traverse, write}) => (maybeLine) => {
|
|
|
86129
86186
|
};
|
|
86130
86187
|
|
|
86131
86188
|
const computePath = (path, maybeLine) => {
|
|
86132
|
-
if (isString$
|
|
86189
|
+
if (isString$8(maybeLine) && maybeLine.startsWith(GET))
|
|
86133
86190
|
return get(path, maybeLine);
|
|
86134
86191
|
|
|
86135
86192
|
if (isObject$4(maybeLine))
|
|
@@ -86347,9 +86404,9 @@ const putoutPrinter = printer;
|
|
|
86347
86404
|
const {generate: generate$5} = bundle;
|
|
86348
86405
|
|
|
86349
86406
|
const {stringify: stringify$7} = JSON;
|
|
86350
|
-
const {isArray: isArray$
|
|
86407
|
+
const {isArray: isArray$d} = Array;
|
|
86351
86408
|
|
|
86352
|
-
const maybeArray$
|
|
86409
|
+
const maybeArray$7 = (a) => isArray$d(a) ? a : [a, {}];
|
|
86353
86410
|
|
|
86354
86411
|
const btoa$1 = (a) => Buffer.from(a, 'binary').toString('base64');
|
|
86355
86412
|
|
|
@@ -86358,7 +86415,7 @@ const fixStrictMode = (a) => a.replace(`\n\n\n'use strict'`, `\n\n'use strict'`)
|
|
|
86358
86415
|
|
|
86359
86416
|
var print$4 = (ast, options = {}) => {
|
|
86360
86417
|
const {sourceMapName} = options;
|
|
86361
|
-
const [printer = 'putout', printerOptions] = maybeArray$
|
|
86418
|
+
const [printer = 'putout', printerOptions] = maybeArray$7(options.printer);
|
|
86362
86419
|
|
|
86363
86420
|
if (printer === 'recast') {
|
|
86364
86421
|
const printOptions = {
|
|
@@ -86402,7 +86459,7 @@ const {
|
|
|
86402
86459
|
ObjectMethod,
|
|
86403
86460
|
} = bundle.types;
|
|
86404
86461
|
|
|
86405
|
-
const {assign: assign$
|
|
86462
|
+
const {assign: assign$9} = Object;
|
|
86406
86463
|
|
|
86407
86464
|
var traverseObjectExpression$1 = (propertiesPaths) => {
|
|
86408
86465
|
for (const propPath of propertiesPaths) {
|
|
@@ -86416,7 +86473,7 @@ var traverseObjectExpression$1 = (propertiesPaths) => {
|
|
|
86416
86473
|
if (method && isFunctionExpression(value)) {
|
|
86417
86474
|
propPath.replaceWith(ObjectMethod('method', key, value.params, value.body, computed));
|
|
86418
86475
|
|
|
86419
|
-
assign$
|
|
86476
|
+
assign$9(propPath.node, {
|
|
86420
86477
|
id: null,
|
|
86421
86478
|
method: true,
|
|
86422
86479
|
generator: value.generator,
|
|
@@ -86445,7 +86502,7 @@ const {
|
|
|
86445
86502
|
Identifier: Identifier$1,
|
|
86446
86503
|
} = bundle.types;
|
|
86447
86504
|
|
|
86448
|
-
const {assign: assign$
|
|
86505
|
+
const {assign: assign$8} = Object;
|
|
86449
86506
|
|
|
86450
86507
|
var setClassMethod$1 = (path) => {
|
|
86451
86508
|
const {node} = path;
|
|
@@ -86473,7 +86530,7 @@ var setClassMethod$1 = (path) => {
|
|
|
86473
86530
|
});
|
|
86474
86531
|
|
|
86475
86532
|
path.replaceWith(method);
|
|
86476
|
-
assign$
|
|
86533
|
+
assign$8(path.node, {
|
|
86477
86534
|
loc,
|
|
86478
86535
|
expression,
|
|
86479
86536
|
generator,
|
|
@@ -86567,12 +86624,12 @@ var convertImportDeclaration$1 = (path) => {
|
|
|
86567
86624
|
path.node.attributes = attributes;
|
|
86568
86625
|
};
|
|
86569
86626
|
|
|
86570
|
-
const {assign: assign$
|
|
86627
|
+
const {assign: assign$7} = Object;
|
|
86571
86628
|
|
|
86572
86629
|
var convertExportDeclaration$1 = (path) => {
|
|
86573
86630
|
const {attributes = []} = path.node;
|
|
86574
86631
|
|
|
86575
|
-
assign$
|
|
86632
|
+
assign$7(path.node, {
|
|
86576
86633
|
attributes,
|
|
86577
86634
|
});
|
|
86578
86635
|
};
|
|
@@ -86701,7 +86758,7 @@ function getCommentGroup({trailing, leading}) {
|
|
|
86701
86758
|
return 'innerComments'; // Dangling comments, such as `[/* a */]`.
|
|
86702
86759
|
}
|
|
86703
86760
|
|
|
86704
|
-
const isString$
|
|
86761
|
+
const isString$7 = (a) => typeof a === 'string';
|
|
86705
86762
|
const isNumber$1 = (a) => typeof a === 'number';
|
|
86706
86763
|
const isNull = (a) => a === null;
|
|
86707
86764
|
const isBool$3 = (a) => typeof a === 'boolean';
|
|
@@ -86717,7 +86774,7 @@ var setLiteral$1 = (node) => {
|
|
|
86717
86774
|
return;
|
|
86718
86775
|
}
|
|
86719
86776
|
|
|
86720
|
-
if (isString$
|
|
86777
|
+
if (isString$7(value)) {
|
|
86721
86778
|
node.type = 'StringLiteral';
|
|
86722
86779
|
return;
|
|
86723
86780
|
}
|
|
@@ -86773,7 +86830,7 @@ var getAst = (node) => {
|
|
|
86773
86830
|
return ast;
|
|
86774
86831
|
};
|
|
86775
86832
|
|
|
86776
|
-
const {traverse: traverse$a, types: types$
|
|
86833
|
+
const {traverse: traverse$a, types: types$h} = bundle;
|
|
86777
86834
|
|
|
86778
86835
|
const traverseObjectExpression = traverseObjectExpression$1;
|
|
86779
86836
|
const setClassMethod = setClassMethod$1;
|
|
@@ -86799,7 +86856,7 @@ const getAST = getAst;
|
|
|
86799
86856
|
const {
|
|
86800
86857
|
isObjectExpression,
|
|
86801
86858
|
isExportDeclaration,
|
|
86802
|
-
} = types$
|
|
86859
|
+
} = types$h;
|
|
86803
86860
|
|
|
86804
86861
|
var estreeToBabel = (node) => {
|
|
86805
86862
|
const ast = getAST(node);
|
|
@@ -94381,7 +94438,7 @@ const options = options$1;
|
|
|
94381
94438
|
const getFlow = (a) => !a.indexOf('// @flow');
|
|
94382
94439
|
const clean = (a) => a.filter(Boolean);
|
|
94383
94440
|
const initBabel = once$6(() => bundle);
|
|
94384
|
-
const {assign: assign$
|
|
94441
|
+
const {assign: assign$6} = Object;
|
|
94385
94442
|
|
|
94386
94443
|
// There is a difference in options naming for babel and recast
|
|
94387
94444
|
// recast -> sourceFileName
|
|
@@ -94403,7 +94460,7 @@ babel$1.parse = function babelParse(source, {sourceFilename, isTS, isJSX = true,
|
|
|
94403
94460
|
]),
|
|
94404
94461
|
};
|
|
94405
94462
|
|
|
94406
|
-
sourceFilename && assign$
|
|
94463
|
+
sourceFilename && assign$6(parserOptions, {
|
|
94407
94464
|
sourceFilename,
|
|
94408
94465
|
});
|
|
94409
94466
|
|
|
@@ -107198,7 +107255,7 @@ function isAbsolute(path) {
|
|
|
107198
107255
|
}
|
|
107199
107256
|
|
|
107200
107257
|
// posix version
|
|
107201
|
-
function join$
|
|
107258
|
+
function join$3() {
|
|
107202
107259
|
var paths = Array.prototype.slice.call(arguments, 0);
|
|
107203
107260
|
return normalize(filter$1(paths, function(p, index) {
|
|
107204
107261
|
if (typeof p !== 'string') {
|
|
@@ -107273,7 +107330,7 @@ function dirname$1(path) {
|
|
|
107273
107330
|
return root + dir;
|
|
107274
107331
|
}
|
|
107275
107332
|
|
|
107276
|
-
function basename$
|
|
107333
|
+
function basename$3(path, ext) {
|
|
107277
107334
|
var f = splitPath(path)[2];
|
|
107278
107335
|
// TODO: make this comparison case-insensitive on windows?
|
|
107279
107336
|
if (ext && f.substr(-1 * ext.length) === ext) {
|
|
@@ -107288,12 +107345,12 @@ function extname(path) {
|
|
|
107288
107345
|
}
|
|
107289
107346
|
var _polyfillNode_path = {
|
|
107290
107347
|
extname: extname,
|
|
107291
|
-
basename: basename$
|
|
107348
|
+
basename: basename$3,
|
|
107292
107349
|
dirname: dirname$1,
|
|
107293
107350
|
sep: sep,
|
|
107294
107351
|
delimiter: delimiter,
|
|
107295
107352
|
relative: relative$1,
|
|
107296
|
-
join: join$
|
|
107353
|
+
join: join$3,
|
|
107297
107354
|
isAbsolute: isAbsolute,
|
|
107298
107355
|
normalize: normalize,
|
|
107299
107356
|
resolve: resolve
|
|
@@ -107318,13 +107375,13 @@ var substr = 'ab'.substr(-1) === 'b' ?
|
|
|
107318
107375
|
|
|
107319
107376
|
var _polyfillNode_path$1 = /*#__PURE__*/Object.freeze({
|
|
107320
107377
|
__proto__: null,
|
|
107321
|
-
basename: basename$
|
|
107378
|
+
basename: basename$3,
|
|
107322
107379
|
default: _polyfillNode_path,
|
|
107323
107380
|
delimiter: delimiter,
|
|
107324
107381
|
dirname: dirname$1,
|
|
107325
107382
|
extname: extname,
|
|
107326
107383
|
isAbsolute: isAbsolute,
|
|
107327
|
-
join: join$
|
|
107384
|
+
join: join$3,
|
|
107328
107385
|
normalize: normalize,
|
|
107329
107386
|
relative: relative$1,
|
|
107330
107387
|
resolve: resolve,
|
|
@@ -112423,7 +112480,7 @@ hermes$1.parse = function hermesParse(source) {
|
|
|
112423
112480
|
return parser.parse(source, options);
|
|
112424
112481
|
};
|
|
112425
112482
|
|
|
112426
|
-
var tryCatch$
|
|
112483
|
+
var tryCatch$6 = (fn, ...args) => {
|
|
112427
112484
|
try {
|
|
112428
112485
|
return [null, fn(...args)];
|
|
112429
112486
|
} catch(e) {
|
|
@@ -112431,11 +112488,11 @@ var tryCatch$9 = (fn, ...args) => {
|
|
|
112431
112488
|
}
|
|
112432
112489
|
};
|
|
112433
112490
|
|
|
112434
|
-
const tryCatch$
|
|
112491
|
+
const tryCatch$5 = tryCatch$6;
|
|
112435
112492
|
|
|
112436
112493
|
var secondChance$1 = (fn, source, messages, args) => {
|
|
112437
112494
|
const [a, ...others] = args;
|
|
112438
|
-
const [errorA, resultA] = tryCatch$
|
|
112495
|
+
const [errorA, resultA] = tryCatch$5(fn, source, a);
|
|
112439
112496
|
|
|
112440
112497
|
if (!errorA)
|
|
112441
112498
|
return resultA;
|
|
@@ -112444,7 +112501,7 @@ var secondChance$1 = (fn, source, messages, args) => {
|
|
|
112444
112501
|
throw errorA;
|
|
112445
112502
|
|
|
112446
112503
|
for (const b of others) {
|
|
112447
|
-
const [errorB, resultB] = tryCatch$
|
|
112504
|
+
const [errorB, resultB] = tryCatch$5(fn, source, b);
|
|
112448
112505
|
|
|
112449
112506
|
if (!errorB)
|
|
112450
112507
|
return resultB;
|
|
@@ -112533,13 +112590,13 @@ function customParse(source, {parser, isTS, isFlow, isJSX, isRecovery}) {
|
|
|
112533
112590
|
return commonjsRequire(parser).parse(source);
|
|
112534
112591
|
}
|
|
112535
112592
|
|
|
112536
|
-
const {types: types$
|
|
112593
|
+
const {types: types$g} = bundle;
|
|
112537
112594
|
const {
|
|
112538
|
-
StringLiteral: StringLiteral$
|
|
112595
|
+
StringLiteral: StringLiteral$4,
|
|
112539
112596
|
ExpressionStatement,
|
|
112540
|
-
} = types$
|
|
112597
|
+
} = types$g;
|
|
112541
112598
|
|
|
112542
|
-
const {assign: assign$
|
|
112599
|
+
const {assign: assign$5} = Object;
|
|
112543
112600
|
|
|
112544
112601
|
var moveOutDirectives$1 = (ast) => {
|
|
112545
112602
|
const {body, directives} = ast.program;
|
|
@@ -112552,7 +112609,7 @@ var moveOutDirectives$1 = (ast) => {
|
|
|
112552
112609
|
for (const directive of directives) {
|
|
112553
112610
|
const {leadingComments} = directive;
|
|
112554
112611
|
const {value} = directive.value;
|
|
112555
|
-
const expression = assign$
|
|
112612
|
+
const expression = assign$5(ExpressionStatement(StringLiteral$4(value)), {
|
|
112556
112613
|
leadingComments,
|
|
112557
112614
|
});
|
|
112558
112615
|
|
|
@@ -112876,9 +112933,9 @@ var require$$1 = /*@__PURE__*/getAugmentedNamespace(_polyfillNode_module$1);
|
|
|
112876
112933
|
|
|
112877
112934
|
const {createRequire} = require$$1;
|
|
112878
112935
|
|
|
112879
|
-
const tryCatch$
|
|
112936
|
+
const tryCatch$4 = tryCatch$6;
|
|
112880
112937
|
const once$1 = onceExports;
|
|
112881
|
-
const {assign: assign$
|
|
112938
|
+
const {assign: assign$4} = Object;
|
|
112882
112939
|
|
|
112883
112940
|
const bigFirst = (a) => `${a[0].toUpperCase()}${a.slice(1)}`;
|
|
112884
112941
|
|
|
@@ -112888,11 +112945,11 @@ const load = (type) => ({name, namespace}) => {
|
|
|
112888
112945
|
if (!pluginPath)
|
|
112889
112946
|
throw Error(`${bigFirst(type)} "${namespace}-${type}-${name}" could not be found!`);
|
|
112890
112947
|
|
|
112891
|
-
const [error, result] = tryCatch$
|
|
112948
|
+
const [error, result] = tryCatch$4(customRequire, pluginPath);
|
|
112892
112949
|
|
|
112893
112950
|
/* c8 ignore start */
|
|
112894
112951
|
if (error?.code === 'ERR_REQUIRE_ESM')
|
|
112895
|
-
assign$
|
|
112952
|
+
assign$4(error, {
|
|
112896
112953
|
message: `☝️ Looks like '${name}' is ESM, use 'await putoutAsync()' instead`,
|
|
112897
112954
|
name,
|
|
112898
112955
|
});
|
|
@@ -112940,12 +112997,12 @@ function getModulePath(name) {
|
|
|
112940
112997
|
const customRequire = createCustomRequire();
|
|
112941
112998
|
const putoutRequire = createPutoutRequire();
|
|
112942
112999
|
|
|
112943
|
-
[, path] = tryCatch$
|
|
113000
|
+
[, path] = tryCatch$4(putoutRequire.resolve, name);
|
|
112944
113001
|
|
|
112945
113002
|
if (path)
|
|
112946
113003
|
return [path, putoutRequire];
|
|
112947
113004
|
|
|
112948
|
-
[, path] = tryCatch$
|
|
113005
|
+
[, path] = tryCatch$4(customRequire.resolve, name);
|
|
112949
113006
|
|
|
112950
113007
|
return [path, customRequire];
|
|
112951
113008
|
}
|
|
@@ -112979,7 +113036,7 @@ const {nanomemoize} = require$$0$1;
|
|
|
112979
113036
|
const tryToCatch = tryToCatch$1;
|
|
112980
113037
|
const {simpleImport} = simpleImport$1;
|
|
112981
113038
|
|
|
112982
|
-
const {assign: assign$
|
|
113039
|
+
const {assign: assign$3} = Object;
|
|
112983
113040
|
const stub$2 = () => () => {};
|
|
112984
113041
|
|
|
112985
113042
|
asyncLoader.createAsyncLoader = (type) => nanomemoize(async (name, load) => {
|
|
@@ -113008,14 +113065,14 @@ async function cleverLoad(names, load = simpleImport) {
|
|
|
113008
113065
|
if (e.code === 'ERR_MODULE_NOT_FOUND')
|
|
113009
113066
|
continue;
|
|
113010
113067
|
|
|
113011
|
-
assign$
|
|
113068
|
+
assign$3(e, {
|
|
113012
113069
|
message: `${name}: ${e.message}`,
|
|
113013
113070
|
});
|
|
113014
113071
|
|
|
113015
113072
|
throw e;
|
|
113016
113073
|
}
|
|
113017
113074
|
|
|
113018
|
-
assign$
|
|
113075
|
+
assign$3(e, {
|
|
113019
113076
|
message: e.message.replace(/\simported.*/, ''),
|
|
113020
113077
|
});
|
|
113021
113078
|
|
|
@@ -113025,7 +113082,7 @@ async function cleverLoad(names, load = simpleImport) {
|
|
|
113025
113082
|
var parsePluginNames$2 = {};
|
|
113026
113083
|
|
|
113027
113084
|
const isStr$4 = (a) => typeof a === 'string';
|
|
113028
|
-
const {isArray: isArray$
|
|
113085
|
+
const {isArray: isArray$c} = Array;
|
|
113029
113086
|
const {entries: entries$9} = Object;
|
|
113030
113087
|
|
|
113031
113088
|
parsePluginNames$2.parsePluginNames = (plugins) => {
|
|
@@ -113037,7 +113094,7 @@ parsePluginNames$2.parsePluginNames = (plugins) => {
|
|
|
113037
113094
|
continue;
|
|
113038
113095
|
}
|
|
113039
113096
|
|
|
113040
|
-
if (isArray$
|
|
113097
|
+
if (isArray$c(plugin)) {
|
|
113041
113098
|
const [pluginName, fn] = plugin;
|
|
113042
113099
|
result.push([pluginName, fn]);
|
|
113043
113100
|
continue;
|
|
@@ -113050,7 +113107,7 @@ parsePluginNames$2.parsePluginNames = (plugins) => {
|
|
|
113050
113107
|
};
|
|
113051
113108
|
|
|
113052
113109
|
const isStr$3 = (a) => typeof a === 'string';
|
|
113053
|
-
const {isArray: isArray$
|
|
113110
|
+
const {isArray: isArray$b} = Array;
|
|
113054
113111
|
|
|
113055
113112
|
const isOn = (a) => a === 'on';
|
|
113056
113113
|
const isOff = (a) => a === 'off';
|
|
@@ -113064,7 +113121,7 @@ var parseProcessorNames$1 = (plugins) => {
|
|
|
113064
113121
|
continue;
|
|
113065
113122
|
}
|
|
113066
113123
|
|
|
113067
|
-
if (isArray$
|
|
113124
|
+
if (isArray$b(plugin)) {
|
|
113068
113125
|
const [pluginName, fn] = plugin;
|
|
113069
113126
|
|
|
113070
113127
|
if (isOff(fn))
|
|
@@ -113109,7 +113166,7 @@ var loadPluginsAsync$1 = {};
|
|
|
113109
113166
|
|
|
113110
113167
|
var parseRules$3 = {};
|
|
113111
113168
|
|
|
113112
|
-
const {isArray: isArray$
|
|
113169
|
+
const {isArray: isArray$a} = Array;
|
|
113113
113170
|
const isBool$2 = (a) => typeof a === 'boolean';
|
|
113114
113171
|
const isStr$2 = (a) => typeof a === 'string';
|
|
113115
113172
|
const isObj$1 = (a) => typeof a === 'object';
|
|
@@ -113163,7 +113220,7 @@ parseRules$3.parseRules = (rules) => {
|
|
|
113163
113220
|
continue;
|
|
113164
113221
|
}
|
|
113165
113222
|
|
|
113166
|
-
const looksLikeArray = isArray$
|
|
113223
|
+
const looksLikeArray = isArray$a(value);
|
|
113167
113224
|
const looksLikeNormalArray = looksLikeArray && value.length;
|
|
113168
113225
|
|
|
113169
113226
|
if (looksLikeNormalArray) {
|
|
@@ -113365,8 +113422,8 @@ var filterEnabledPlugins$2 = {};
|
|
|
113365
113422
|
|
|
113366
113423
|
const {isEnabled: isEnabled$2, mergeRules} = rules;
|
|
113367
113424
|
|
|
113368
|
-
const {isArray: isArray$
|
|
113369
|
-
const maybeTuple = (a) => isArray$
|
|
113425
|
+
const {isArray: isArray$9} = Array;
|
|
113426
|
+
const maybeTuple = (a) => isArray$9(a) ? a : ['on', a];
|
|
113370
113427
|
|
|
113371
113428
|
// Would be great to have ability to filter
|
|
113372
113429
|
// disabled plugins and prevent them from loading
|
|
@@ -113408,7 +113465,7 @@ function isExectRuleEnabled(name, status, rules) {
|
|
|
113408
113465
|
|
|
113409
113466
|
var check$9 = {};
|
|
113410
113467
|
|
|
113411
|
-
const isString$
|
|
113468
|
+
const isString$6 = (a) => typeof a === 'string';
|
|
113412
113469
|
|
|
113413
113470
|
check$9.check = (options) => {
|
|
113414
113471
|
if (!options || typeof options !== 'object')
|
|
@@ -113416,11 +113473,11 @@ check$9.check = (options) => {
|
|
|
113416
113473
|
};
|
|
113417
113474
|
|
|
113418
113475
|
check$9.checkRule = (rule) => {
|
|
113419
|
-
if (!isString$
|
|
113476
|
+
if (!isString$6(rule))
|
|
113420
113477
|
throw Error(`☝️ Looks like plugin name type is not 'string', but: '${typeof rule}'`);
|
|
113421
113478
|
};
|
|
113422
113479
|
|
|
113423
|
-
const {basename: basename$
|
|
113480
|
+
const {basename: basename$2} = require$$0$2;
|
|
113424
113481
|
|
|
113425
113482
|
const {
|
|
113426
113483
|
parseRules: parseRules$1,
|
|
@@ -113515,7 +113572,7 @@ function extendRules$1(rule, plugin) {
|
|
|
113515
113572
|
|
|
113516
113573
|
function parseRuleName(rule) {
|
|
113517
113574
|
if (rule.startsWith('import:')) {
|
|
113518
|
-
const shortName = basename$
|
|
113575
|
+
const shortName = basename$2(rule.replace('import:', ''));
|
|
113519
113576
|
|
|
113520
113577
|
return shortName.replace('plugin-', '');
|
|
113521
113578
|
}
|
|
@@ -113539,7 +113596,7 @@ const {
|
|
|
113539
113596
|
|
|
113540
113597
|
const {filterEnabledPlugins} = filterEnabledPlugins$2;
|
|
113541
113598
|
const {check: check$7, checkRule} = check$9;
|
|
113542
|
-
const {isArray: isArray$
|
|
113599
|
+
const {isArray: isArray$8} = Array;
|
|
113543
113600
|
|
|
113544
113601
|
lib$1.loadPluginsAsync = loadPluginsAsync;
|
|
113545
113602
|
lib$1.loadProcessorsAsync = async (options, load) => {
|
|
@@ -113607,7 +113664,7 @@ function parseRule(rule) {
|
|
|
113607
113664
|
.replace('@putout/plugin-', '');
|
|
113608
113665
|
}
|
|
113609
113666
|
|
|
113610
|
-
const maybeFromTuple = (a) => isArray$
|
|
113667
|
+
const maybeFromTuple = (a) => isArray$8(a) ? a[1] : a;
|
|
113611
113668
|
|
|
113612
113669
|
function loadPlugins({items, loadedRules}) {
|
|
113613
113670
|
const plugins = [];
|
|
@@ -114378,7 +114435,7 @@ var common = setup;
|
|
|
114378
114435
|
var browserExports = browser.exports;
|
|
114379
114436
|
browserExports.default;
|
|
114380
114437
|
|
|
114381
|
-
const tryCatch$
|
|
114438
|
+
const tryCatch$3 = tryCatch$6;
|
|
114382
114439
|
const debug$4 = browserExports('putout:runner:fix');
|
|
114383
114440
|
const {enabled} = debug$4;
|
|
114384
114441
|
const {stringify: stringify$5} = JSON;
|
|
@@ -114402,7 +114459,7 @@ const chooseFixArgs = ({path, pathOptions, options}) => {
|
|
|
114402
114459
|
};
|
|
114403
114460
|
|
|
114404
114461
|
const tryToFix = (fix, {path, pathOptions, position, options}) => {
|
|
114405
|
-
const [e] = tryCatch$
|
|
114462
|
+
const [e] = tryCatch$3(fix, ...chooseFixArgs({
|
|
114406
114463
|
path,
|
|
114407
114464
|
pathOptions,
|
|
114408
114465
|
options,
|
|
@@ -114477,14 +114534,14 @@ function validatePath(path) {
|
|
|
114477
114534
|
throw Error(`☝️ Looks like 'push' called without a 'path' argument.`);
|
|
114478
114535
|
}
|
|
114479
114536
|
|
|
114480
|
-
const {isArray: isArray$
|
|
114481
|
-
const maybeArray$
|
|
114537
|
+
const {isArray: isArray$7} = Array;
|
|
114538
|
+
const maybeArray$6 = (a) => isArray$7(a) ? a : [a];
|
|
114482
114539
|
|
|
114483
114540
|
var maybeArray_1 = (a) => {
|
|
114484
114541
|
if (!a)
|
|
114485
114542
|
return [];
|
|
114486
114543
|
|
|
114487
|
-
return maybeArray$
|
|
114544
|
+
return maybeArray$6(a);
|
|
114488
114545
|
};
|
|
114489
114546
|
|
|
114490
114547
|
var validate$2 = {};
|
|
@@ -114502,7 +114559,7 @@ var store = {};
|
|
|
114502
114559
|
const {
|
|
114503
114560
|
values,
|
|
114504
114561
|
entries: entries$7,
|
|
114505
|
-
assign: assign$
|
|
114562
|
+
assign: assign$2,
|
|
114506
114563
|
} = Object;
|
|
114507
114564
|
|
|
114508
114565
|
const toArray = (a) => Array.from(a);
|
|
@@ -114528,7 +114585,7 @@ store.upStore = createStore({
|
|
|
114528
114585
|
},
|
|
114529
114586
|
set(map, name, data) {
|
|
114530
114587
|
map[name] = map[name] || {};
|
|
114531
|
-
assign$
|
|
114588
|
+
assign$2(map[name], data);
|
|
114532
114589
|
},
|
|
114533
114590
|
});
|
|
114534
114591
|
|
|
@@ -114593,7 +114650,7 @@ const {generate: generate$2} = parser$6;
|
|
|
114593
114650
|
|
|
114594
114651
|
const runFix$2 = runFix$3;
|
|
114595
114652
|
const {getPosition: getPosition$1} = getPosition$2;
|
|
114596
|
-
const maybeArray$
|
|
114653
|
+
const maybeArray$5 = maybeArray_1;
|
|
114597
114654
|
const {validate: validate$1} = validate$2;
|
|
114598
114655
|
|
|
114599
114656
|
const {
|
|
@@ -114607,18 +114664,18 @@ const {
|
|
|
114607
114664
|
const shouldSkip = (a) => !a.parent;
|
|
114608
114665
|
const {merge: merge$2} = traverse$9.visitors;
|
|
114609
114666
|
|
|
114610
|
-
const {assign: assign$
|
|
114667
|
+
const {assign: assign$1} = Object;
|
|
114611
114668
|
|
|
114612
114669
|
const parse$3 = (name, plugin, options) => {
|
|
114613
114670
|
const list = [];
|
|
114614
114671
|
|
|
114615
114672
|
if (plugin[name]) {
|
|
114616
114673
|
validate$1(name, plugin[name]);
|
|
114617
|
-
list.push(...maybeArray$
|
|
114674
|
+
list.push(...maybeArray$5(plugin[name]()));
|
|
114618
114675
|
}
|
|
114619
114676
|
|
|
114620
114677
|
if (options[name])
|
|
114621
|
-
list.push(...maybeArray$
|
|
114678
|
+
list.push(...maybeArray$5(options[name]));
|
|
114622
114679
|
|
|
114623
114680
|
return list;
|
|
114624
114681
|
};
|
|
@@ -114660,7 +114717,7 @@ var mergeVisitors$1 = (pluginsToMerge, {fix, shebang, template}) => {
|
|
|
114660
114717
|
if (!visitor)
|
|
114661
114718
|
throw Error(`☝️ Visitors cannot be empty in "${rule}"`);
|
|
114662
114719
|
|
|
114663
|
-
assign$
|
|
114720
|
+
assign$1(options, {
|
|
114664
114721
|
include: parse$3('include', plugin, options),
|
|
114665
114722
|
exclude: parse$3('exclude', plugin, options),
|
|
114666
114723
|
});
|
|
@@ -114734,7 +114791,7 @@ function getStore(plugin, {fix, rule, shebang, msg, options}) {
|
|
|
114734
114791
|
|
|
114735
114792
|
mergeVisitors$1.default;
|
|
114736
114793
|
|
|
114737
|
-
const {traverse: babelTraverse$1, types: types$
|
|
114794
|
+
const {traverse: babelTraverse$1, types: types$f} = bundle;
|
|
114738
114795
|
|
|
114739
114796
|
const {generate: generate$1} = parser$6;
|
|
114740
114797
|
const {merge: merge$1} = babelTraverse$1.visitors;
|
|
@@ -114753,7 +114810,7 @@ var superFind$1 = function superFind({rule, find, ast, options, template}) {
|
|
|
114753
114810
|
template,
|
|
114754
114811
|
}),
|
|
114755
114812
|
generate: generate$1,
|
|
114756
|
-
types: types$
|
|
114813
|
+
types: types$f,
|
|
114757
114814
|
push,
|
|
114758
114815
|
options,
|
|
114759
114816
|
});
|
|
@@ -114777,7 +114834,7 @@ function traverse$8({rule, options, template}) {
|
|
|
114777
114834
|
}
|
|
114778
114835
|
|
|
114779
114836
|
const log$5 = browserExports('putout:runner:include');
|
|
114780
|
-
const maybeArray$
|
|
114837
|
+
const maybeArray$4 = maybeArray_1;
|
|
114781
114838
|
const {validate} = validate$2;
|
|
114782
114839
|
|
|
114783
114840
|
const stub$1 = () => [];
|
|
@@ -114804,7 +114861,7 @@ var include$2 = ({rule, plugin, msg, options}) => {
|
|
|
114804
114861
|
...options,
|
|
114805
114862
|
exclude: [
|
|
114806
114863
|
...exclude(),
|
|
114807
|
-
...maybeArray$
|
|
114864
|
+
...maybeArray$4(options.exclude),
|
|
114808
114865
|
],
|
|
114809
114866
|
},
|
|
114810
114867
|
plugin: {
|
|
@@ -114933,7 +114990,7 @@ function check$5(selector) {
|
|
|
114933
114990
|
var is$2 = {};
|
|
114934
114991
|
|
|
114935
114992
|
const {template: template$8} = parser$6;
|
|
114936
|
-
const {types: types$
|
|
114993
|
+
const {types: types$e} = bundle;
|
|
114937
114994
|
const {
|
|
114938
114995
|
isBlockStatement: isBlockStatement$1,
|
|
114939
114996
|
isBooleanLiteral,
|
|
@@ -114949,7 +115006,7 @@ const {
|
|
|
114949
115006
|
isJSXAttribute,
|
|
114950
115007
|
isTSTypeReference: isTSTypeReference$1,
|
|
114951
115008
|
isTSTypeParameterDeclaration,
|
|
114952
|
-
} = types$
|
|
115009
|
+
} = types$e;
|
|
114953
115010
|
|
|
114954
115011
|
const isStr$1 = (a) => typeof a === 'string';
|
|
114955
115012
|
|
|
@@ -115059,7 +115116,7 @@ const isBool$1 = (a, b) => {
|
|
|
115059
115116
|
};
|
|
115060
115117
|
|
|
115061
115118
|
const isEqualType$1 = (a, b) => a.type === b.type;
|
|
115062
|
-
const {isArray: isArray$
|
|
115119
|
+
const {isArray: isArray$6} = Array;
|
|
115063
115120
|
|
|
115064
115121
|
is$2.isId = isId$1;
|
|
115065
115122
|
is$2.isBool = isBool$1;
|
|
@@ -115082,7 +115139,7 @@ is$2.isAnyLiteral = (a, b) => {
|
|
|
115082
115139
|
};
|
|
115083
115140
|
|
|
115084
115141
|
is$2.isArgs = (a) => {
|
|
115085
|
-
const b = !isArray$
|
|
115142
|
+
const b = !isArray$6(a) ? a : a[0];
|
|
115086
115143
|
|
|
115087
115144
|
return isIdentifier$3(b, {
|
|
115088
115145
|
name: ARGS,
|
|
@@ -115112,12 +115169,12 @@ is$2.isEqualTypeParams = (a, b) => {
|
|
|
115112
115169
|
};
|
|
115113
115170
|
|
|
115114
115171
|
is$2.isLinkedArgs = (a) => {
|
|
115115
|
-
const b = !isArray$
|
|
115172
|
+
const b = !isArray$6(a) ? a : a[0];
|
|
115116
115173
|
return isIdentifier$3(b) && LINKED_ARGS.test(b.name);
|
|
115117
115174
|
};
|
|
115118
115175
|
|
|
115119
115176
|
is$2.isJSXChildren = (a) => {
|
|
115120
|
-
const b = !isArray$
|
|
115177
|
+
const b = !isArray$6(a) ? a : a[0];
|
|
115121
115178
|
|
|
115122
115179
|
return isJSXText$1(b, {
|
|
115123
115180
|
value: JSX_CHILDREN,
|
|
@@ -115125,7 +115182,7 @@ is$2.isJSXChildren = (a) => {
|
|
|
115125
115182
|
};
|
|
115126
115183
|
|
|
115127
115184
|
is$2.isJSXAttributes = (a) => {
|
|
115128
|
-
const b = !isArray$
|
|
115185
|
+
const b = !isArray$6(a) ? a : a[0];
|
|
115129
115186
|
|
|
115130
115187
|
if (!isJSXAttribute(b))
|
|
115131
115188
|
return false;
|
|
@@ -115157,27 +115214,27 @@ is$2.isLinkedRegExp = (a, b) => {
|
|
|
115157
115214
|
};
|
|
115158
115215
|
|
|
115159
115216
|
is$2.isPath = (path) => Boolean(path.node);
|
|
115160
|
-
is$2.isArray = isArray$
|
|
115217
|
+
is$2.isArray = isArray$6;
|
|
115161
115218
|
|
|
115162
115219
|
is$2.isObject = (a) => {
|
|
115163
115220
|
if (!a)
|
|
115164
115221
|
return false;
|
|
115165
115222
|
|
|
115166
|
-
if (isArray$
|
|
115223
|
+
if (isArray$6(a))
|
|
115167
115224
|
return false;
|
|
115168
115225
|
|
|
115169
115226
|
return typeof a === 'object';
|
|
115170
115227
|
};
|
|
115171
115228
|
|
|
115172
115229
|
is$2.isArrays = (a, b) => {
|
|
115173
|
-
if (!isArray$
|
|
115230
|
+
if (!isArray$6(a) || !isArray$6(b))
|
|
115174
115231
|
return false;
|
|
115175
115232
|
|
|
115176
115233
|
return a.length === b.length;
|
|
115177
115234
|
};
|
|
115178
115235
|
|
|
115179
115236
|
is$2.isImports = (a) => {
|
|
115180
|
-
const b = !isArray$
|
|
115237
|
+
const b = !isArray$6(a) ? a : a[0];
|
|
115181
115238
|
|
|
115182
115239
|
if (!isImportDefaultSpecifier(b))
|
|
115183
115240
|
return false;
|
|
@@ -115188,7 +115245,7 @@ is$2.isImports = (a) => {
|
|
|
115188
115245
|
};
|
|
115189
115246
|
|
|
115190
115247
|
is$2.isExports = (a) => {
|
|
115191
|
-
const b = !isArray$
|
|
115248
|
+
const b = !isArray$6(a) ? a : a[0];
|
|
115192
115249
|
|
|
115193
115250
|
if (!isExportSpecifier(b))
|
|
115194
115251
|
return false;
|
|
@@ -115292,7 +115349,7 @@ is$2.isInsideTypeReference = (path) => path.isIdentifier() && path.parentPath?.i
|
|
|
115292
115349
|
|
|
115293
115350
|
const jessy = jessy$1;
|
|
115294
115351
|
const nessy = nessy$1;
|
|
115295
|
-
const {traverse: traverse$7, types: types$
|
|
115352
|
+
const {traverse: traverse$7, types: types$d} = bundle;
|
|
115296
115353
|
const {template: template$7} = parser$6;
|
|
115297
115354
|
|
|
115298
115355
|
const {replaceWith: replaceWith$3, extract} = operate;
|
|
@@ -115316,13 +115373,13 @@ const {
|
|
|
115316
115373
|
isStringLiteral: isStringLiteral$3,
|
|
115317
115374
|
isTemplateLiteral: isTemplateLiteral$1,
|
|
115318
115375
|
TemplateElement,
|
|
115319
|
-
} = types$
|
|
115376
|
+
} = types$d;
|
|
115320
115377
|
|
|
115321
115378
|
const {extractExpression: extractExpression$1} = template$7;
|
|
115322
115379
|
|
|
115323
115380
|
const {entries: entries$6} = Object;
|
|
115324
115381
|
const isNumber = (a) => typeof a === 'number';
|
|
115325
|
-
const isString$
|
|
115382
|
+
const isString$5 = (a) => typeof a === 'string';
|
|
115326
115383
|
|
|
115327
115384
|
const parseNode$1 = (a) => a.node || a;
|
|
115328
115385
|
const {stringify: stringify$3} = JSON;
|
|
@@ -115330,7 +115387,7 @@ const {stringify: stringify$3} = JSON;
|
|
|
115330
115387
|
const BODY_AND_CLASS_REG = /\.body\.0(\.key)?$/;
|
|
115331
115388
|
|
|
115332
115389
|
vars.getTemplateValues = (node, str) => {
|
|
115333
|
-
if (!isString$
|
|
115390
|
+
if (!isString$5(str))
|
|
115334
115391
|
throw Error(`☝️ Looks like argument 'template' of 'getTemplateValues(node, template)': is not a string, but '${stringify$3(str)}'`);
|
|
115335
115392
|
|
|
115336
115393
|
node = parseNode$1(node);
|
|
@@ -115469,7 +115526,7 @@ var log$4 = {exports: {}};
|
|
|
115469
115526
|
|
|
115470
115527
|
const debug$3 = browserExports('putout:compare');
|
|
115471
115528
|
|
|
115472
|
-
const {isArray: isArray$
|
|
115529
|
+
const {isArray: isArray$5} = Array;
|
|
115473
115530
|
const isObject$2 = (a) => a && typeof a === 'object';
|
|
115474
115531
|
|
|
115475
115532
|
log$4.exports = (a, b) => {
|
|
@@ -115484,7 +115541,7 @@ log$4.exports = (a, b) => {
|
|
|
115484
115541
|
|
|
115485
115542
|
log$4.exports._parseValue = parseValue;
|
|
115486
115543
|
function parseValue(a) {
|
|
115487
|
-
if (isArray$
|
|
115544
|
+
if (isArray$5(a) && a[0]) {
|
|
115488
115545
|
const [{
|
|
115489
115546
|
type,
|
|
115490
115547
|
name,
|
|
@@ -115509,14 +115566,14 @@ function parseValue(a) {
|
|
|
115509
115566
|
|
|
115510
115567
|
var logExports = log$4.exports;
|
|
115511
115568
|
|
|
115512
|
-
const {types: types$
|
|
115569
|
+
const {types: types$c} = bundle;
|
|
115513
115570
|
const {
|
|
115514
115571
|
isIdentifier: isIdentifier$1,
|
|
115515
115572
|
isLiteral,
|
|
115516
115573
|
isStringLiteral: isStringLiteral$2,
|
|
115517
115574
|
isTemplateElement: isTemplateElement$1,
|
|
115518
115575
|
isTSTypeReference,
|
|
115519
|
-
} = types$
|
|
115576
|
+
} = types$c;
|
|
115520
115577
|
|
|
115521
115578
|
const parseName = (node) => {
|
|
115522
115579
|
node = node[0] || node;
|
|
@@ -115585,13 +115642,13 @@ const {
|
|
|
115585
115642
|
isLinkedRegExp: isLinkedRegExp$1,
|
|
115586
115643
|
} = is$2;
|
|
115587
115644
|
|
|
115588
|
-
const {types: types$
|
|
115645
|
+
const {types: types$b} = bundle;
|
|
115589
115646
|
const {
|
|
115590
115647
|
isClassBody,
|
|
115591
115648
|
isBlock,
|
|
115592
115649
|
isJSXText,
|
|
115593
115650
|
isTemplateElement,
|
|
115594
|
-
} = types$
|
|
115651
|
+
} = types$b;
|
|
115595
115652
|
|
|
115596
115653
|
const isEmptyBlock = (a) => isBlock(a) && !a.body.length;
|
|
115597
115654
|
const isPrimitive = (a) => typeof a !== 'object' || a === null;
|
|
@@ -115700,7 +115757,7 @@ function compareJSXTexts(node, template) {
|
|
|
115700
115757
|
|
|
115701
115758
|
var topLevelComparators = {};
|
|
115702
115759
|
|
|
115703
|
-
const {types: types$
|
|
115760
|
+
const {types: types$a} = bundle;
|
|
115704
115761
|
const {
|
|
115705
115762
|
isEqualBody,
|
|
115706
115763
|
isEqualAnyObject,
|
|
@@ -115714,7 +115771,7 @@ const {
|
|
|
115714
115771
|
const {
|
|
115715
115772
|
isIdentifier,
|
|
115716
115773
|
isStringLiteral: isStringLiteral$1,
|
|
115717
|
-
} = types$
|
|
115774
|
+
} = types$a;
|
|
115718
115775
|
|
|
115719
115776
|
const comparators = [
|
|
115720
115777
|
isEqualAnyObject,
|
|
@@ -115772,13 +115829,13 @@ const {
|
|
|
115772
115829
|
const {extractExpression} = template$6;
|
|
115773
115830
|
|
|
115774
115831
|
const {keys: keys$2} = Object;
|
|
115775
|
-
const {isArray: isArray$
|
|
115776
|
-
const noop$
|
|
115777
|
-
const isEmptyArray = (a) => isArray$
|
|
115832
|
+
const {isArray: isArray$4} = Array;
|
|
115833
|
+
const noop$2 = () => {};
|
|
115834
|
+
const isEmptyArray = (a) => isArray$4(a) && !a.length;
|
|
115778
115835
|
|
|
115779
115836
|
const compareType = (type) => (path) => path.type === type;
|
|
115780
115837
|
const superPush = (array) => (a, b) => array.push([a, b]);
|
|
115781
|
-
const maybeArray$
|
|
115838
|
+
const maybeArray$3 = (a) => isArray$4(a) ? a : [a];
|
|
115782
115839
|
|
|
115783
115840
|
const findParent = (path, type) => {
|
|
115784
115841
|
const newPathNode = path.findParent(compareType(type));
|
|
@@ -115808,7 +115865,7 @@ compare$5.getValues = getValues$1;
|
|
|
115808
115865
|
compare$5.setValues = setValues$1;
|
|
115809
115866
|
compare$5.getTemplateValues = getTemplateValues$1;
|
|
115810
115867
|
|
|
115811
|
-
function compare$4(path, template, options = {}, equal = noop$
|
|
115868
|
+
function compare$4(path, template, options = {}, equal = noop$2) {
|
|
115812
115869
|
const {findUp = true} = options;
|
|
115813
115870
|
|
|
115814
115871
|
if (!path && !template)
|
|
@@ -115842,7 +115899,7 @@ function compare$4(path, template, options = {}, equal = noop$5) {
|
|
|
115842
115899
|
}
|
|
115843
115900
|
|
|
115844
115901
|
compare$5.compareAny = (path, templateNodes, options) => {
|
|
115845
|
-
templateNodes = maybeArray$
|
|
115902
|
+
templateNodes = maybeArray$3(templateNodes);
|
|
115846
115903
|
|
|
115847
115904
|
for (const template of templateNodes) {
|
|
115848
115905
|
if (compare$4(path, template, options))
|
|
@@ -115853,7 +115910,7 @@ compare$5.compareAny = (path, templateNodes, options) => {
|
|
|
115853
115910
|
};
|
|
115854
115911
|
|
|
115855
115912
|
compare$5.compareAll = (path, templateNodes, options) => {
|
|
115856
|
-
templateNodes = maybeArray$
|
|
115913
|
+
templateNodes = maybeArray$3(templateNodes);
|
|
115857
115914
|
|
|
115858
115915
|
for (const template of templateNodes) {
|
|
115859
115916
|
if (!compare$4(path, template, options))
|
|
@@ -115934,7 +115991,7 @@ function check$3(fn) {
|
|
|
115934
115991
|
}
|
|
115935
115992
|
|
|
115936
115993
|
const {entries: entries$5} = Object;
|
|
115937
|
-
const {isArray: isArray$
|
|
115994
|
+
const {isArray: isArray$3} = Array;
|
|
115938
115995
|
|
|
115939
115996
|
var findPath$1 = (parentPath) => {
|
|
115940
115997
|
let current = {
|
|
@@ -115953,7 +116010,7 @@ function findKey(path, parent) {
|
|
|
115953
116010
|
const {node} = path;
|
|
115954
116011
|
|
|
115955
116012
|
for (const [key, value] of entries$5(parent)) {
|
|
115956
|
-
if (isArray$
|
|
116013
|
+
if (isArray$3(value)) {
|
|
115957
116014
|
const index = value.indexOf(node);
|
|
115958
116015
|
|
|
115959
116016
|
if (index >= 0)
|
|
@@ -115969,14 +116026,14 @@ function findKey(path, parent) {
|
|
|
115969
116026
|
|
|
115970
116027
|
const wraptile = wraptile$1;
|
|
115971
116028
|
const findPath = findPath$1;
|
|
115972
|
-
const {types: types$
|
|
115973
|
-
const {isProgram: isProgram$
|
|
116029
|
+
const {types: types$9} = bundle;
|
|
116030
|
+
const {isProgram: isProgram$2} = types$9;
|
|
115974
116031
|
const name = '__putout_runner_replace';
|
|
115975
116032
|
const hasWatermark = (watermark) => (path) => path.node?.[name]?.has(watermark);
|
|
115976
116033
|
|
|
115977
116034
|
watermark$1.exports = (from, to, path) => {
|
|
115978
116035
|
const {watermark, highWatermark} = create(from, to, path);
|
|
115979
|
-
const program = path.findParent(isProgram$
|
|
116036
|
+
const program = path.findParent(isProgram$2) || path;
|
|
115980
116037
|
const options = {
|
|
115981
116038
|
watermark,
|
|
115982
116039
|
highWatermark,
|
|
@@ -115985,7 +116042,7 @@ watermark$1.exports = (from, to, path) => {
|
|
|
115985
116042
|
};
|
|
115986
116043
|
|
|
115987
116044
|
return {
|
|
115988
|
-
init: wraptile(init$
|
|
116045
|
+
init: wraptile(init$1, options),
|
|
115989
116046
|
has: wraptile(has, options),
|
|
115990
116047
|
add: wraptile(add, options),
|
|
115991
116048
|
};
|
|
@@ -116004,8 +116061,8 @@ function create(from, to, path) {
|
|
|
116004
116061
|
};
|
|
116005
116062
|
}
|
|
116006
116063
|
|
|
116007
|
-
watermark$1.exports.init = init$
|
|
116008
|
-
function init$
|
|
116064
|
+
watermark$1.exports.init = init$1;
|
|
116065
|
+
function init$1({path, program}) {
|
|
116009
116066
|
if (path.node)
|
|
116010
116067
|
path.node[name] = path.node[name] || new Set();
|
|
116011
116068
|
|
|
@@ -116014,7 +116071,7 @@ function init$4({path, program}) {
|
|
|
116014
116071
|
|
|
116015
116072
|
watermark$1.exports.add = add;
|
|
116016
116073
|
function add({path, program, watermark, highWatermark}) {
|
|
116017
|
-
init$
|
|
116074
|
+
init$1({
|
|
116018
116075
|
path,
|
|
116019
116076
|
program,
|
|
116020
116077
|
});
|
|
@@ -116035,7 +116092,7 @@ var watermarkExports = watermark$1.exports;
|
|
|
116035
116092
|
|
|
116036
116093
|
const {template: template$5, print: print$2} = parser$6;
|
|
116037
116094
|
const {remove, replaceWith: replaceWith$2} = operate;
|
|
116038
|
-
const {types: types$
|
|
116095
|
+
const {types: types$8} = bundle;
|
|
116039
116096
|
|
|
116040
116097
|
const {
|
|
116041
116098
|
compare: compare$3,
|
|
@@ -116045,14 +116102,14 @@ const {
|
|
|
116045
116102
|
} = compare$5;
|
|
116046
116103
|
|
|
116047
116104
|
const debug$2 = browserExports('putout:runner:replace');
|
|
116048
|
-
const maybeArray$
|
|
116105
|
+
const maybeArray$2 = maybeArray_1;
|
|
116049
116106
|
|
|
116050
116107
|
const watermark = watermarkExports;
|
|
116051
116108
|
const {
|
|
116052
116109
|
isExpression,
|
|
116053
116110
|
isStatement,
|
|
116054
116111
|
isExpressionStatement,
|
|
116055
|
-
} = types$
|
|
116112
|
+
} = types$8;
|
|
116056
116113
|
|
|
116057
116114
|
const PRINT_OPTIONS = {
|
|
116058
116115
|
printer: ['putout', {
|
|
@@ -116065,7 +116122,7 @@ const PRINT_OPTIONS = {
|
|
|
116065
116122
|
}],
|
|
116066
116123
|
};
|
|
116067
116124
|
|
|
116068
|
-
const isString$
|
|
116125
|
+
const isString$4 = (a) => typeof a === 'string';
|
|
116069
116126
|
|
|
116070
116127
|
const log$2 = (from, path) => {
|
|
116071
116128
|
debug$2.enabled && debug$2(`${from} -> ${path}\n`);
|
|
@@ -116102,7 +116159,7 @@ replace$1.exports = ({rule, plugin, msg, options}) => {
|
|
|
116102
116159
|
...options,
|
|
116103
116160
|
exclude: [
|
|
116104
116161
|
...exclude(),
|
|
116105
|
-
...maybeArray$
|
|
116162
|
+
...maybeArray$2(options.exclude),
|
|
116106
116163
|
],
|
|
116107
116164
|
},
|
|
116108
116165
|
plugin: {
|
|
@@ -116214,7 +116271,7 @@ function parseTo(to, values, path) {
|
|
|
116214
116271
|
return toStr;
|
|
116215
116272
|
}
|
|
116216
116273
|
|
|
116217
|
-
if (!isString$
|
|
116274
|
+
if (!isString$4(toStr))
|
|
116218
116275
|
throw Error(`☝️ Looks like you passed 'replace' value with a wrong type. Allowed: 'string', 'node' and 'path'. Received: '${typeof toStr}' with value '${toStr}'.`);
|
|
116219
116276
|
|
|
116220
116277
|
return template$5.ast.fresh(toStr);
|
|
@@ -116297,14 +116354,14 @@ const {
|
|
|
116297
116354
|
setModuleType,
|
|
116298
116355
|
} = record;
|
|
116299
116356
|
|
|
116300
|
-
const {types: types$
|
|
116357
|
+
const {types: types$7} = bundle;
|
|
116301
116358
|
const {
|
|
116302
116359
|
isImportDeclaration,
|
|
116303
116360
|
isVariableDeclaration,
|
|
116304
|
-
} = types$
|
|
116361
|
+
} = types$7;
|
|
116305
116362
|
|
|
116306
116363
|
const {keys} = Object;
|
|
116307
|
-
const isString$
|
|
116364
|
+
const isString$3 = (a) => typeof a === 'string';
|
|
116308
116365
|
|
|
116309
116366
|
const getLastVarPath = (bodyPath) => bodyPath.filter(isVariableDeclaration).pop();
|
|
116310
116367
|
const isLast = (insertionPath, bodyPath) => bodyPath.at(-1) === insertionPath;
|
|
@@ -116402,7 +116459,7 @@ function isUseStrict(path) {
|
|
|
116402
116459
|
}
|
|
116403
116460
|
|
|
116404
116461
|
const parseCode = (type, current) => {
|
|
116405
|
-
if (isString$
|
|
116462
|
+
if (isString$3(current))
|
|
116406
116463
|
return current;
|
|
116407
116464
|
|
|
116408
116465
|
return current[type];
|
|
@@ -116500,90 +116557,90 @@ function validateDeclare(declare) {
|
|
|
116500
116557
|
throw Error(`☝️ Looks like 'declare' property value is not a 'function', but '${typeof declare}' with value '${stringify$1(declare)}'.`);
|
|
116501
116558
|
}
|
|
116502
116559
|
|
|
116503
|
-
var filesystem
|
|
116560
|
+
var filesystem = {};
|
|
116504
116561
|
|
|
116505
|
-
var maybeFs
|
|
116562
|
+
var maybeFs = {};
|
|
116506
116563
|
|
|
116507
|
-
const fullstore$
|
|
116508
|
-
const driverStore
|
|
116564
|
+
const fullstore$1 = fullstore$3;
|
|
116565
|
+
const driverStore = fullstore$1();
|
|
116509
116566
|
|
|
116510
|
-
const {assign
|
|
116511
|
-
const noop$
|
|
116512
|
-
const returns
|
|
116567
|
+
const {assign} = Object;
|
|
116568
|
+
const noop$1 = () => {};
|
|
116569
|
+
const returns = (a) => () => a;
|
|
116513
116570
|
|
|
116514
|
-
const defaultFS
|
|
116515
|
-
renameFile: noop$
|
|
116516
|
-
removeFile: noop$
|
|
116517
|
-
createDirectory: noop$
|
|
116518
|
-
readFileContent: returns
|
|
116519
|
-
writeFileContent: noop$
|
|
116520
|
-
copyFile: noop$
|
|
116571
|
+
const defaultFS = {
|
|
116572
|
+
renameFile: noop$1,
|
|
116573
|
+
removeFile: noop$1,
|
|
116574
|
+
createDirectory: noop$1,
|
|
116575
|
+
readFileContent: returns(''),
|
|
116576
|
+
writeFileContent: noop$1,
|
|
116577
|
+
copyFile: noop$1,
|
|
116521
116578
|
};
|
|
116522
116579
|
|
|
116523
|
-
const maybeFS$
|
|
116580
|
+
const maybeFS$1 = assign({}, defaultFS);
|
|
116524
116581
|
|
|
116525
|
-
maybeFs
|
|
116526
|
-
maybeFS$
|
|
116582
|
+
maybeFs.renameFile = (oldName, newName) => {
|
|
116583
|
+
maybeFS$1.renameFile(oldName, newName);
|
|
116527
116584
|
};
|
|
116528
116585
|
|
|
116529
|
-
maybeFs
|
|
116530
|
-
maybeFS$
|
|
116586
|
+
maybeFs.removeFile = (name) => {
|
|
116587
|
+
maybeFS$1.removeFile(name);
|
|
116531
116588
|
};
|
|
116532
116589
|
|
|
116533
|
-
maybeFs
|
|
116534
|
-
maybeFS$
|
|
116590
|
+
maybeFs.copyFile = (from, to) => {
|
|
116591
|
+
maybeFS$1.copyFile(from, to);
|
|
116535
116592
|
};
|
|
116536
116593
|
|
|
116537
|
-
maybeFs
|
|
116538
|
-
maybeFS$
|
|
116594
|
+
maybeFs.createDirectory = (name) => {
|
|
116595
|
+
maybeFS$1.createDirectory(name);
|
|
116539
116596
|
};
|
|
116540
116597
|
|
|
116541
|
-
maybeFs
|
|
116542
|
-
return maybeFS$
|
|
116598
|
+
maybeFs.readFileContent = (name) => {
|
|
116599
|
+
return maybeFS$1.readFileContent(name);
|
|
116543
116600
|
};
|
|
116544
116601
|
|
|
116545
|
-
maybeFs
|
|
116546
|
-
maybeFS$
|
|
116602
|
+
maybeFs.writeFileContent = (name, content) => {
|
|
116603
|
+
maybeFS$1.writeFileContent(name, content);
|
|
116547
116604
|
};
|
|
116548
116605
|
|
|
116549
|
-
maybeFs
|
|
116606
|
+
maybeFs.init = init;
|
|
116550
116607
|
|
|
116551
|
-
function init
|
|
116552
|
-
assign
|
|
116608
|
+
function init(fsDriver) {
|
|
116609
|
+
assign(maybeFS$1, fsDriver);
|
|
116553
116610
|
}
|
|
116554
116611
|
|
|
116555
|
-
maybeFs
|
|
116556
|
-
driverStore
|
|
116557
|
-
deinit
|
|
116612
|
+
maybeFs.pause = () => {
|
|
116613
|
+
driverStore(maybeFS$1);
|
|
116614
|
+
deinit();
|
|
116558
116615
|
};
|
|
116559
116616
|
|
|
116560
|
-
maybeFs
|
|
116561
|
-
init
|
|
116617
|
+
maybeFs.start = () => {
|
|
116618
|
+
init(driverStore());
|
|
116562
116619
|
};
|
|
116563
116620
|
|
|
116564
|
-
maybeFs
|
|
116621
|
+
maybeFs.deinit = deinit;
|
|
116565
116622
|
|
|
116566
|
-
function deinit
|
|
116567
|
-
assign
|
|
116623
|
+
function deinit() {
|
|
116624
|
+
assign(maybeFS$1, defaultFS);
|
|
116568
116625
|
}
|
|
116569
116626
|
|
|
116570
|
-
const {join: join$
|
|
116571
|
-
const tryCatch$
|
|
116572
|
-
const {types: types$
|
|
116627
|
+
const {join: join$2, basename: basename$1} = require$$0$2;
|
|
116628
|
+
const tryCatch$2 = tryCatch$6;
|
|
116629
|
+
const {types: types$6} = bundle;
|
|
116573
116630
|
|
|
116574
116631
|
const {
|
|
116575
|
-
setLiteralValue
|
|
116576
|
-
getProperty: getProperty$
|
|
116577
|
-
traverseProperties: traverseProperties$
|
|
116632
|
+
setLiteralValue,
|
|
116633
|
+
getProperty: getProperty$2,
|
|
116634
|
+
traverseProperties: traverseProperties$1,
|
|
116578
116635
|
} = operate;
|
|
116579
116636
|
|
|
116580
|
-
const maybeFS
|
|
116581
|
-
const isString$
|
|
116582
|
-
const {isArray: isArray$
|
|
116583
|
-
const maybeArray$
|
|
116637
|
+
const maybeFS = maybeFs;
|
|
116638
|
+
const isString$2 = (a) => typeof a === 'string';
|
|
116639
|
+
const {isArray: isArray$2} = Array;
|
|
116640
|
+
const maybeArray$1 = (a) => isArray$2(a) ? a : [a];
|
|
116584
116641
|
|
|
116585
|
-
const toBase64
|
|
116586
|
-
const [e, result] = tryCatch$
|
|
116642
|
+
const toBase64 = (content) => {
|
|
116643
|
+
const [e, result] = tryCatch$2(btoa, content);
|
|
116587
116644
|
|
|
116588
116645
|
if (e)
|
|
116589
116646
|
return btoa(encodeURI(content));
|
|
@@ -116591,8 +116648,8 @@ const toBase64$3 = (content) => {
|
|
|
116591
116648
|
return result;
|
|
116592
116649
|
};
|
|
116593
116650
|
|
|
116594
|
-
const fromBase64
|
|
116595
|
-
const [e, decoded] = tryCatch$
|
|
116651
|
+
const fromBase64 = (content) => {
|
|
116652
|
+
const [e, decoded] = tryCatch$2(atob, content);
|
|
116596
116653
|
|
|
116597
116654
|
if (!e)
|
|
116598
116655
|
return decodeURI(decoded);
|
|
@@ -116601,14 +116658,14 @@ const fromBase64$3 = (content) => {
|
|
|
116601
116658
|
};
|
|
116602
116659
|
|
|
116603
116660
|
const {
|
|
116604
|
-
ObjectExpression: ObjectExpression$
|
|
116605
|
-
ArrayExpression: ArrayExpression$
|
|
116606
|
-
StringLiteral: StringLiteral$
|
|
116607
|
-
ObjectProperty: ObjectProperty$
|
|
116608
|
-
isProgram: isProgram$
|
|
116609
|
-
} = types$
|
|
116661
|
+
ObjectExpression: ObjectExpression$1,
|
|
116662
|
+
ArrayExpression: ArrayExpression$2,
|
|
116663
|
+
StringLiteral: StringLiteral$3,
|
|
116664
|
+
ObjectProperty: ObjectProperty$2,
|
|
116665
|
+
isProgram: isProgram$1,
|
|
116666
|
+
} = types$6;
|
|
116610
116667
|
|
|
116611
|
-
const getRegExp
|
|
116668
|
+
const getRegExp = (wildcard) => {
|
|
116612
116669
|
const escaped = wildcard
|
|
116613
116670
|
.replace(/\./g, '\\.')
|
|
116614
116671
|
.replace(/\*/g, '.*')
|
|
@@ -116617,29 +116674,29 @@ const getRegExp$3 = (wildcard) => {
|
|
|
116617
116674
|
return RegExp(`^${escaped}$`);
|
|
116618
116675
|
};
|
|
116619
116676
|
|
|
116620
|
-
filesystem
|
|
116677
|
+
filesystem.getParentDirectory = (filePath) => {
|
|
116621
116678
|
const {parentPath} = filePath.parentPath.parentPath;
|
|
116622
116679
|
|
|
116623
|
-
if (isProgram$
|
|
116680
|
+
if (isProgram$1(parentPath))
|
|
116624
116681
|
return null;
|
|
116625
116682
|
|
|
116626
116683
|
return parentPath;
|
|
116627
116684
|
};
|
|
116628
116685
|
|
|
116629
|
-
filesystem
|
|
116686
|
+
filesystem.findFile = findFile$5;
|
|
116630
116687
|
|
|
116631
|
-
function findFile$
|
|
116632
|
-
checkName
|
|
116688
|
+
function findFile$5(node, name) {
|
|
116689
|
+
checkName(name);
|
|
116633
116690
|
|
|
116634
116691
|
const filePaths = [];
|
|
116635
|
-
const names = maybeArray$
|
|
116692
|
+
const names = maybeArray$1(name);
|
|
116636
116693
|
|
|
116637
|
-
for (const filenamePath of traverseProperties$
|
|
116694
|
+
for (const filenamePath of traverseProperties$1(node, 'filename')) {
|
|
116638
116695
|
const {value} = filenamePath.node.value;
|
|
116639
|
-
const base = basename$
|
|
116696
|
+
const base = basename$1(value);
|
|
116640
116697
|
|
|
116641
116698
|
for (const name of names) {
|
|
116642
|
-
if (value === name || getRegExp
|
|
116699
|
+
if (value === name || getRegExp(name).test(base))
|
|
116643
116700
|
filePaths.push(filenamePath.parentPath);
|
|
116644
116701
|
}
|
|
116645
116702
|
}
|
|
@@ -116647,32 +116704,32 @@ function findFile$8(node, name) {
|
|
|
116647
116704
|
return filePaths;
|
|
116648
116705
|
}
|
|
116649
116706
|
|
|
116650
|
-
function checkName
|
|
116651
|
-
if (!isString$
|
|
116707
|
+
function checkName(name) {
|
|
116708
|
+
if (!isString$2(name) && !isArray$2(name))
|
|
116652
116709
|
throw Error(`☝️ Looks like you forget to pass the 'name' of a file to 'findFile(filePath: Path|FilePath, name: string | string[]): FilePath'`);
|
|
116653
116710
|
}
|
|
116654
116711
|
|
|
116655
|
-
function getFilenamePath
|
|
116656
|
-
const filenamePath = getProperty$
|
|
116712
|
+
function getFilenamePath(filePath) {
|
|
116713
|
+
const filenamePath = getProperty$2(filePath, 'filename');
|
|
116657
116714
|
return filenamePath.get('value');
|
|
116658
116715
|
}
|
|
116659
116716
|
|
|
116660
|
-
function getFilename$
|
|
116661
|
-
const {value} = getFilenamePath
|
|
116717
|
+
function getFilename$4(filePath) {
|
|
116718
|
+
const {value} = getFilenamePath(filePath).node;
|
|
116662
116719
|
return value;
|
|
116663
116720
|
}
|
|
116664
116721
|
|
|
116665
|
-
filesystem
|
|
116722
|
+
filesystem.getFileType = getFileType$2;
|
|
116666
116723
|
|
|
116667
|
-
function getFileType$
|
|
116668
|
-
const typePath = getProperty$
|
|
116724
|
+
function getFileType$2(filePath) {
|
|
116725
|
+
const typePath = getProperty$2(filePath, 'type');
|
|
116669
116726
|
return typePath.node.value.value;
|
|
116670
116727
|
}
|
|
116671
116728
|
|
|
116672
|
-
filesystem
|
|
116729
|
+
filesystem.getFileContent = getFileContent;
|
|
116673
116730
|
|
|
116674
|
-
function getFileContent
|
|
116675
|
-
const content = getProperty$
|
|
116731
|
+
function getFileContent(filePath) {
|
|
116732
|
+
const content = getProperty$2(filePath, 'content');
|
|
116676
116733
|
|
|
116677
116734
|
return [
|
|
116678
116735
|
Boolean(content),
|
|
@@ -116680,11 +116737,11 @@ function getFileContent$3(filePath) {
|
|
|
116680
116737
|
];
|
|
116681
116738
|
}
|
|
116682
116739
|
|
|
116683
|
-
filesystem
|
|
116740
|
+
filesystem.getFilename = getFilename$4;
|
|
116684
116741
|
|
|
116685
|
-
filesystem
|
|
116686
|
-
const oldName = getFilename$
|
|
116687
|
-
const valuePath = getFilenamePath
|
|
116742
|
+
filesystem.renameFile = (filePath, name) => {
|
|
116743
|
+
const oldName = getFilename$4(filePath);
|
|
116744
|
+
const valuePath = getFilenamePath(filePath);
|
|
116688
116745
|
const baseName = oldName
|
|
116689
116746
|
.split('/')
|
|
116690
116747
|
.pop();
|
|
@@ -116695,77 +116752,77 @@ filesystem$3.renameFile = (filePath, name) => {
|
|
|
116695
116752
|
|
|
116696
116753
|
const newFilename = oldName.replace(baseName, newName);
|
|
116697
116754
|
|
|
116698
|
-
setLiteralValue
|
|
116699
|
-
maybeFS
|
|
116755
|
+
setLiteralValue(valuePath, newFilename);
|
|
116756
|
+
maybeFS.renameFile(oldName, newFilename);
|
|
116700
116757
|
};
|
|
116701
116758
|
|
|
116702
|
-
filesystem
|
|
116703
|
-
const filename = getFilename$
|
|
116759
|
+
filesystem.removeFile = (filePath) => {
|
|
116760
|
+
const filename = getFilename$4(filePath);
|
|
116704
116761
|
|
|
116705
116762
|
filePath.remove();
|
|
116706
|
-
maybeFS
|
|
116763
|
+
maybeFS.removeFile(filename);
|
|
116707
116764
|
};
|
|
116708
116765
|
|
|
116709
|
-
filesystem
|
|
116766
|
+
filesystem.moveFile = (filePath, dirPath) => {
|
|
116710
116767
|
if (filePath === dirPath)
|
|
116711
116768
|
return;
|
|
116712
116769
|
|
|
116713
|
-
const dirname = getFilename$
|
|
116714
|
-
const filename = getFilename$
|
|
116715
|
-
const dirPathFiles = getProperty$
|
|
116716
|
-
const filenamePath = getProperty$
|
|
116770
|
+
const dirname = getFilename$4(dirPath);
|
|
116771
|
+
const filename = getFilename$4(filePath);
|
|
116772
|
+
const dirPathFiles = getProperty$2(dirPath, 'files');
|
|
116773
|
+
const filenamePath = getProperty$2(filePath, 'filename');
|
|
116717
116774
|
|
|
116718
116775
|
const basename = filename
|
|
116719
116776
|
.split('/')
|
|
116720
116777
|
.pop();
|
|
116721
116778
|
|
|
116722
|
-
const newFilename = join$
|
|
116779
|
+
const newFilename = join$2(dirname, basename);
|
|
116723
116780
|
|
|
116724
|
-
maybeRemoveFile
|
|
116781
|
+
maybeRemoveFile(dirPath, newFilename);
|
|
116725
116782
|
|
|
116726
|
-
setLiteralValue
|
|
116783
|
+
setLiteralValue(filenamePath.get('value'), newFilename);
|
|
116727
116784
|
dirPathFiles.node.value.elements.push(filePath.node);
|
|
116728
116785
|
|
|
116729
116786
|
filePath.remove();
|
|
116730
|
-
maybeFS
|
|
116787
|
+
maybeFS.renameFile(filename, newFilename);
|
|
116731
116788
|
};
|
|
116732
116789
|
|
|
116733
|
-
filesystem
|
|
116734
|
-
const dirname = getFilename$
|
|
116735
|
-
const filename = getFilename$
|
|
116790
|
+
filesystem.copyFile = (filePath, dirPath) => {
|
|
116791
|
+
const dirname = getFilename$4(dirPath);
|
|
116792
|
+
const filename = getFilename$4(filePath);
|
|
116736
116793
|
|
|
116737
116794
|
const basename = filename
|
|
116738
116795
|
.split('/')
|
|
116739
116796
|
.pop();
|
|
116740
116797
|
|
|
116741
|
-
const newFilename = join$
|
|
116742
|
-
const [hasContent, content] = getFileContent
|
|
116798
|
+
const newFilename = join$2(dirname, basename);
|
|
116799
|
+
const [hasContent, content] = getFileContent(filePath);
|
|
116743
116800
|
|
|
116744
|
-
const copiedFile = ObjectExpression$
|
|
116745
|
-
createTypeProperty
|
|
116746
|
-
createFilenameProperty
|
|
116747
|
-
hasContent && createContentProperty
|
|
116801
|
+
const copiedFile = ObjectExpression$1([
|
|
116802
|
+
createTypeProperty('file'),
|
|
116803
|
+
createFilenameProperty(newFilename),
|
|
116804
|
+
hasContent && createContentProperty(content),
|
|
116748
116805
|
].filter(Boolean));
|
|
116749
116806
|
|
|
116750
|
-
maybeRemoveFile
|
|
116807
|
+
maybeRemoveFile(dirPath, newFilename);
|
|
116751
116808
|
|
|
116752
|
-
const dirPathFiles = getFiles$
|
|
116809
|
+
const dirPathFiles = getFiles$1(dirPath);
|
|
116753
116810
|
dirPathFiles.node.value.elements.push(copiedFile);
|
|
116754
116811
|
|
|
116755
|
-
maybeFS
|
|
116812
|
+
maybeFS.copyFile(filename, newFilename);
|
|
116756
116813
|
};
|
|
116757
116814
|
|
|
116758
|
-
function maybeRemoveFile
|
|
116759
|
-
const type = getFileType$
|
|
116815
|
+
function maybeRemoveFile(dirPath, filename) {
|
|
116816
|
+
const type = getFileType$2(dirPath);
|
|
116760
116817
|
|
|
116761
116818
|
if (type !== 'directory') {
|
|
116762
|
-
const filename = getFilename$
|
|
116819
|
+
const filename = getFilename$4(dirPath);
|
|
116763
116820
|
throw Error(`☝️ Looks like '${filename}' is not a directory, but: '${type}'. Rename to '${filename}/'`);
|
|
116764
116821
|
}
|
|
116765
116822
|
|
|
116766
|
-
const dirPathFiles = getProperty$
|
|
116767
|
-
const name = join$
|
|
116768
|
-
const [fileToOverwrite] = findFile$
|
|
116823
|
+
const dirPathFiles = getProperty$2(dirPath, 'files');
|
|
116824
|
+
const name = join$2(getFilename$4(dirPath), basename$1(filename));
|
|
116825
|
+
const [fileToOverwrite] = findFile$5(dirPathFiles, name);
|
|
116769
116826
|
|
|
116770
116827
|
if (!fileToOverwrite)
|
|
116771
116828
|
return;
|
|
@@ -116773,724 +116830,331 @@ function maybeRemoveFile$3(dirPath, filename) {
|
|
|
116773
116830
|
fileToOverwrite.remove();
|
|
116774
116831
|
}
|
|
116775
116832
|
|
|
116776
|
-
const createTypeProperty
|
|
116833
|
+
const createTypeProperty = (type) => ObjectProperty$2(StringLiteral$3('type'), StringLiteral$3(type));
|
|
116777
116834
|
|
|
116778
|
-
filesystem
|
|
116835
|
+
filesystem.createTypeProperty = createTypeProperty;
|
|
116779
116836
|
|
|
116780
|
-
const createFilesProperty
|
|
116837
|
+
const createFilesProperty = (files) => ObjectProperty$2(StringLiteral$3('files'), ArrayExpression$2(files));
|
|
116781
116838
|
|
|
116782
|
-
filesystem
|
|
116839
|
+
filesystem.createFilesProperty = createFilesProperty;
|
|
116783
116840
|
|
|
116784
|
-
const createFilenameProperty
|
|
116841
|
+
const createFilenameProperty = (filename) => ObjectProperty$2(StringLiteral$3('filename'), StringLiteral$3(filename));
|
|
116785
116842
|
|
|
116786
|
-
filesystem
|
|
116843
|
+
filesystem.createFilenameProperty = createFilenameProperty;
|
|
116787
116844
|
|
|
116788
|
-
const createContentProperty
|
|
116845
|
+
const createContentProperty = (content) => ObjectProperty$2(StringLiteral$3('content'), StringLiteral$3(content));
|
|
116789
116846
|
|
|
116790
|
-
filesystem
|
|
116847
|
+
filesystem.createContentProperty = createContentProperty;
|
|
116791
116848
|
|
|
116792
|
-
filesystem
|
|
116793
|
-
maybeRemoveFile
|
|
116849
|
+
filesystem.createFile = (dirPath, name, content) => {
|
|
116850
|
+
maybeRemoveFile(dirPath, name);
|
|
116794
116851
|
|
|
116795
|
-
const dirPathFiles = getFiles$
|
|
116796
|
-
const parentFilename = getFilename$
|
|
116797
|
-
const filename = join$
|
|
116852
|
+
const dirPathFiles = getFiles$1(dirPath);
|
|
116853
|
+
const parentFilename = getFilename$4(dirPath);
|
|
116854
|
+
const filename = join$2(parentFilename, name);
|
|
116798
116855
|
|
|
116799
|
-
const typeProperty = createTypeProperty
|
|
116800
|
-
const filenameProperty = createFilenameProperty
|
|
116856
|
+
const typeProperty = createTypeProperty('file');
|
|
116857
|
+
const filenameProperty = createFilenameProperty(filename);
|
|
116801
116858
|
|
|
116802
116859
|
const properties = [
|
|
116803
116860
|
typeProperty,
|
|
116804
116861
|
filenameProperty,
|
|
116805
|
-
content && createContentProperty
|
|
116862
|
+
content && createContentProperty(content),
|
|
116806
116863
|
].filter(Boolean);
|
|
116807
116864
|
|
|
116808
|
-
dirPathFiles.node.value.elements.push(ObjectExpression$
|
|
116865
|
+
dirPathFiles.node.value.elements.push(ObjectExpression$1(properties));
|
|
116809
116866
|
|
|
116810
116867
|
const filePath = dirPathFiles
|
|
116811
116868
|
.get('value.elements')
|
|
116812
116869
|
.at(-1);
|
|
116813
116870
|
|
|
116814
|
-
if (isString$
|
|
116815
|
-
writeFileContent$
|
|
116871
|
+
if (isString$2(content))
|
|
116872
|
+
writeFileContent$1(filePath, content);
|
|
116816
116873
|
|
|
116817
116874
|
return filePath;
|
|
116818
116875
|
};
|
|
116819
116876
|
|
|
116820
|
-
function getFiles$
|
|
116821
|
-
return getProperty$
|
|
116877
|
+
function getFiles$1(dirPath) {
|
|
116878
|
+
return getProperty$2(dirPath, 'files');
|
|
116822
116879
|
}
|
|
116823
116880
|
|
|
116824
|
-
filesystem
|
|
116825
|
-
const dirPathFiles = getFiles$
|
|
116826
|
-
const parentFilename = getFilename$
|
|
116827
|
-
const filename = join$
|
|
116881
|
+
filesystem.createDirectory = (dirPath, name) => {
|
|
116882
|
+
const dirPathFiles = getFiles$1(dirPath);
|
|
116883
|
+
const parentFilename = getFilename$4(dirPath);
|
|
116884
|
+
const filename = join$2(parentFilename, name);
|
|
116828
116885
|
|
|
116829
|
-
const typeProperty = createTypeProperty
|
|
116830
|
-
const filesProperty = createFilesProperty
|
|
116831
|
-
const filenameProperty = createFilenameProperty
|
|
116886
|
+
const typeProperty = createTypeProperty('directory');
|
|
116887
|
+
const filesProperty = createFilesProperty([]);
|
|
116888
|
+
const filenameProperty = createFilenameProperty(filename);
|
|
116832
116889
|
|
|
116833
|
-
dirPathFiles.node.value.elements.push(ObjectExpression$
|
|
116890
|
+
dirPathFiles.node.value.elements.push(ObjectExpression$1([
|
|
116834
116891
|
typeProperty,
|
|
116835
116892
|
filenameProperty,
|
|
116836
116893
|
filesProperty,
|
|
116837
116894
|
]));
|
|
116838
116895
|
|
|
116839
|
-
maybeFS
|
|
116896
|
+
maybeFS.createDirectory(filename);
|
|
116840
116897
|
|
|
116841
116898
|
return dirPathFiles
|
|
116842
116899
|
.get('value.elements')
|
|
116843
116900
|
.at(-1);
|
|
116844
116901
|
};
|
|
116845
116902
|
|
|
116846
|
-
filesystem
|
|
116847
|
-
const fileType = getFileType$
|
|
116903
|
+
filesystem.readFileContent = (filePath) => {
|
|
116904
|
+
const fileType = getFileType$2(filePath);
|
|
116848
116905
|
|
|
116849
116906
|
if (fileType === 'directory')
|
|
116850
116907
|
return '';
|
|
116851
116908
|
|
|
116852
|
-
const [hasContent, content] = getFileContent
|
|
116909
|
+
const [hasContent, content] = getFileContent(filePath);
|
|
116853
116910
|
|
|
116854
116911
|
if (hasContent)
|
|
116855
|
-
return fromBase64
|
|
116912
|
+
return fromBase64(content);
|
|
116856
116913
|
|
|
116857
|
-
const filename = getFilename$
|
|
116858
|
-
const fileContent = maybeFS
|
|
116914
|
+
const filename = getFilename$4(filePath);
|
|
116915
|
+
const fileContent = maybeFS.readFileContent(filename);
|
|
116859
116916
|
|
|
116860
|
-
const property = createContentProperty
|
|
116917
|
+
const property = createContentProperty(toBase64(fileContent));
|
|
116861
116918
|
|
|
116862
116919
|
filePath.node.properties.push(property);
|
|
116863
116920
|
|
|
116864
116921
|
return fileContent;
|
|
116865
116922
|
};
|
|
116866
116923
|
|
|
116867
|
-
filesystem
|
|
116924
|
+
filesystem.writeFileContent = writeFileContent$1;
|
|
116868
116925
|
|
|
116869
|
-
function writeFileContent$
|
|
116870
|
-
const fileType = getFileType$
|
|
116926
|
+
function writeFileContent$1(filePath, content) {
|
|
116927
|
+
const fileType = getFileType$2(filePath);
|
|
116871
116928
|
|
|
116872
116929
|
if (fileType === 'directory')
|
|
116873
116930
|
return;
|
|
116874
116931
|
|
|
116875
|
-
const filename = getFilename$
|
|
116932
|
+
const filename = getFilename$4(filePath);
|
|
116876
116933
|
|
|
116877
|
-
maybeFS
|
|
116934
|
+
maybeFS.writeFileContent(filename, content);
|
|
116878
116935
|
|
|
116879
|
-
const contentPath = getProperty$
|
|
116936
|
+
const contentPath = getProperty$2(filePath, 'content');
|
|
116880
116937
|
|
|
116881
116938
|
if (contentPath) {
|
|
116882
|
-
setLiteralValue
|
|
116939
|
+
setLiteralValue(contentPath.node.value, toBase64(content));
|
|
116883
116940
|
return;
|
|
116884
116941
|
}
|
|
116885
116942
|
|
|
116886
|
-
const property = createContentProperty
|
|
116943
|
+
const property = createContentProperty(toBase64(content));
|
|
116887
116944
|
filePath.node.properties.push(property);
|
|
116888
116945
|
}
|
|
116889
116946
|
|
|
116890
|
-
filesystem
|
|
116891
|
-
filesystem
|
|
116947
|
+
filesystem.init = maybeFS.init;
|
|
116948
|
+
filesystem.deinit = maybeFS.deinit;
|
|
116892
116949
|
|
|
116893
|
-
filesystem
|
|
116894
|
-
filesystem
|
|
116950
|
+
filesystem.pause = maybeFS.pause;
|
|
116951
|
+
filesystem.start = maybeFS.start;
|
|
116895
116952
|
|
|
116896
116953
|
var convertSimpleFilesystemToFilesystem = {};
|
|
116897
116954
|
|
|
116898
|
-
|
|
116899
|
-
|
|
116900
|
-
|
|
116901
|
-
|
|
116902
|
-
|
|
116903
|
-
|
|
116904
|
-
|
|
116905
|
-
|
|
116906
|
-
const noop$3 = () => {};
|
|
116907
|
-
const returns$2 = (a) => () => a;
|
|
116908
|
-
|
|
116909
|
-
const defaultFS$2 = {
|
|
116910
|
-
renameFile: noop$3,
|
|
116911
|
-
removeFile: noop$3,
|
|
116912
|
-
createDirectory: noop$3,
|
|
116913
|
-
readFileContent: returns$2(''),
|
|
116914
|
-
writeFileContent: noop$3,
|
|
116915
|
-
copyFile: noop$3,
|
|
116916
|
-
};
|
|
116917
|
-
|
|
116918
|
-
const maybeFS$5 = assign$2({}, defaultFS$2);
|
|
116919
|
-
|
|
116920
|
-
maybeFs$2.renameFile = (oldName, newName) => {
|
|
116921
|
-
maybeFS$5.renameFile(oldName, newName);
|
|
116922
|
-
};
|
|
116955
|
+
const {types: types$5} = bundle;
|
|
116956
|
+
const {basename, dirname} = require$$0$2;
|
|
116957
|
+
const {
|
|
116958
|
+
createDirectory,
|
|
116959
|
+
getFileType: getFileType$1,
|
|
116960
|
+
getFilename: getFilename$3,
|
|
116961
|
+
findFile: findFile$4,
|
|
116962
|
+
} = filesystem;
|
|
116923
116963
|
|
|
116924
|
-
|
|
116925
|
-
|
|
116926
|
-
};
|
|
116964
|
+
const {__filesystem_name: __filesystem_name$2} = json;
|
|
116965
|
+
const {replaceWith: replaceWith$1, getProperty: getProperty$1} = operate;
|
|
116927
116966
|
|
|
116928
|
-
|
|
116929
|
-
|
|
116930
|
-
|
|
116967
|
+
const {
|
|
116968
|
+
ObjectExpression,
|
|
116969
|
+
ArrayExpression: ArrayExpression$1,
|
|
116970
|
+
StringLiteral: StringLiteral$2,
|
|
116971
|
+
ObjectProperty: ObjectProperty$1,
|
|
116972
|
+
isArrayExpression,
|
|
116973
|
+
isStringLiteral,
|
|
116974
|
+
isTemplateLiteral,
|
|
116975
|
+
} = types$5;
|
|
116931
116976
|
|
|
116932
|
-
|
|
116933
|
-
maybeFS$5.createDirectory(name);
|
|
116934
|
-
};
|
|
116977
|
+
convertSimpleFilesystemToFilesystem.report = () => `Convert Simple Filesystem to Filesystem`;
|
|
116935
116978
|
|
|
116936
|
-
|
|
116937
|
-
|
|
116979
|
+
const isDirectory = (a) => a.endsWith('/');
|
|
116980
|
+
const getType = (a) => {
|
|
116981
|
+
const type = isDirectory(a) ? 'directory' : 'file';
|
|
116982
|
+
|
|
116983
|
+
return ObjectProperty$1(StringLiteral$2('type'), StringLiteral$2(type));
|
|
116938
116984
|
};
|
|
116939
116985
|
|
|
116940
|
-
|
|
116941
|
-
|
|
116986
|
+
const createFilename = (filename) => {
|
|
116987
|
+
return ObjectProperty$1(StringLiteral$2('filename'), StringLiteral$2(filename));
|
|
116942
116988
|
};
|
|
116943
116989
|
|
|
116944
|
-
|
|
116945
|
-
|
|
116946
|
-
|
|
116947
|
-
|
|
116948
|
-
|
|
116949
|
-
|
|
116950
|
-
maybeFs$2.pause = () => {
|
|
116951
|
-
driverStore$2(maybeFS$5);
|
|
116952
|
-
deinit$2();
|
|
116990
|
+
const getFiles = (a) => {
|
|
116991
|
+
if (isDirectory(a))
|
|
116992
|
+
return ObjectProperty$1(StringLiteral$2('files'), ArrayExpression$1([]));
|
|
116993
|
+
|
|
116994
|
+
return null;
|
|
116953
116995
|
};
|
|
116954
116996
|
|
|
116955
|
-
|
|
116956
|
-
|
|
116997
|
+
const getContent = (a) => {
|
|
116998
|
+
return ObjectProperty$1(StringLiteral$2('content'), StringLiteral$2(a));
|
|
116957
116999
|
};
|
|
116958
117000
|
|
|
116959
|
-
|
|
116960
|
-
|
|
116961
|
-
|
|
116962
|
-
assign$2(maybeFS$5, defaultFS$2);
|
|
116963
|
-
}
|
|
116964
|
-
|
|
116965
|
-
const {join: join$4, basename: basename$3} = require$$0$2;
|
|
116966
|
-
const tryCatch$4 = tryCatch$9;
|
|
116967
|
-
const {types: types$8} = bundle;
|
|
116968
|
-
|
|
116969
|
-
const {
|
|
116970
|
-
setLiteralValue: setLiteralValue$2,
|
|
116971
|
-
getProperty: getProperty$4,
|
|
116972
|
-
traverseProperties: traverseProperties$3,
|
|
116973
|
-
} = operate;
|
|
116974
|
-
|
|
116975
|
-
const maybeFS$4 = maybeFs$2;
|
|
116976
|
-
const isString$4 = (a) => typeof a === 'string';
|
|
116977
|
-
const {isArray: isArray$4} = Array;
|
|
116978
|
-
const maybeArray$3 = (a) => isArray$4(a) ? a : [a];
|
|
116979
|
-
|
|
116980
|
-
const toBase64$2 = (content) => {
|
|
116981
|
-
const [e, result] = tryCatch$4(btoa, content);
|
|
117001
|
+
function parseContent(node, path) {
|
|
117002
|
+
if (isStringLiteral(node))
|
|
117003
|
+
return node.value;
|
|
116982
117004
|
|
|
116983
|
-
if (
|
|
116984
|
-
return btoa(
|
|
117005
|
+
if (isTemplateLiteral(node))
|
|
117006
|
+
return btoa(node.quasis[0].value.raw);
|
|
116985
117007
|
|
|
116986
|
-
|
|
116987
|
-
}
|
|
117008
|
+
throw Error(`☝️ Looks like wrong content type: '${node.type}' from file: '${path}'`);
|
|
117009
|
+
}
|
|
116988
117010
|
|
|
116989
|
-
|
|
116990
|
-
const
|
|
117011
|
+
convertSimpleFilesystemToFilesystem.fix = (path) => {
|
|
117012
|
+
const array = ArrayExpression$1([]);
|
|
116991
117013
|
|
|
116992
|
-
|
|
116993
|
-
|
|
117014
|
+
for (const element of path.get('elements')) {
|
|
117015
|
+
if (isArrayExpression(element)) {
|
|
117016
|
+
const [nodeValue, nodeContent] = element.node.elements;
|
|
117017
|
+
const {value} = nodeValue;
|
|
117018
|
+
|
|
117019
|
+
const content = parseContent(nodeContent, element);
|
|
117020
|
+
|
|
117021
|
+
array.elements.push(ObjectExpression([
|
|
117022
|
+
getType(value),
|
|
117023
|
+
createFilename(value),
|
|
117024
|
+
getContent(content),
|
|
117025
|
+
]));
|
|
117026
|
+
continue;
|
|
117027
|
+
}
|
|
117028
|
+
|
|
117029
|
+
if (isStringLiteral(element)) {
|
|
117030
|
+
const {value} = element.node;
|
|
117031
|
+
|
|
117032
|
+
array.elements.push(ObjectExpression([
|
|
117033
|
+
getType(value),
|
|
117034
|
+
createFilename(noTrailingSlash(value)),
|
|
117035
|
+
getFiles(value),
|
|
117036
|
+
].filter(Boolean)));
|
|
117037
|
+
continue;
|
|
117038
|
+
}
|
|
117039
|
+
|
|
117040
|
+
throw Error(`☝️ Looks like file '${element}' has wrong type: '${element.type}' expected: 'string | array'`);
|
|
117041
|
+
}
|
|
116994
117042
|
|
|
116995
|
-
|
|
117043
|
+
buildTree(path, array);
|
|
116996
117044
|
};
|
|
116997
117045
|
|
|
116998
|
-
|
|
116999
|
-
|
|
117000
|
-
|
|
117001
|
-
|
|
117002
|
-
|
|
117003
|
-
|
|
117004
|
-
} = types$8;
|
|
117005
|
-
|
|
117006
|
-
const getRegExp$2 = (wildcard) => {
|
|
117007
|
-
const escaped = wildcard
|
|
117008
|
-
.replace(/\./g, '\\.')
|
|
117009
|
-
.replace(/\*/g, '.*')
|
|
117010
|
-
.replace('?', '.?');
|
|
117011
|
-
|
|
117012
|
-
return RegExp(`^${escaped}$`);
|
|
117013
|
-
};
|
|
117046
|
+
convertSimpleFilesystemToFilesystem.traverse = ({push}) => ({
|
|
117047
|
+
[`${__filesystem_name$2}(__array)`]: (path) => {
|
|
117048
|
+
const root = path.get('arguments.0');
|
|
117049
|
+
push(root);
|
|
117050
|
+
},
|
|
117051
|
+
});
|
|
117014
117052
|
|
|
117015
|
-
|
|
117016
|
-
|
|
117017
|
-
|
|
117018
|
-
if (isProgram$3(parentPath))
|
|
117019
|
-
return null;
|
|
117053
|
+
const noTrailingSlash = (a) => {
|
|
117054
|
+
if (a === '/')
|
|
117055
|
+
return a;
|
|
117020
117056
|
|
|
117021
|
-
return
|
|
117057
|
+
return a.endsWith('/') ? a.slice(0, -1) : a;
|
|
117022
117058
|
};
|
|
117023
117059
|
|
|
117024
|
-
|
|
117025
|
-
|
|
117026
|
-
function findFile$7(node, name) {
|
|
117027
|
-
checkName$2(name);
|
|
117028
|
-
|
|
117029
|
-
const filePaths = [];
|
|
117030
|
-
const names = maybeArray$3(name);
|
|
117060
|
+
function buildTree(path, list) {
|
|
117061
|
+
const [root, ...files] = findFile$4(list, '*');
|
|
117031
117062
|
|
|
117032
|
-
for (const
|
|
117033
|
-
const
|
|
117034
|
-
const base = basename$3(value);
|
|
117063
|
+
for (const filePath of files) {
|
|
117064
|
+
const filename = getFilename$3(filePath);
|
|
117035
117065
|
|
|
117036
|
-
|
|
117037
|
-
|
|
117038
|
-
|
|
117066
|
+
check$2(filename);
|
|
117067
|
+
|
|
117068
|
+
const type = getFileType$1(filePath);
|
|
117069
|
+
const dir = dirname(filename);
|
|
117070
|
+
const name = basename(filename);
|
|
117071
|
+
const [dirPath] = findFile$4(root, dir);
|
|
117072
|
+
|
|
117073
|
+
if (!dirPath || getFileType$1(dirPath) !== 'directory')
|
|
117074
|
+
throw Error(`☝️ Looks like directory '${dir}/' is missing`);
|
|
117075
|
+
|
|
117076
|
+
if (type === 'directory') {
|
|
117077
|
+
createDirectory(dirPath, name);
|
|
117078
|
+
continue;
|
|
117039
117079
|
}
|
|
117080
|
+
|
|
117081
|
+
const filesProperty = getProperty$1(dirPath, 'files');
|
|
117082
|
+
filesProperty.node.value.elements.push(filePath.node);
|
|
117040
117083
|
}
|
|
117041
117084
|
|
|
117042
|
-
|
|
117043
|
-
}
|
|
117044
|
-
|
|
117045
|
-
function checkName$2(name) {
|
|
117046
|
-
if (!isString$4(name) && !isArray$4(name))
|
|
117047
|
-
throw Error(`☝️ Looks like you forget to pass the 'name' of a file to 'findFile(filePath: Path|FilePath, name: string | string[]): FilePath'`);
|
|
117085
|
+
replaceWith$1(path, root);
|
|
117048
117086
|
}
|
|
117049
117087
|
|
|
117050
|
-
function
|
|
117051
|
-
|
|
117052
|
-
|
|
117088
|
+
function check$2(filename) {
|
|
117089
|
+
if (!filename.includes('/'))
|
|
117090
|
+
throw Error(`☝️ Looks like directory path is missing: '${filename}'`);
|
|
117053
117091
|
}
|
|
117054
117092
|
|
|
117055
|
-
|
|
117056
|
-
const {value} = getFilenamePath$2(filePath).node;
|
|
117057
|
-
return value;
|
|
117058
|
-
}
|
|
117093
|
+
var convertFilesystemToSimpleFilesystem = {};
|
|
117059
117094
|
|
|
117060
|
-
|
|
117095
|
+
const {types: types$4} = bundle;
|
|
117096
|
+
const {replaceWith, getProperty} = operate;
|
|
117097
|
+
const {__filesystem_name: __filesystem_name$1} = json;
|
|
117061
117098
|
|
|
117062
|
-
|
|
117063
|
-
|
|
117064
|
-
|
|
117065
|
-
|
|
117099
|
+
const {
|
|
117100
|
+
findFile: findFile$3,
|
|
117101
|
+
getFilename: getFilename$2,
|
|
117102
|
+
getFileType,
|
|
117103
|
+
} = filesystem;
|
|
117066
117104
|
|
|
117067
|
-
|
|
117105
|
+
const {
|
|
117106
|
+
StringLiteral: StringLiteral$1,
|
|
117107
|
+
ArrayExpression,
|
|
117108
|
+
} = types$4;
|
|
117068
117109
|
|
|
117069
|
-
|
|
117070
|
-
|
|
117071
|
-
|
|
117072
|
-
return [
|
|
117073
|
-
Boolean(content),
|
|
117074
|
-
content?.node.value.value,
|
|
117075
|
-
];
|
|
117076
|
-
}
|
|
117110
|
+
const {isArray: isArray$1} = Array;
|
|
117111
|
+
const maybeAddSlash = (a) => a === '/' ? a : `${a}/`;
|
|
117077
117112
|
|
|
117078
|
-
|
|
117113
|
+
convertFilesystemToSimpleFilesystem.report = () => `Convert Filesystem to Simple Filesystem`;
|
|
117079
117114
|
|
|
117080
|
-
|
|
117081
|
-
const
|
|
117082
|
-
const valuePath = getFilenamePath$2(filePath);
|
|
117083
|
-
const baseName = oldName
|
|
117084
|
-
.split('/')
|
|
117085
|
-
.pop();
|
|
117115
|
+
convertFilesystemToSimpleFilesystem.fix = (root, {files}) => {
|
|
117116
|
+
const names = [];
|
|
117086
117117
|
|
|
117087
|
-
const
|
|
117088
|
-
|
|
117089
|
-
|
|
117118
|
+
for (const file of files) {
|
|
117119
|
+
const filename = getFilename$2(file);
|
|
117120
|
+
const type = getFileType(file);
|
|
117121
|
+
const contentPath = getProperty(file, 'content');
|
|
117122
|
+
const content = contentPath?.node?.value;
|
|
117123
|
+
|
|
117124
|
+
if (content) {
|
|
117125
|
+
names.push([filename, content.value]);
|
|
117126
|
+
continue;
|
|
117127
|
+
}
|
|
117128
|
+
|
|
117129
|
+
if (type === 'directory') {
|
|
117130
|
+
names.push(maybeAddSlash(filename));
|
|
117131
|
+
continue;
|
|
117132
|
+
}
|
|
117133
|
+
|
|
117134
|
+
names.push(filename);
|
|
117135
|
+
}
|
|
117090
117136
|
|
|
117091
|
-
const
|
|
117092
|
-
|
|
117093
|
-
setLiteralValue$2(valuePath, newFilename);
|
|
117094
|
-
maybeFS$4.renameFile(oldName, newFilename);
|
|
117095
|
-
};
|
|
117096
|
-
|
|
117097
|
-
filesystem$2.removeFile = (filePath) => {
|
|
117098
|
-
const filename = getFilename$6(filePath);
|
|
117099
|
-
|
|
117100
|
-
filePath.remove();
|
|
117101
|
-
maybeFS$4.removeFile(filename);
|
|
117102
|
-
};
|
|
117103
|
-
|
|
117104
|
-
filesystem$2.moveFile = (filePath, dirPath) => {
|
|
117105
|
-
if (filePath === dirPath)
|
|
117106
|
-
return;
|
|
117107
|
-
|
|
117108
|
-
const dirname = getFilename$6(dirPath);
|
|
117109
|
-
const filename = getFilename$6(filePath);
|
|
117110
|
-
const dirPathFiles = getProperty$4(dirPath, 'files');
|
|
117111
|
-
const filenamePath = getProperty$4(filePath, 'filename');
|
|
117112
|
-
|
|
117113
|
-
const basename = filename
|
|
117114
|
-
.split('/')
|
|
117115
|
-
.pop();
|
|
117116
|
-
|
|
117117
|
-
const newFilename = join$4(dirname, basename);
|
|
117118
|
-
|
|
117119
|
-
maybeRemoveFile$2(dirPath, newFilename);
|
|
117120
|
-
|
|
117121
|
-
setLiteralValue$2(filenamePath.get('value'), newFilename);
|
|
117122
|
-
dirPathFiles.node.value.elements.push(filePath.node);
|
|
117123
|
-
|
|
117124
|
-
filePath.remove();
|
|
117125
|
-
maybeFS$4.renameFile(filename, newFilename);
|
|
117126
|
-
};
|
|
117127
|
-
|
|
117128
|
-
filesystem$2.copyFile = (filePath, dirPath) => {
|
|
117129
|
-
const dirname = getFilename$6(dirPath);
|
|
117130
|
-
const filename = getFilename$6(filePath);
|
|
117131
|
-
|
|
117132
|
-
const basename = filename
|
|
117133
|
-
.split('/')
|
|
117134
|
-
.pop();
|
|
117135
|
-
|
|
117136
|
-
const newFilename = join$4(dirname, basename);
|
|
117137
|
-
const [hasContent, content] = getFileContent$2(filePath);
|
|
117138
|
-
|
|
117139
|
-
const copiedFile = ObjectExpression$3([
|
|
117140
|
-
createTypeProperty$2('file'),
|
|
117141
|
-
createFilenameProperty$2(newFilename),
|
|
117142
|
-
hasContent && createContentProperty$2(content),
|
|
117143
|
-
].filter(Boolean));
|
|
117144
|
-
|
|
117145
|
-
maybeRemoveFile$2(dirPath, newFilename);
|
|
117146
|
-
|
|
117147
|
-
const dirPathFiles = getFiles$3(dirPath);
|
|
117148
|
-
dirPathFiles.node.value.elements.push(copiedFile);
|
|
117149
|
-
|
|
117150
|
-
maybeFS$4.copyFile(filename, newFilename);
|
|
117151
|
-
};
|
|
117152
|
-
|
|
117153
|
-
function maybeRemoveFile$2(dirPath, filename) {
|
|
117154
|
-
const type = getFileType$4(dirPath);
|
|
117155
|
-
|
|
117156
|
-
if (type !== 'directory') {
|
|
117157
|
-
const filename = getFilename$6(dirPath);
|
|
117158
|
-
throw Error(`☝️ Looks like '${filename}' is not a directory, but: '${type}'. Rename to '${filename}/'`);
|
|
117159
|
-
}
|
|
117160
|
-
|
|
117161
|
-
const dirPathFiles = getProperty$4(dirPath, 'files');
|
|
117162
|
-
const name = join$4(getFilename$6(dirPath), basename$3(filename));
|
|
117163
|
-
const [fileToOverwrite] = findFile$7(dirPathFiles, name);
|
|
117164
|
-
|
|
117165
|
-
if (!fileToOverwrite)
|
|
117166
|
-
return;
|
|
117167
|
-
|
|
117168
|
-
fileToOverwrite.remove();
|
|
117169
|
-
}
|
|
117170
|
-
|
|
117171
|
-
const createTypeProperty$2 = (type) => ObjectProperty$4(StringLiteral$5('type'), StringLiteral$5(type));
|
|
117172
|
-
|
|
117173
|
-
filesystem$2.createTypeProperty = createTypeProperty$2;
|
|
117174
|
-
|
|
117175
|
-
const createFilesProperty$2 = (files) => ObjectProperty$4(StringLiteral$5('files'), ArrayExpression$4(files));
|
|
117176
|
-
|
|
117177
|
-
filesystem$2.createFilesProperty = createFilesProperty$2;
|
|
117178
|
-
|
|
117179
|
-
const createFilenameProperty$2 = (filename) => ObjectProperty$4(StringLiteral$5('filename'), StringLiteral$5(filename));
|
|
117180
|
-
|
|
117181
|
-
filesystem$2.createFilenameProperty = createFilenameProperty$2;
|
|
117182
|
-
|
|
117183
|
-
const createContentProperty$2 = (content) => ObjectProperty$4(StringLiteral$5('content'), StringLiteral$5(content));
|
|
117184
|
-
|
|
117185
|
-
filesystem$2.createContentProperty = createContentProperty$2;
|
|
117186
|
-
|
|
117187
|
-
filesystem$2.createFile = (dirPath, name, content) => {
|
|
117188
|
-
maybeRemoveFile$2(dirPath, name);
|
|
117189
|
-
|
|
117190
|
-
const dirPathFiles = getFiles$3(dirPath);
|
|
117191
|
-
const parentFilename = getFilename$6(dirPath);
|
|
117192
|
-
const filename = join$4(parentFilename, name);
|
|
117193
|
-
|
|
117194
|
-
const typeProperty = createTypeProperty$2('file');
|
|
117195
|
-
const filenameProperty = createFilenameProperty$2(filename);
|
|
117196
|
-
|
|
117197
|
-
const properties = [
|
|
117198
|
-
typeProperty,
|
|
117199
|
-
filenameProperty,
|
|
117200
|
-
content && createContentProperty$2(content),
|
|
117201
|
-
].filter(Boolean);
|
|
117202
|
-
|
|
117203
|
-
dirPathFiles.node.value.elements.push(ObjectExpression$3(properties));
|
|
117204
|
-
|
|
117205
|
-
const filePath = dirPathFiles
|
|
117206
|
-
.get('value.elements')
|
|
117207
|
-
.at(-1);
|
|
117208
|
-
|
|
117209
|
-
if (isString$4(content))
|
|
117210
|
-
writeFileContent$3(filePath, content);
|
|
117211
|
-
|
|
117212
|
-
return filePath;
|
|
117213
|
-
};
|
|
117214
|
-
|
|
117215
|
-
function getFiles$3(dirPath) {
|
|
117216
|
-
return getProperty$4(dirPath, 'files');
|
|
117217
|
-
}
|
|
117218
|
-
|
|
117219
|
-
filesystem$2.createDirectory = (dirPath, name) => {
|
|
117220
|
-
const dirPathFiles = getFiles$3(dirPath);
|
|
117221
|
-
const parentFilename = getFilename$6(dirPath);
|
|
117222
|
-
const filename = join$4(parentFilename, name);
|
|
117223
|
-
|
|
117224
|
-
const typeProperty = createTypeProperty$2('directory');
|
|
117225
|
-
const filesProperty = createFilesProperty$2([]);
|
|
117226
|
-
const filenameProperty = createFilenameProperty$2(filename);
|
|
117227
|
-
|
|
117228
|
-
dirPathFiles.node.value.elements.push(ObjectExpression$3([
|
|
117229
|
-
typeProperty,
|
|
117230
|
-
filenameProperty,
|
|
117231
|
-
filesProperty,
|
|
117232
|
-
]));
|
|
117233
|
-
|
|
117234
|
-
maybeFS$4.createDirectory(filename);
|
|
117235
|
-
|
|
117236
|
-
return dirPathFiles
|
|
117237
|
-
.get('value.elements')
|
|
117238
|
-
.at(-1);
|
|
117239
|
-
};
|
|
117240
|
-
|
|
117241
|
-
filesystem$2.readFileContent = (filePath) => {
|
|
117242
|
-
const fileType = getFileType$4(filePath);
|
|
117243
|
-
|
|
117244
|
-
if (fileType === 'directory')
|
|
117245
|
-
return '';
|
|
117246
|
-
|
|
117247
|
-
const [hasContent, content] = getFileContent$2(filePath);
|
|
117248
|
-
|
|
117249
|
-
if (hasContent)
|
|
117250
|
-
return fromBase64$2(content);
|
|
117251
|
-
|
|
117252
|
-
const filename = getFilename$6(filePath);
|
|
117253
|
-
const fileContent = maybeFS$4.readFileContent(filename);
|
|
117254
|
-
|
|
117255
|
-
const property = createContentProperty$2(toBase64$2(fileContent));
|
|
117256
|
-
|
|
117257
|
-
filePath.node.properties.push(property);
|
|
117258
|
-
|
|
117259
|
-
return fileContent;
|
|
117260
|
-
};
|
|
117261
|
-
|
|
117262
|
-
filesystem$2.writeFileContent = writeFileContent$3;
|
|
117263
|
-
|
|
117264
|
-
function writeFileContent$3(filePath, content) {
|
|
117265
|
-
const fileType = getFileType$4(filePath);
|
|
117266
|
-
|
|
117267
|
-
if (fileType === 'directory')
|
|
117268
|
-
return;
|
|
117269
|
-
|
|
117270
|
-
const filename = getFilename$6(filePath);
|
|
117271
|
-
|
|
117272
|
-
maybeFS$4.writeFileContent(filename, content);
|
|
117273
|
-
|
|
117274
|
-
const contentPath = getProperty$4(filePath, 'content');
|
|
117275
|
-
|
|
117276
|
-
if (contentPath) {
|
|
117277
|
-
setLiteralValue$2(contentPath.node.value, toBase64$2(content));
|
|
117278
|
-
return;
|
|
117279
|
-
}
|
|
117280
|
-
|
|
117281
|
-
const property = createContentProperty$2(toBase64$2(content));
|
|
117282
|
-
filePath.node.properties.push(property);
|
|
117283
|
-
}
|
|
117284
|
-
|
|
117285
|
-
filesystem$2.init = maybeFS$4.init;
|
|
117286
|
-
filesystem$2.deinit = maybeFS$4.deinit;
|
|
117287
|
-
|
|
117288
|
-
filesystem$2.pause = maybeFS$4.pause;
|
|
117289
|
-
filesystem$2.start = maybeFS$4.start;
|
|
117290
|
-
|
|
117291
|
-
const {types: types$7} = bundle;
|
|
117292
|
-
const {basename: basename$2, dirname} = require$$0$2;
|
|
117293
|
-
const {
|
|
117294
|
-
createDirectory,
|
|
117295
|
-
getFileType: getFileType$3,
|
|
117296
|
-
getFilename: getFilename$5,
|
|
117297
|
-
findFile: findFile$6,
|
|
117298
|
-
} = filesystem$2;
|
|
117299
|
-
|
|
117300
|
-
const {__filesystem_name: __filesystem_name$2} = json;
|
|
117301
|
-
const {replaceWith: replaceWith$1, getProperty: getProperty$3} = operate;
|
|
117302
|
-
|
|
117303
|
-
const {
|
|
117304
|
-
ObjectExpression: ObjectExpression$2,
|
|
117305
|
-
ArrayExpression: ArrayExpression$3,
|
|
117306
|
-
StringLiteral: StringLiteral$4,
|
|
117307
|
-
ObjectProperty: ObjectProperty$3,
|
|
117308
|
-
isArrayExpression,
|
|
117309
|
-
isStringLiteral,
|
|
117310
|
-
isTemplateLiteral,
|
|
117311
|
-
} = types$7;
|
|
117312
|
-
|
|
117313
|
-
convertSimpleFilesystemToFilesystem.report = () => `Convert Simple Filesystem to Filesystem`;
|
|
117314
|
-
|
|
117315
|
-
const isDirectory = (a) => a.endsWith('/');
|
|
117316
|
-
const getType = (a) => {
|
|
117317
|
-
const type = isDirectory(a) ? 'directory' : 'file';
|
|
117318
|
-
|
|
117319
|
-
return ObjectProperty$3(StringLiteral$4('type'), StringLiteral$4(type));
|
|
117320
|
-
};
|
|
117321
|
-
|
|
117322
|
-
const createFilename = (filename) => {
|
|
117323
|
-
return ObjectProperty$3(StringLiteral$4('filename'), StringLiteral$4(filename));
|
|
117324
|
-
};
|
|
117325
|
-
|
|
117326
|
-
const getFiles$2 = (a) => {
|
|
117327
|
-
if (isDirectory(a))
|
|
117328
|
-
return ObjectProperty$3(StringLiteral$4('files'), ArrayExpression$3([]));
|
|
117329
|
-
|
|
117330
|
-
return null;
|
|
117331
|
-
};
|
|
117332
|
-
|
|
117333
|
-
const getContent = (a) => {
|
|
117334
|
-
return ObjectProperty$3(StringLiteral$4('content'), StringLiteral$4(a));
|
|
117335
|
-
};
|
|
117336
|
-
|
|
117337
|
-
function parseContent(node, path) {
|
|
117338
|
-
if (isStringLiteral(node))
|
|
117339
|
-
return node.value;
|
|
117340
|
-
|
|
117341
|
-
if (isTemplateLiteral(node))
|
|
117342
|
-
return btoa(node.quasis[0].value.raw);
|
|
117343
|
-
|
|
117344
|
-
throw Error(`☝️ Looks like wrong content type: '${node.type}' from file: '${path}'`);
|
|
117345
|
-
}
|
|
117346
|
-
|
|
117347
|
-
convertSimpleFilesystemToFilesystem.fix = (path) => {
|
|
117348
|
-
const array = ArrayExpression$3([]);
|
|
117349
|
-
|
|
117350
|
-
for (const element of path.get('elements')) {
|
|
117351
|
-
if (isArrayExpression(element)) {
|
|
117352
|
-
const [nodeValue, nodeContent] = element.node.elements;
|
|
117353
|
-
const {value} = nodeValue;
|
|
117354
|
-
|
|
117355
|
-
const content = parseContent(nodeContent, element);
|
|
117356
|
-
|
|
117357
|
-
array.elements.push(ObjectExpression$2([
|
|
117358
|
-
getType(value),
|
|
117359
|
-
createFilename(value),
|
|
117360
|
-
getContent(content),
|
|
117361
|
-
]));
|
|
117362
|
-
continue;
|
|
117363
|
-
}
|
|
117364
|
-
|
|
117365
|
-
if (isStringLiteral(element)) {
|
|
117366
|
-
const {value} = element.node;
|
|
117367
|
-
|
|
117368
|
-
array.elements.push(ObjectExpression$2([
|
|
117369
|
-
getType(value),
|
|
117370
|
-
createFilename(noTrailingSlash(value)),
|
|
117371
|
-
getFiles$2(value),
|
|
117372
|
-
].filter(Boolean)));
|
|
117373
|
-
continue;
|
|
117374
|
-
}
|
|
117375
|
-
|
|
117376
|
-
throw Error(`☝️ Looks like file '${element}' has wrong type: '${element.type}' expected: 'string | array'`);
|
|
117377
|
-
}
|
|
117378
|
-
|
|
117379
|
-
buildTree(path, array);
|
|
117380
|
-
};
|
|
117381
|
-
|
|
117382
|
-
convertSimpleFilesystemToFilesystem.traverse = ({push}) => ({
|
|
117383
|
-
[`${__filesystem_name$2}(__array)`]: (path) => {
|
|
117384
|
-
const root = path.get('arguments.0');
|
|
117385
|
-
push(root);
|
|
117386
|
-
},
|
|
117387
|
-
});
|
|
117388
|
-
|
|
117389
|
-
const noTrailingSlash = (a) => {
|
|
117390
|
-
if (a === '/')
|
|
117391
|
-
return a;
|
|
117392
|
-
|
|
117393
|
-
return a.endsWith('/') ? a.slice(0, -1) : a;
|
|
117394
|
-
};
|
|
117395
|
-
|
|
117396
|
-
function buildTree(path, list) {
|
|
117397
|
-
const [root, ...files] = findFile$6(list, '*');
|
|
117398
|
-
|
|
117399
|
-
for (const filePath of files) {
|
|
117400
|
-
const filename = getFilename$5(filePath);
|
|
117401
|
-
|
|
117402
|
-
check$2(filename);
|
|
117403
|
-
|
|
117404
|
-
const type = getFileType$3(filePath);
|
|
117405
|
-
const dir = dirname(filename);
|
|
117406
|
-
const name = basename$2(filename);
|
|
117407
|
-
const [dirPath] = findFile$6(root, dir);
|
|
117408
|
-
|
|
117409
|
-
if (!dirPath || getFileType$3(dirPath) !== 'directory')
|
|
117410
|
-
throw Error(`☝️ Looks like directory '${dir}/' is missing`);
|
|
117411
|
-
|
|
117412
|
-
if (type === 'directory') {
|
|
117413
|
-
createDirectory(dirPath, name);
|
|
117414
|
-
continue;
|
|
117415
|
-
}
|
|
117416
|
-
|
|
117417
|
-
const filesProperty = getProperty$3(dirPath, 'files');
|
|
117418
|
-
filesProperty.node.value.elements.push(filePath.node);
|
|
117419
|
-
}
|
|
117420
|
-
|
|
117421
|
-
replaceWith$1(path, root);
|
|
117422
|
-
}
|
|
117423
|
-
|
|
117424
|
-
function check$2(filename) {
|
|
117425
|
-
if (!filename.includes('/'))
|
|
117426
|
-
throw Error(`☝️ Looks like directory path is missing: '${filename}'`);
|
|
117427
|
-
}
|
|
117428
|
-
|
|
117429
|
-
var convertFilesystemToSimpleFilesystem = {};
|
|
117430
|
-
|
|
117431
|
-
const {types: types$6} = bundle;
|
|
117432
|
-
const {replaceWith, getProperty: getProperty$2} = operate;
|
|
117433
|
-
const {__filesystem_name: __filesystem_name$1} = json;
|
|
117434
|
-
|
|
117435
|
-
const {
|
|
117436
|
-
findFile: findFile$5,
|
|
117437
|
-
getFilename: getFilename$4,
|
|
117438
|
-
getFileType: getFileType$2,
|
|
117439
|
-
} = filesystem$2;
|
|
117440
|
-
|
|
117441
|
-
const {
|
|
117442
|
-
StringLiteral: StringLiteral$3,
|
|
117443
|
-
ArrayExpression: ArrayExpression$2,
|
|
117444
|
-
} = types$6;
|
|
117445
|
-
|
|
117446
|
-
const {isArray: isArray$3} = Array;
|
|
117447
|
-
const maybeAddSlash = (a) => a === '/' ? a : `${a}/`;
|
|
117448
|
-
|
|
117449
|
-
convertFilesystemToSimpleFilesystem.report = () => `Convert Filesystem to Simple Filesystem`;
|
|
117450
|
-
|
|
117451
|
-
convertFilesystemToSimpleFilesystem.fix = (root, {files}) => {
|
|
117452
|
-
const names = [];
|
|
117453
|
-
|
|
117454
|
-
for (const file of files) {
|
|
117455
|
-
const filename = getFilename$4(file);
|
|
117456
|
-
const type = getFileType$2(file);
|
|
117457
|
-
const contentPath = getProperty$2(file, 'content');
|
|
117458
|
-
const content = contentPath?.node?.value;
|
|
117459
|
-
|
|
117460
|
-
if (content) {
|
|
117461
|
-
names.push([filename, content.value]);
|
|
117462
|
-
continue;
|
|
117463
|
-
}
|
|
117464
|
-
|
|
117465
|
-
if (type === 'directory') {
|
|
117466
|
-
names.push(maybeAddSlash(filename));
|
|
117467
|
-
continue;
|
|
117468
|
-
}
|
|
117469
|
-
|
|
117470
|
-
names.push(filename);
|
|
117471
|
-
}
|
|
117472
|
-
|
|
117473
|
-
const list = [];
|
|
117137
|
+
const list = [];
|
|
117474
117138
|
|
|
117475
117139
|
for (const name of names) {
|
|
117476
|
-
if (isArray$
|
|
117477
|
-
list.push(ArrayExpression
|
|
117478
|
-
StringLiteral$
|
|
117479
|
-
StringLiteral$
|
|
117140
|
+
if (isArray$1(name)) {
|
|
117141
|
+
list.push(ArrayExpression([
|
|
117142
|
+
StringLiteral$1(name[0]),
|
|
117143
|
+
StringLiteral$1(name[1]),
|
|
117480
117144
|
]));
|
|
117481
117145
|
continue;
|
|
117482
117146
|
}
|
|
117483
117147
|
|
|
117484
|
-
list.push(StringLiteral$
|
|
117148
|
+
list.push(StringLiteral$1(name));
|
|
117485
117149
|
}
|
|
117486
117150
|
|
|
117487
|
-
replaceWith(root, ArrayExpression
|
|
117151
|
+
replaceWith(root, ArrayExpression(list));
|
|
117488
117152
|
};
|
|
117489
117153
|
|
|
117490
117154
|
convertFilesystemToSimpleFilesystem.traverse = ({push}) => ({
|
|
117491
117155
|
[`${__filesystem_name$1}(__object)`]: (path) => {
|
|
117492
117156
|
const root = path.get('arguments.0');
|
|
117493
|
-
const files = findFile$
|
|
117157
|
+
const files = findFile$3(root, '*');
|
|
117494
117158
|
|
|
117495
117159
|
push(root, {
|
|
117496
117160
|
files,
|
|
@@ -117498,15 +117162,15 @@ convertFilesystemToSimpleFilesystem.traverse = ({push}) => ({
|
|
|
117498
117162
|
},
|
|
117499
117163
|
});
|
|
117500
117164
|
|
|
117501
|
-
const fullstore
|
|
117165
|
+
const fullstore = fullstore$3;
|
|
117502
117166
|
const {compare: compare$1} = compare$5;
|
|
117503
117167
|
const {__filesystem_name} = json;
|
|
117504
117168
|
|
|
117505
117169
|
const {
|
|
117506
|
-
findFile: findFile$
|
|
117170
|
+
findFile: findFile$2,
|
|
117507
117171
|
pause,
|
|
117508
117172
|
start,
|
|
117509
|
-
} = filesystem
|
|
117173
|
+
} = filesystem;
|
|
117510
117174
|
|
|
117511
117175
|
const log$1 = browserExports('putout:runner:scanner');
|
|
117512
117176
|
|
|
@@ -117558,7 +117222,7 @@ const createFileProgress = ({rule, progress}) => ({i, n}) => {
|
|
|
117558
117222
|
};
|
|
117559
117223
|
|
|
117560
117224
|
const createTrackFile = (fileProgress) => function*(...a) {
|
|
117561
|
-
const files = findFile$
|
|
117225
|
+
const files = findFile$2(...a);
|
|
117562
117226
|
const n = files.length;
|
|
117563
117227
|
|
|
117564
117228
|
for (const [i, file] of files.entries()) {
|
|
@@ -117576,7 +117240,7 @@ const getTraverse = ({scan, rule, progress}) => ({push, options}) => ({
|
|
|
117576
117240
|
progress.start(rule);
|
|
117577
117241
|
|
|
117578
117242
|
const rootPath = path.get('arguments.0');
|
|
117579
|
-
const isSimple = fullstore
|
|
117243
|
+
const isSimple = fullstore(false);
|
|
117580
117244
|
|
|
117581
117245
|
const fileProgress = createFileProgress({
|
|
117582
117246
|
rule,
|
|
@@ -117660,7 +117324,7 @@ function parseVisitor(visitors) {
|
|
|
117660
117324
|
|
|
117661
117325
|
var template$3 = {exports: {}};
|
|
117662
117326
|
|
|
117663
|
-
const tryCatch$
|
|
117327
|
+
const tryCatch$1 = tryCatch$6;
|
|
117664
117328
|
|
|
117665
117329
|
const {
|
|
117666
117330
|
compareAny: compareAny$1,
|
|
@@ -117669,7 +117333,7 @@ const {
|
|
|
117669
117333
|
isTemplate: isTemplate$1,
|
|
117670
117334
|
} = compare$5;
|
|
117671
117335
|
|
|
117672
|
-
const maybeArray
|
|
117336
|
+
const maybeArray = maybeArray_1;
|
|
117673
117337
|
const debug$1 = browserExports('putout:runner:template');
|
|
117674
117338
|
|
|
117675
117339
|
const {entries: entries$3} = Object;
|
|
@@ -117703,8 +117367,8 @@ const exclude = ({rule, tmpl, fn, nodesExclude}) => {
|
|
|
117703
117367
|
|
|
117704
117368
|
template$3.exports = ({rule, visitor, options}) => {
|
|
117705
117369
|
const parsed = [];
|
|
117706
|
-
const nodesExclude = maybeArray
|
|
117707
|
-
const nodesInclude = maybeArray
|
|
117370
|
+
const nodesExclude = maybeArray(options.exclude);
|
|
117371
|
+
const nodesInclude = maybeArray(options.include);
|
|
117708
117372
|
|
|
117709
117373
|
for (const [tmpl, fn] of entries$3(visitor)) {
|
|
117710
117374
|
if (!tmpl)
|
|
@@ -117755,7 +117419,7 @@ function wrapWithCheck({rule, nodesInclude, nodesExclude, fn}) {
|
|
|
117755
117419
|
if (!isFn(fn))
|
|
117756
117420
|
throw Error(`☝️ Looks like provided visitor is not a function: ${stringify(fn)}. More on using Traverser: https://git.io/JqcMn`);
|
|
117757
117421
|
|
|
117758
|
-
const [e] = tryCatch$
|
|
117422
|
+
const [e] = tryCatch$1(fn, path);
|
|
117759
117423
|
|
|
117760
117424
|
if (e) {
|
|
117761
117425
|
e.rule = rule;
|
|
@@ -118548,7 +118212,7 @@ function cutBrackets(a) {
|
|
|
118548
118212
|
return a.replace(/\s\(\d:\d+\)/, '');
|
|
118549
118213
|
}
|
|
118550
118214
|
|
|
118551
|
-
const tryCatch
|
|
118215
|
+
const tryCatch = tryCatch$6;
|
|
118552
118216
|
const {defaultOptions: defaultOptions$1} = defaultOptions$4;
|
|
118553
118217
|
const {cutShebang: cutShebang$1} = shebang;
|
|
118554
118218
|
const parseError$1 = parseError$2;
|
|
@@ -118581,7 +118245,7 @@ transform$5.transform = (ast, source, opts) => {
|
|
|
118581
118245
|
|
|
118582
118246
|
const [, shebang] = cutShebang$1(source);
|
|
118583
118247
|
|
|
118584
|
-
const [validationError] = tryCatch
|
|
118248
|
+
const [validationError] = tryCatch(validateRules, {
|
|
118585
118249
|
rules,
|
|
118586
118250
|
pluginNames,
|
|
118587
118251
|
});
|
|
@@ -118623,7 +118287,7 @@ transform$5.transformAsync = async (ast, source, opts) => {
|
|
|
118623
118287
|
|
|
118624
118288
|
const [, shebang] = cutShebang$1(source);
|
|
118625
118289
|
|
|
118626
|
-
const [validationError] = tryCatch
|
|
118290
|
+
const [validationError] = tryCatch(validateRules, {
|
|
118627
118291
|
rules,
|
|
118628
118292
|
pluginNames,
|
|
118629
118293
|
});
|
|
@@ -118667,8 +118331,8 @@ findPlaces$2.findPlacesAsync = async (ast, source, opts) => {
|
|
|
118667
118331
|
});
|
|
118668
118332
|
};
|
|
118669
118333
|
|
|
118670
|
-
const {isArray
|
|
118671
|
-
const noop
|
|
118334
|
+
const {isArray} = Array;
|
|
118335
|
+
const noop = () => {};
|
|
118672
118336
|
|
|
118673
118337
|
var report$3 = () => {
|
|
118674
118338
|
let filesCount = 0;
|
|
@@ -118682,11 +118346,11 @@ var report$3 = () => {
|
|
|
118682
118346
|
places,
|
|
118683
118347
|
index = 0,
|
|
118684
118348
|
count = 1,
|
|
118685
|
-
trace = noop
|
|
118349
|
+
trace = noop,
|
|
118686
118350
|
formatterOptions = {},
|
|
118687
118351
|
} = options;
|
|
118688
118352
|
|
|
118689
|
-
if (!isArray
|
|
118353
|
+
if (!isArray(places))
|
|
118690
118354
|
throw Error(`☝️ Looks like for 'places: Places[]' you passed the wrong type: '${typeof places}'`);
|
|
118691
118355
|
|
|
118692
118356
|
if (places.length)
|
|
@@ -118724,7 +118388,7 @@ report$3.default;
|
|
|
118724
118388
|
|
|
118725
118389
|
var traverse$5 = {};
|
|
118726
118390
|
|
|
118727
|
-
const {types: types$
|
|
118391
|
+
const {types: types$3, traverse: babelTraverse} = bundle;
|
|
118728
118392
|
|
|
118729
118393
|
const {
|
|
118730
118394
|
compare,
|
|
@@ -118733,7 +118397,7 @@ const {
|
|
|
118733
118397
|
getTemplateValues,
|
|
118734
118398
|
} = compare$5;
|
|
118735
118399
|
|
|
118736
|
-
const {isFile, isProgram
|
|
118400
|
+
const {isFile, isProgram} = types$3;
|
|
118737
118401
|
const {merge} = babelTraverse.visitors;
|
|
118738
118402
|
const {entries: entries$2} = Object;
|
|
118739
118403
|
|
|
@@ -118744,7 +118408,7 @@ const createTraverse = (path) => {
|
|
|
118744
118408
|
if (isPath(path))
|
|
118745
118409
|
return path.traverse.bind(path);
|
|
118746
118410
|
|
|
118747
|
-
const noScope = !isFile(path) && !isProgram
|
|
118411
|
+
const noScope = !isFile(path) && !isProgram(path);
|
|
118748
118412
|
|
|
118749
118413
|
return (visitors) => {
|
|
118750
118414
|
babelTraverse(path, {
|
|
@@ -125921,16 +125585,16 @@ var addArgs = {};
|
|
|
125921
125585
|
|
|
125922
125586
|
const {compareAny} = compare$5;
|
|
125923
125587
|
const {template: template$1} = parser$6;
|
|
125924
|
-
const {types: types$
|
|
125588
|
+
const {types: types$2} = bundle;
|
|
125925
125589
|
const {
|
|
125926
125590
|
ObjectPattern,
|
|
125927
|
-
ObjectProperty
|
|
125591
|
+
ObjectProperty,
|
|
125928
125592
|
isBlockStatement,
|
|
125929
125593
|
isFunction,
|
|
125930
125594
|
isLabeledStatement,
|
|
125931
125595
|
isObjectPattern,
|
|
125932
125596
|
isCallExpression,
|
|
125933
|
-
} = types$
|
|
125597
|
+
} = types$2;
|
|
125934
125598
|
|
|
125935
125599
|
const {entries: entries$1} = Object;
|
|
125936
125600
|
|
|
@@ -126032,12 +125696,12 @@ const traverse$1 = (args) => ({push, options}) => {
|
|
|
126032
125696
|
function createProperty(node) {
|
|
126033
125697
|
if (!isLabeledStatement(node)) {
|
|
126034
125698
|
const {expression} = node;
|
|
126035
|
-
return ObjectProperty
|
|
125699
|
+
return ObjectProperty(expression, expression, !COMPUTED, SHORTHAND);
|
|
126036
125700
|
}
|
|
126037
125701
|
|
|
126038
125702
|
const {label, body} = node;
|
|
126039
125703
|
|
|
126040
|
-
return ObjectProperty
|
|
125704
|
+
return ObjectProperty(label, body.expression, !COMPUTED, SHORTHAND);
|
|
126041
125705
|
}
|
|
126042
125706
|
|
|
126043
125707
|
function getObjectPattern(params) {
|
|
@@ -126394,11 +126058,11 @@ const makeRegex = (pattern, ignoreCase) => {
|
|
|
126394
126058
|
: new RegExp(source)
|
|
126395
126059
|
};
|
|
126396
126060
|
|
|
126397
|
-
const isString$
|
|
126061
|
+
const isString$1 = subject => typeof subject === 'string';
|
|
126398
126062
|
|
|
126399
126063
|
// > A blank line matches no files, so it can serve as a separator for readability.
|
|
126400
126064
|
const checkPattern = pattern => pattern
|
|
126401
|
-
&& isString$
|
|
126065
|
+
&& isString$1(pattern)
|
|
126402
126066
|
&& !REGEX_TEST_BLANK_LINE.test(pattern)
|
|
126403
126067
|
&& !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern)
|
|
126404
126068
|
|
|
@@ -126454,7 +126118,7 @@ const throwError = (message, Ctor) => {
|
|
|
126454
126118
|
};
|
|
126455
126119
|
|
|
126456
126120
|
const checkPath = (path, originalPath, doThrow) => {
|
|
126457
|
-
if (!isString$
|
|
126121
|
+
if (!isString$1(path)) {
|
|
126458
126122
|
return doThrow(
|
|
126459
126123
|
`path must be a string, but got \`${originalPath}\``,
|
|
126460
126124
|
TypeError
|
|
@@ -126522,7 +126186,7 @@ class Ignore {
|
|
|
126522
126186
|
this._added = false;
|
|
126523
126187
|
|
|
126524
126188
|
makeArray(
|
|
126525
|
-
isString$
|
|
126189
|
+
isString$1(pattern)
|
|
126526
126190
|
? splitPattern(pattern)
|
|
126527
126191
|
: pattern
|
|
126528
126192
|
).forEach(this._addPattern, this);
|
|
@@ -126724,399 +126388,6 @@ function mergeIgnores(ignores) {
|
|
|
126724
126388
|
|
|
126725
126389
|
ignores$2.default;
|
|
126726
126390
|
|
|
126727
|
-
var filesystem$1 = {};
|
|
126728
|
-
|
|
126729
|
-
var maybeFs$1 = {};
|
|
126730
|
-
|
|
126731
|
-
const fullstore$1 = fullstore$6;
|
|
126732
|
-
const driverStore$1 = fullstore$1();
|
|
126733
|
-
|
|
126734
|
-
const {assign: assign$1} = Object;
|
|
126735
|
-
const noop$1 = () => {};
|
|
126736
|
-
const returns$1 = (a) => () => a;
|
|
126737
|
-
|
|
126738
|
-
const defaultFS$1 = {
|
|
126739
|
-
renameFile: noop$1,
|
|
126740
|
-
removeFile: noop$1,
|
|
126741
|
-
createDirectory: noop$1,
|
|
126742
|
-
readFileContent: returns$1(''),
|
|
126743
|
-
writeFileContent: noop$1,
|
|
126744
|
-
copyFile: noop$1,
|
|
126745
|
-
};
|
|
126746
|
-
|
|
126747
|
-
const maybeFS$3 = assign$1({}, defaultFS$1);
|
|
126748
|
-
|
|
126749
|
-
maybeFs$1.renameFile = (oldName, newName) => {
|
|
126750
|
-
maybeFS$3.renameFile(oldName, newName);
|
|
126751
|
-
};
|
|
126752
|
-
|
|
126753
|
-
maybeFs$1.removeFile = (name) => {
|
|
126754
|
-
maybeFS$3.removeFile(name);
|
|
126755
|
-
};
|
|
126756
|
-
|
|
126757
|
-
maybeFs$1.copyFile = (from, to) => {
|
|
126758
|
-
maybeFS$3.copyFile(from, to);
|
|
126759
|
-
};
|
|
126760
|
-
|
|
126761
|
-
maybeFs$1.createDirectory = (name) => {
|
|
126762
|
-
maybeFS$3.createDirectory(name);
|
|
126763
|
-
};
|
|
126764
|
-
|
|
126765
|
-
maybeFs$1.readFileContent = (name) => {
|
|
126766
|
-
return maybeFS$3.readFileContent(name);
|
|
126767
|
-
};
|
|
126768
|
-
|
|
126769
|
-
maybeFs$1.writeFileContent = (name, content) => {
|
|
126770
|
-
maybeFS$3.writeFileContent(name, content);
|
|
126771
|
-
};
|
|
126772
|
-
|
|
126773
|
-
maybeFs$1.init = init$1;
|
|
126774
|
-
|
|
126775
|
-
function init$1(fsDriver) {
|
|
126776
|
-
assign$1(maybeFS$3, fsDriver);
|
|
126777
|
-
}
|
|
126778
|
-
|
|
126779
|
-
maybeFs$1.pause = () => {
|
|
126780
|
-
driverStore$1(maybeFS$3);
|
|
126781
|
-
deinit$1();
|
|
126782
|
-
};
|
|
126783
|
-
|
|
126784
|
-
maybeFs$1.start = () => {
|
|
126785
|
-
init$1(driverStore$1());
|
|
126786
|
-
};
|
|
126787
|
-
|
|
126788
|
-
maybeFs$1.deinit = deinit$1;
|
|
126789
|
-
|
|
126790
|
-
function deinit$1() {
|
|
126791
|
-
assign$1(maybeFS$3, defaultFS$1);
|
|
126792
|
-
}
|
|
126793
|
-
|
|
126794
|
-
const {join: join$3, basename: basename$1} = require$$0$2;
|
|
126795
|
-
const tryCatch$1 = tryCatch$9;
|
|
126796
|
-
const {types: types$3} = bundle;
|
|
126797
|
-
|
|
126798
|
-
const {
|
|
126799
|
-
setLiteralValue: setLiteralValue$1,
|
|
126800
|
-
getProperty: getProperty$1,
|
|
126801
|
-
traverseProperties: traverseProperties$2,
|
|
126802
|
-
} = operate;
|
|
126803
|
-
|
|
126804
|
-
const maybeFS$2 = maybeFs$1;
|
|
126805
|
-
const isString$2 = (a) => typeof a === 'string';
|
|
126806
|
-
const {isArray: isArray$1} = Array;
|
|
126807
|
-
const maybeArray$1 = (a) => isArray$1(a) ? a : [a];
|
|
126808
|
-
|
|
126809
|
-
const toBase64$1 = (content) => {
|
|
126810
|
-
const [e, result] = tryCatch$1(btoa, content);
|
|
126811
|
-
|
|
126812
|
-
if (e)
|
|
126813
|
-
return btoa(encodeURI(content));
|
|
126814
|
-
|
|
126815
|
-
return result;
|
|
126816
|
-
};
|
|
126817
|
-
|
|
126818
|
-
const fromBase64$1 = (content) => {
|
|
126819
|
-
const [e, decoded] = tryCatch$1(atob, content);
|
|
126820
|
-
|
|
126821
|
-
if (!e)
|
|
126822
|
-
return decodeURI(decoded);
|
|
126823
|
-
|
|
126824
|
-
return content;
|
|
126825
|
-
};
|
|
126826
|
-
|
|
126827
|
-
const {
|
|
126828
|
-
ObjectExpression: ObjectExpression$1,
|
|
126829
|
-
ArrayExpression: ArrayExpression$1,
|
|
126830
|
-
StringLiteral: StringLiteral$2,
|
|
126831
|
-
ObjectProperty: ObjectProperty$1,
|
|
126832
|
-
isProgram: isProgram$1,
|
|
126833
|
-
} = types$3;
|
|
126834
|
-
|
|
126835
|
-
const getRegExp$1 = (wildcard) => {
|
|
126836
|
-
const escaped = wildcard
|
|
126837
|
-
.replace(/\./g, '\\.')
|
|
126838
|
-
.replace(/\*/g, '.*')
|
|
126839
|
-
.replace('?', '.?');
|
|
126840
|
-
|
|
126841
|
-
return RegExp(`^${escaped}$`);
|
|
126842
|
-
};
|
|
126843
|
-
|
|
126844
|
-
filesystem$1.getParentDirectory = (filePath) => {
|
|
126845
|
-
const {parentPath} = filePath.parentPath.parentPath;
|
|
126846
|
-
|
|
126847
|
-
if (isProgram$1(parentPath))
|
|
126848
|
-
return null;
|
|
126849
|
-
|
|
126850
|
-
return parentPath;
|
|
126851
|
-
};
|
|
126852
|
-
|
|
126853
|
-
filesystem$1.findFile = findFile$3;
|
|
126854
|
-
|
|
126855
|
-
function findFile$3(node, name) {
|
|
126856
|
-
checkName$1(name);
|
|
126857
|
-
|
|
126858
|
-
const filePaths = [];
|
|
126859
|
-
const names = maybeArray$1(name);
|
|
126860
|
-
|
|
126861
|
-
for (const filenamePath of traverseProperties$2(node, 'filename')) {
|
|
126862
|
-
const {value} = filenamePath.node.value;
|
|
126863
|
-
const base = basename$1(value);
|
|
126864
|
-
|
|
126865
|
-
for (const name of names) {
|
|
126866
|
-
if (value === name || getRegExp$1(name).test(base))
|
|
126867
|
-
filePaths.push(filenamePath.parentPath);
|
|
126868
|
-
}
|
|
126869
|
-
}
|
|
126870
|
-
|
|
126871
|
-
return filePaths;
|
|
126872
|
-
}
|
|
126873
|
-
|
|
126874
|
-
function checkName$1(name) {
|
|
126875
|
-
if (!isString$2(name) && !isArray$1(name))
|
|
126876
|
-
throw Error(`☝️ Looks like you forget to pass the 'name' of a file to 'findFile(filePath: Path|FilePath, name: string | string[]): FilePath'`);
|
|
126877
|
-
}
|
|
126878
|
-
|
|
126879
|
-
function getFilenamePath$1(filePath) {
|
|
126880
|
-
const filenamePath = getProperty$1(filePath, 'filename');
|
|
126881
|
-
return filenamePath.get('value');
|
|
126882
|
-
}
|
|
126883
|
-
|
|
126884
|
-
function getFilename$3(filePath) {
|
|
126885
|
-
const {value} = getFilenamePath$1(filePath).node;
|
|
126886
|
-
return value;
|
|
126887
|
-
}
|
|
126888
|
-
|
|
126889
|
-
filesystem$1.getFileType = getFileType$1;
|
|
126890
|
-
|
|
126891
|
-
function getFileType$1(filePath) {
|
|
126892
|
-
const typePath = getProperty$1(filePath, 'type');
|
|
126893
|
-
return typePath.node.value.value;
|
|
126894
|
-
}
|
|
126895
|
-
|
|
126896
|
-
filesystem$1.getFileContent = getFileContent$1;
|
|
126897
|
-
|
|
126898
|
-
function getFileContent$1(filePath) {
|
|
126899
|
-
const content = getProperty$1(filePath, 'content');
|
|
126900
|
-
|
|
126901
|
-
return [
|
|
126902
|
-
Boolean(content),
|
|
126903
|
-
content?.node.value.value,
|
|
126904
|
-
];
|
|
126905
|
-
}
|
|
126906
|
-
|
|
126907
|
-
filesystem$1.getFilename = getFilename$3;
|
|
126908
|
-
|
|
126909
|
-
filesystem$1.renameFile = (filePath, name) => {
|
|
126910
|
-
const oldName = getFilename$3(filePath);
|
|
126911
|
-
const valuePath = getFilenamePath$1(filePath);
|
|
126912
|
-
const baseName = oldName
|
|
126913
|
-
.split('/')
|
|
126914
|
-
.pop();
|
|
126915
|
-
|
|
126916
|
-
const newName = name
|
|
126917
|
-
.split('/')
|
|
126918
|
-
.pop();
|
|
126919
|
-
|
|
126920
|
-
const newFilename = oldName.replace(baseName, newName);
|
|
126921
|
-
|
|
126922
|
-
setLiteralValue$1(valuePath, newFilename);
|
|
126923
|
-
maybeFS$2.renameFile(oldName, newFilename);
|
|
126924
|
-
};
|
|
126925
|
-
|
|
126926
|
-
filesystem$1.removeFile = (filePath) => {
|
|
126927
|
-
const filename = getFilename$3(filePath);
|
|
126928
|
-
|
|
126929
|
-
filePath.remove();
|
|
126930
|
-
maybeFS$2.removeFile(filename);
|
|
126931
|
-
};
|
|
126932
|
-
|
|
126933
|
-
filesystem$1.moveFile = (filePath, dirPath) => {
|
|
126934
|
-
if (filePath === dirPath)
|
|
126935
|
-
return;
|
|
126936
|
-
|
|
126937
|
-
const dirname = getFilename$3(dirPath);
|
|
126938
|
-
const filename = getFilename$3(filePath);
|
|
126939
|
-
const dirPathFiles = getProperty$1(dirPath, 'files');
|
|
126940
|
-
const filenamePath = getProperty$1(filePath, 'filename');
|
|
126941
|
-
|
|
126942
|
-
const basename = filename
|
|
126943
|
-
.split('/')
|
|
126944
|
-
.pop();
|
|
126945
|
-
|
|
126946
|
-
const newFilename = join$3(dirname, basename);
|
|
126947
|
-
|
|
126948
|
-
maybeRemoveFile$1(dirPath, newFilename);
|
|
126949
|
-
|
|
126950
|
-
setLiteralValue$1(filenamePath.get('value'), newFilename);
|
|
126951
|
-
dirPathFiles.node.value.elements.push(filePath.node);
|
|
126952
|
-
|
|
126953
|
-
filePath.remove();
|
|
126954
|
-
maybeFS$2.renameFile(filename, newFilename);
|
|
126955
|
-
};
|
|
126956
|
-
|
|
126957
|
-
filesystem$1.copyFile = (filePath, dirPath) => {
|
|
126958
|
-
const dirname = getFilename$3(dirPath);
|
|
126959
|
-
const filename = getFilename$3(filePath);
|
|
126960
|
-
|
|
126961
|
-
const basename = filename
|
|
126962
|
-
.split('/')
|
|
126963
|
-
.pop();
|
|
126964
|
-
|
|
126965
|
-
const newFilename = join$3(dirname, basename);
|
|
126966
|
-
const [hasContent, content] = getFileContent$1(filePath);
|
|
126967
|
-
|
|
126968
|
-
const copiedFile = ObjectExpression$1([
|
|
126969
|
-
createTypeProperty$1('file'),
|
|
126970
|
-
createFilenameProperty$1(newFilename),
|
|
126971
|
-
hasContent && createContentProperty$1(content),
|
|
126972
|
-
].filter(Boolean));
|
|
126973
|
-
|
|
126974
|
-
maybeRemoveFile$1(dirPath, newFilename);
|
|
126975
|
-
|
|
126976
|
-
const dirPathFiles = getFiles$1(dirPath);
|
|
126977
|
-
dirPathFiles.node.value.elements.push(copiedFile);
|
|
126978
|
-
|
|
126979
|
-
maybeFS$2.copyFile(filename, newFilename);
|
|
126980
|
-
};
|
|
126981
|
-
|
|
126982
|
-
function maybeRemoveFile$1(dirPath, filename) {
|
|
126983
|
-
const type = getFileType$1(dirPath);
|
|
126984
|
-
|
|
126985
|
-
if (type !== 'directory') {
|
|
126986
|
-
const filename = getFilename$3(dirPath);
|
|
126987
|
-
throw Error(`☝️ Looks like '${filename}' is not a directory, but: '${type}'. Rename to '${filename}/'`);
|
|
126988
|
-
}
|
|
126989
|
-
|
|
126990
|
-
const dirPathFiles = getProperty$1(dirPath, 'files');
|
|
126991
|
-
const name = join$3(getFilename$3(dirPath), basename$1(filename));
|
|
126992
|
-
const [fileToOverwrite] = findFile$3(dirPathFiles, name);
|
|
126993
|
-
|
|
126994
|
-
if (!fileToOverwrite)
|
|
126995
|
-
return;
|
|
126996
|
-
|
|
126997
|
-
fileToOverwrite.remove();
|
|
126998
|
-
}
|
|
126999
|
-
|
|
127000
|
-
const createTypeProperty$1 = (type) => ObjectProperty$1(StringLiteral$2('type'), StringLiteral$2(type));
|
|
127001
|
-
|
|
127002
|
-
filesystem$1.createTypeProperty = createTypeProperty$1;
|
|
127003
|
-
|
|
127004
|
-
const createFilesProperty$1 = (files) => ObjectProperty$1(StringLiteral$2('files'), ArrayExpression$1(files));
|
|
127005
|
-
|
|
127006
|
-
filesystem$1.createFilesProperty = createFilesProperty$1;
|
|
127007
|
-
|
|
127008
|
-
const createFilenameProperty$1 = (filename) => ObjectProperty$1(StringLiteral$2('filename'), StringLiteral$2(filename));
|
|
127009
|
-
|
|
127010
|
-
filesystem$1.createFilenameProperty = createFilenameProperty$1;
|
|
127011
|
-
|
|
127012
|
-
const createContentProperty$1 = (content) => ObjectProperty$1(StringLiteral$2('content'), StringLiteral$2(content));
|
|
127013
|
-
|
|
127014
|
-
filesystem$1.createContentProperty = createContentProperty$1;
|
|
127015
|
-
|
|
127016
|
-
filesystem$1.createFile = (dirPath, name, content) => {
|
|
127017
|
-
maybeRemoveFile$1(dirPath, name);
|
|
127018
|
-
|
|
127019
|
-
const dirPathFiles = getFiles$1(dirPath);
|
|
127020
|
-
const parentFilename = getFilename$3(dirPath);
|
|
127021
|
-
const filename = join$3(parentFilename, name);
|
|
127022
|
-
|
|
127023
|
-
const typeProperty = createTypeProperty$1('file');
|
|
127024
|
-
const filenameProperty = createFilenameProperty$1(filename);
|
|
127025
|
-
|
|
127026
|
-
const properties = [
|
|
127027
|
-
typeProperty,
|
|
127028
|
-
filenameProperty,
|
|
127029
|
-
content && createContentProperty$1(content),
|
|
127030
|
-
].filter(Boolean);
|
|
127031
|
-
|
|
127032
|
-
dirPathFiles.node.value.elements.push(ObjectExpression$1(properties));
|
|
127033
|
-
|
|
127034
|
-
const filePath = dirPathFiles
|
|
127035
|
-
.get('value.elements')
|
|
127036
|
-
.at(-1);
|
|
127037
|
-
|
|
127038
|
-
if (isString$2(content))
|
|
127039
|
-
writeFileContent$2(filePath, content);
|
|
127040
|
-
|
|
127041
|
-
return filePath;
|
|
127042
|
-
};
|
|
127043
|
-
|
|
127044
|
-
function getFiles$1(dirPath) {
|
|
127045
|
-
return getProperty$1(dirPath, 'files');
|
|
127046
|
-
}
|
|
127047
|
-
|
|
127048
|
-
filesystem$1.createDirectory = (dirPath, name) => {
|
|
127049
|
-
const dirPathFiles = getFiles$1(dirPath);
|
|
127050
|
-
const parentFilename = getFilename$3(dirPath);
|
|
127051
|
-
const filename = join$3(parentFilename, name);
|
|
127052
|
-
|
|
127053
|
-
const typeProperty = createTypeProperty$1('directory');
|
|
127054
|
-
const filesProperty = createFilesProperty$1([]);
|
|
127055
|
-
const filenameProperty = createFilenameProperty$1(filename);
|
|
127056
|
-
|
|
127057
|
-
dirPathFiles.node.value.elements.push(ObjectExpression$1([
|
|
127058
|
-
typeProperty,
|
|
127059
|
-
filenameProperty,
|
|
127060
|
-
filesProperty,
|
|
127061
|
-
]));
|
|
127062
|
-
|
|
127063
|
-
maybeFS$2.createDirectory(filename);
|
|
127064
|
-
|
|
127065
|
-
return dirPathFiles
|
|
127066
|
-
.get('value.elements')
|
|
127067
|
-
.at(-1);
|
|
127068
|
-
};
|
|
127069
|
-
|
|
127070
|
-
filesystem$1.readFileContent = (filePath) => {
|
|
127071
|
-
const fileType = getFileType$1(filePath);
|
|
127072
|
-
|
|
127073
|
-
if (fileType === 'directory')
|
|
127074
|
-
return '';
|
|
127075
|
-
|
|
127076
|
-
const [hasContent, content] = getFileContent$1(filePath);
|
|
127077
|
-
|
|
127078
|
-
if (hasContent)
|
|
127079
|
-
return fromBase64$1(content);
|
|
127080
|
-
|
|
127081
|
-
const filename = getFilename$3(filePath);
|
|
127082
|
-
const fileContent = maybeFS$2.readFileContent(filename);
|
|
127083
|
-
|
|
127084
|
-
const property = createContentProperty$1(toBase64$1(fileContent));
|
|
127085
|
-
|
|
127086
|
-
filePath.node.properties.push(property);
|
|
127087
|
-
|
|
127088
|
-
return fileContent;
|
|
127089
|
-
};
|
|
127090
|
-
|
|
127091
|
-
filesystem$1.writeFileContent = writeFileContent$2;
|
|
127092
|
-
|
|
127093
|
-
function writeFileContent$2(filePath, content) {
|
|
127094
|
-
const fileType = getFileType$1(filePath);
|
|
127095
|
-
|
|
127096
|
-
if (fileType === 'directory')
|
|
127097
|
-
return;
|
|
127098
|
-
|
|
127099
|
-
const filename = getFilename$3(filePath);
|
|
127100
|
-
|
|
127101
|
-
maybeFS$2.writeFileContent(filename, content);
|
|
127102
|
-
|
|
127103
|
-
const contentPath = getProperty$1(filePath, 'content');
|
|
127104
|
-
|
|
127105
|
-
if (contentPath) {
|
|
127106
|
-
setLiteralValue$1(contentPath.node.value, toBase64$1(content));
|
|
127107
|
-
return;
|
|
127108
|
-
}
|
|
127109
|
-
|
|
127110
|
-
const property = createContentProperty$1(toBase64$1(content));
|
|
127111
|
-
filePath.node.properties.push(property);
|
|
127112
|
-
}
|
|
127113
|
-
|
|
127114
|
-
filesystem$1.init = maybeFS$2.init;
|
|
127115
|
-
filesystem$1.deinit = maybeFS$2.deinit;
|
|
127116
|
-
|
|
127117
|
-
filesystem$1.pause = maybeFS$2.pause;
|
|
127118
|
-
filesystem$1.start = maybeFS$2.start;
|
|
127119
|
-
|
|
127120
126391
|
const path = require$$0$2;
|
|
127121
126392
|
|
|
127122
126393
|
const {parse: parse$2, print: print$1} = parser$6;
|
|
@@ -127128,15 +126399,15 @@ const {toJS, fromJS} = json;
|
|
|
127128
126399
|
|
|
127129
126400
|
const {
|
|
127130
126401
|
readFileContent: readFileContent$1,
|
|
127131
|
-
findFile: findFile$
|
|
127132
|
-
writeFileContent
|
|
127133
|
-
getFilename: getFilename$
|
|
126402
|
+
findFile: findFile$1,
|
|
126403
|
+
writeFileContent,
|
|
126404
|
+
getFilename: getFilename$1,
|
|
127134
126405
|
createFile,
|
|
127135
126406
|
removeFile,
|
|
127136
126407
|
getParentDirectory: getParentDirectory$1,
|
|
127137
|
-
} = filesystem
|
|
126408
|
+
} = filesystem;
|
|
127138
126409
|
|
|
127139
|
-
const {join: join$
|
|
126410
|
+
const {join: join$1} = path;
|
|
127140
126411
|
|
|
127141
126412
|
const isObject = (a) => a && typeof a === 'object';
|
|
127142
126413
|
const {entries} = Object;
|
|
@@ -127164,7 +126435,7 @@ function fix$1(inputFile, {dirPath, mainPath, matchInputFilename, outputFilename
|
|
|
127164
126435
|
inputFile,
|
|
127165
126436
|
});
|
|
127166
126437
|
|
|
127167
|
-
writeFileContent
|
|
126438
|
+
writeFileContent(outputFile, matchedJSON);
|
|
127168
126439
|
|
|
127169
126440
|
if (inputFile !== outputFile)
|
|
127170
126441
|
removeFile(inputFile);
|
|
@@ -127172,15 +126443,15 @@ function fix$1(inputFile, {dirPath, mainPath, matchInputFilename, outputFilename
|
|
|
127172
126443
|
|
|
127173
126444
|
const createScan = (files) => (mainPath, {push, progress, options}) => {
|
|
127174
126445
|
const allFiles = [];
|
|
127175
|
-
const cwd = getFilename$
|
|
126446
|
+
const cwd = getFilename$1(mainPath);
|
|
127176
126447
|
|
|
127177
126448
|
for (const [filename, rawOptions] of entries(files)) {
|
|
127178
126449
|
const [matchInputFilename, outputFilename = matchInputFilename] = parseMatcher(filename, options);
|
|
127179
|
-
const inputFiles = findFile$
|
|
126450
|
+
const inputFiles = findFile$1(mainPath, matchInputFilename);
|
|
127180
126451
|
|
|
127181
126452
|
for (const inputFile of inputFiles) {
|
|
127182
126453
|
const dirPath = getParentDirectory$1(inputFile);
|
|
127183
|
-
const inputFilename = getFilename$
|
|
126454
|
+
const inputFilename = getFilename$1(inputFile);
|
|
127184
126455
|
|
|
127185
126456
|
if (ignores$1(cwd, inputFilename, options))
|
|
127186
126457
|
continue;
|
|
@@ -127281,8 +126552,8 @@ function getOutputFile(path, {dirPath, matchInputFilename, outputFilename, input
|
|
|
127281
126552
|
if (matchInputFilename === outputFilename)
|
|
127282
126553
|
return inputFile;
|
|
127283
126554
|
|
|
127284
|
-
const name = join$
|
|
127285
|
-
const [outputFile] = findFile$
|
|
126555
|
+
const name = join$1(getFilename$1(dirPath), outputFilename);
|
|
126556
|
+
const [outputFile] = findFile$1(dirPath, name);
|
|
127286
126557
|
|
|
127287
126558
|
if (outputFile)
|
|
127288
126559
|
return outputFile;
|
|
@@ -127321,399 +126592,6 @@ function parseOptions(inputFilename, rawOptions) {
|
|
|
127321
126592
|
|
|
127322
126593
|
var renameFiles = {};
|
|
127323
126594
|
|
|
127324
|
-
var filesystem = {};
|
|
127325
|
-
|
|
127326
|
-
var maybeFs = {};
|
|
127327
|
-
|
|
127328
|
-
const fullstore = fullstore$6;
|
|
127329
|
-
const driverStore = fullstore();
|
|
127330
|
-
|
|
127331
|
-
const {assign} = Object;
|
|
127332
|
-
const noop = () => {};
|
|
127333
|
-
const returns = (a) => () => a;
|
|
127334
|
-
|
|
127335
|
-
const defaultFS = {
|
|
127336
|
-
renameFile: noop,
|
|
127337
|
-
removeFile: noop,
|
|
127338
|
-
createDirectory: noop,
|
|
127339
|
-
readFileContent: returns(''),
|
|
127340
|
-
writeFileContent: noop,
|
|
127341
|
-
copyFile: noop,
|
|
127342
|
-
};
|
|
127343
|
-
|
|
127344
|
-
const maybeFS$1 = assign({}, defaultFS);
|
|
127345
|
-
|
|
127346
|
-
maybeFs.renameFile = (oldName, newName) => {
|
|
127347
|
-
maybeFS$1.renameFile(oldName, newName);
|
|
127348
|
-
};
|
|
127349
|
-
|
|
127350
|
-
maybeFs.removeFile = (name) => {
|
|
127351
|
-
maybeFS$1.removeFile(name);
|
|
127352
|
-
};
|
|
127353
|
-
|
|
127354
|
-
maybeFs.copyFile = (from, to) => {
|
|
127355
|
-
maybeFS$1.copyFile(from, to);
|
|
127356
|
-
};
|
|
127357
|
-
|
|
127358
|
-
maybeFs.createDirectory = (name) => {
|
|
127359
|
-
maybeFS$1.createDirectory(name);
|
|
127360
|
-
};
|
|
127361
|
-
|
|
127362
|
-
maybeFs.readFileContent = (name) => {
|
|
127363
|
-
return maybeFS$1.readFileContent(name);
|
|
127364
|
-
};
|
|
127365
|
-
|
|
127366
|
-
maybeFs.writeFileContent = (name, content) => {
|
|
127367
|
-
maybeFS$1.writeFileContent(name, content);
|
|
127368
|
-
};
|
|
127369
|
-
|
|
127370
|
-
maybeFs.init = init;
|
|
127371
|
-
|
|
127372
|
-
function init(fsDriver) {
|
|
127373
|
-
assign(maybeFS$1, fsDriver);
|
|
127374
|
-
}
|
|
127375
|
-
|
|
127376
|
-
maybeFs.pause = () => {
|
|
127377
|
-
driverStore(maybeFS$1);
|
|
127378
|
-
deinit();
|
|
127379
|
-
};
|
|
127380
|
-
|
|
127381
|
-
maybeFs.start = () => {
|
|
127382
|
-
init(driverStore());
|
|
127383
|
-
};
|
|
127384
|
-
|
|
127385
|
-
maybeFs.deinit = deinit;
|
|
127386
|
-
|
|
127387
|
-
function deinit() {
|
|
127388
|
-
assign(maybeFS$1, defaultFS);
|
|
127389
|
-
}
|
|
127390
|
-
|
|
127391
|
-
const {join: join$1, basename} = require$$0$2;
|
|
127392
|
-
const tryCatch = tryCatch$9;
|
|
127393
|
-
const {types: types$2} = bundle;
|
|
127394
|
-
|
|
127395
|
-
const {
|
|
127396
|
-
setLiteralValue,
|
|
127397
|
-
getProperty,
|
|
127398
|
-
traverseProperties: traverseProperties$1,
|
|
127399
|
-
} = operate;
|
|
127400
|
-
|
|
127401
|
-
const maybeFS = maybeFs;
|
|
127402
|
-
const isString$1 = (a) => typeof a === 'string';
|
|
127403
|
-
const {isArray} = Array;
|
|
127404
|
-
const maybeArray = (a) => isArray(a) ? a : [a];
|
|
127405
|
-
|
|
127406
|
-
const toBase64 = (content) => {
|
|
127407
|
-
const [e, result] = tryCatch(btoa, content);
|
|
127408
|
-
|
|
127409
|
-
if (e)
|
|
127410
|
-
return btoa(encodeURI(content));
|
|
127411
|
-
|
|
127412
|
-
return result;
|
|
127413
|
-
};
|
|
127414
|
-
|
|
127415
|
-
const fromBase64 = (content) => {
|
|
127416
|
-
const [e, decoded] = tryCatch(atob, content);
|
|
127417
|
-
|
|
127418
|
-
if (!e)
|
|
127419
|
-
return decodeURI(decoded);
|
|
127420
|
-
|
|
127421
|
-
return content;
|
|
127422
|
-
};
|
|
127423
|
-
|
|
127424
|
-
const {
|
|
127425
|
-
ObjectExpression,
|
|
127426
|
-
ArrayExpression,
|
|
127427
|
-
StringLiteral: StringLiteral$1,
|
|
127428
|
-
ObjectProperty,
|
|
127429
|
-
isProgram,
|
|
127430
|
-
} = types$2;
|
|
127431
|
-
|
|
127432
|
-
const getRegExp = (wildcard) => {
|
|
127433
|
-
const escaped = wildcard
|
|
127434
|
-
.replace(/\./g, '\\.')
|
|
127435
|
-
.replace(/\*/g, '.*')
|
|
127436
|
-
.replace('?', '.?');
|
|
127437
|
-
|
|
127438
|
-
return RegExp(`^${escaped}$`);
|
|
127439
|
-
};
|
|
127440
|
-
|
|
127441
|
-
filesystem.getParentDirectory = (filePath) => {
|
|
127442
|
-
const {parentPath} = filePath.parentPath.parentPath;
|
|
127443
|
-
|
|
127444
|
-
if (isProgram(parentPath))
|
|
127445
|
-
return null;
|
|
127446
|
-
|
|
127447
|
-
return parentPath;
|
|
127448
|
-
};
|
|
127449
|
-
|
|
127450
|
-
filesystem.findFile = findFile$1;
|
|
127451
|
-
|
|
127452
|
-
function findFile$1(node, name) {
|
|
127453
|
-
checkName(name);
|
|
127454
|
-
|
|
127455
|
-
const filePaths = [];
|
|
127456
|
-
const names = maybeArray(name);
|
|
127457
|
-
|
|
127458
|
-
for (const filenamePath of traverseProperties$1(node, 'filename')) {
|
|
127459
|
-
const {value} = filenamePath.node.value;
|
|
127460
|
-
const base = basename(value);
|
|
127461
|
-
|
|
127462
|
-
for (const name of names) {
|
|
127463
|
-
if (value === name || getRegExp(name).test(base))
|
|
127464
|
-
filePaths.push(filenamePath.parentPath);
|
|
127465
|
-
}
|
|
127466
|
-
}
|
|
127467
|
-
|
|
127468
|
-
return filePaths;
|
|
127469
|
-
}
|
|
127470
|
-
|
|
127471
|
-
function checkName(name) {
|
|
127472
|
-
if (!isString$1(name) && !isArray(name))
|
|
127473
|
-
throw Error(`☝️ Looks like you forget to pass the 'name' of a file to 'findFile(filePath: Path|FilePath, name: string | string[]): FilePath'`);
|
|
127474
|
-
}
|
|
127475
|
-
|
|
127476
|
-
function getFilenamePath(filePath) {
|
|
127477
|
-
const filenamePath = getProperty(filePath, 'filename');
|
|
127478
|
-
return filenamePath.get('value');
|
|
127479
|
-
}
|
|
127480
|
-
|
|
127481
|
-
function getFilename$1(filePath) {
|
|
127482
|
-
const {value} = getFilenamePath(filePath).node;
|
|
127483
|
-
return value;
|
|
127484
|
-
}
|
|
127485
|
-
|
|
127486
|
-
filesystem.getFileType = getFileType;
|
|
127487
|
-
|
|
127488
|
-
function getFileType(filePath) {
|
|
127489
|
-
const typePath = getProperty(filePath, 'type');
|
|
127490
|
-
return typePath.node.value.value;
|
|
127491
|
-
}
|
|
127492
|
-
|
|
127493
|
-
filesystem.getFileContent = getFileContent;
|
|
127494
|
-
|
|
127495
|
-
function getFileContent(filePath) {
|
|
127496
|
-
const content = getProperty(filePath, 'content');
|
|
127497
|
-
|
|
127498
|
-
return [
|
|
127499
|
-
Boolean(content),
|
|
127500
|
-
content?.node.value.value,
|
|
127501
|
-
];
|
|
127502
|
-
}
|
|
127503
|
-
|
|
127504
|
-
filesystem.getFilename = getFilename$1;
|
|
127505
|
-
|
|
127506
|
-
filesystem.renameFile = (filePath, name) => {
|
|
127507
|
-
const oldName = getFilename$1(filePath);
|
|
127508
|
-
const valuePath = getFilenamePath(filePath);
|
|
127509
|
-
const baseName = oldName
|
|
127510
|
-
.split('/')
|
|
127511
|
-
.pop();
|
|
127512
|
-
|
|
127513
|
-
const newName = name
|
|
127514
|
-
.split('/')
|
|
127515
|
-
.pop();
|
|
127516
|
-
|
|
127517
|
-
const newFilename = oldName.replace(baseName, newName);
|
|
127518
|
-
|
|
127519
|
-
setLiteralValue(valuePath, newFilename);
|
|
127520
|
-
maybeFS.renameFile(oldName, newFilename);
|
|
127521
|
-
};
|
|
127522
|
-
|
|
127523
|
-
filesystem.removeFile = (filePath) => {
|
|
127524
|
-
const filename = getFilename$1(filePath);
|
|
127525
|
-
|
|
127526
|
-
filePath.remove();
|
|
127527
|
-
maybeFS.removeFile(filename);
|
|
127528
|
-
};
|
|
127529
|
-
|
|
127530
|
-
filesystem.moveFile = (filePath, dirPath) => {
|
|
127531
|
-
if (filePath === dirPath)
|
|
127532
|
-
return;
|
|
127533
|
-
|
|
127534
|
-
const dirname = getFilename$1(dirPath);
|
|
127535
|
-
const filename = getFilename$1(filePath);
|
|
127536
|
-
const dirPathFiles = getProperty(dirPath, 'files');
|
|
127537
|
-
const filenamePath = getProperty(filePath, 'filename');
|
|
127538
|
-
|
|
127539
|
-
const basename = filename
|
|
127540
|
-
.split('/')
|
|
127541
|
-
.pop();
|
|
127542
|
-
|
|
127543
|
-
const newFilename = join$1(dirname, basename);
|
|
127544
|
-
|
|
127545
|
-
maybeRemoveFile(dirPath, newFilename);
|
|
127546
|
-
|
|
127547
|
-
setLiteralValue(filenamePath.get('value'), newFilename);
|
|
127548
|
-
dirPathFiles.node.value.elements.push(filePath.node);
|
|
127549
|
-
|
|
127550
|
-
filePath.remove();
|
|
127551
|
-
maybeFS.renameFile(filename, newFilename);
|
|
127552
|
-
};
|
|
127553
|
-
|
|
127554
|
-
filesystem.copyFile = (filePath, dirPath) => {
|
|
127555
|
-
const dirname = getFilename$1(dirPath);
|
|
127556
|
-
const filename = getFilename$1(filePath);
|
|
127557
|
-
|
|
127558
|
-
const basename = filename
|
|
127559
|
-
.split('/')
|
|
127560
|
-
.pop();
|
|
127561
|
-
|
|
127562
|
-
const newFilename = join$1(dirname, basename);
|
|
127563
|
-
const [hasContent, content] = getFileContent(filePath);
|
|
127564
|
-
|
|
127565
|
-
const copiedFile = ObjectExpression([
|
|
127566
|
-
createTypeProperty('file'),
|
|
127567
|
-
createFilenameProperty(newFilename),
|
|
127568
|
-
hasContent && createContentProperty(content),
|
|
127569
|
-
].filter(Boolean));
|
|
127570
|
-
|
|
127571
|
-
maybeRemoveFile(dirPath, newFilename);
|
|
127572
|
-
|
|
127573
|
-
const dirPathFiles = getFiles(dirPath);
|
|
127574
|
-
dirPathFiles.node.value.elements.push(copiedFile);
|
|
127575
|
-
|
|
127576
|
-
maybeFS.copyFile(filename, newFilename);
|
|
127577
|
-
};
|
|
127578
|
-
|
|
127579
|
-
function maybeRemoveFile(dirPath, filename) {
|
|
127580
|
-
const type = getFileType(dirPath);
|
|
127581
|
-
|
|
127582
|
-
if (type !== 'directory') {
|
|
127583
|
-
const filename = getFilename$1(dirPath);
|
|
127584
|
-
throw Error(`☝️ Looks like '${filename}' is not a directory, but: '${type}'. Rename to '${filename}/'`);
|
|
127585
|
-
}
|
|
127586
|
-
|
|
127587
|
-
const dirPathFiles = getProperty(dirPath, 'files');
|
|
127588
|
-
const name = join$1(getFilename$1(dirPath), basename(filename));
|
|
127589
|
-
const [fileToOverwrite] = findFile$1(dirPathFiles, name);
|
|
127590
|
-
|
|
127591
|
-
if (!fileToOverwrite)
|
|
127592
|
-
return;
|
|
127593
|
-
|
|
127594
|
-
fileToOverwrite.remove();
|
|
127595
|
-
}
|
|
127596
|
-
|
|
127597
|
-
const createTypeProperty = (type) => ObjectProperty(StringLiteral$1('type'), StringLiteral$1(type));
|
|
127598
|
-
|
|
127599
|
-
filesystem.createTypeProperty = createTypeProperty;
|
|
127600
|
-
|
|
127601
|
-
const createFilesProperty = (files) => ObjectProperty(StringLiteral$1('files'), ArrayExpression(files));
|
|
127602
|
-
|
|
127603
|
-
filesystem.createFilesProperty = createFilesProperty;
|
|
127604
|
-
|
|
127605
|
-
const createFilenameProperty = (filename) => ObjectProperty(StringLiteral$1('filename'), StringLiteral$1(filename));
|
|
127606
|
-
|
|
127607
|
-
filesystem.createFilenameProperty = createFilenameProperty;
|
|
127608
|
-
|
|
127609
|
-
const createContentProperty = (content) => ObjectProperty(StringLiteral$1('content'), StringLiteral$1(content));
|
|
127610
|
-
|
|
127611
|
-
filesystem.createContentProperty = createContentProperty;
|
|
127612
|
-
|
|
127613
|
-
filesystem.createFile = (dirPath, name, content) => {
|
|
127614
|
-
maybeRemoveFile(dirPath, name);
|
|
127615
|
-
|
|
127616
|
-
const dirPathFiles = getFiles(dirPath);
|
|
127617
|
-
const parentFilename = getFilename$1(dirPath);
|
|
127618
|
-
const filename = join$1(parentFilename, name);
|
|
127619
|
-
|
|
127620
|
-
const typeProperty = createTypeProperty('file');
|
|
127621
|
-
const filenameProperty = createFilenameProperty(filename);
|
|
127622
|
-
|
|
127623
|
-
const properties = [
|
|
127624
|
-
typeProperty,
|
|
127625
|
-
filenameProperty,
|
|
127626
|
-
content && createContentProperty(content),
|
|
127627
|
-
].filter(Boolean);
|
|
127628
|
-
|
|
127629
|
-
dirPathFiles.node.value.elements.push(ObjectExpression(properties));
|
|
127630
|
-
|
|
127631
|
-
const filePath = dirPathFiles
|
|
127632
|
-
.get('value.elements')
|
|
127633
|
-
.at(-1);
|
|
127634
|
-
|
|
127635
|
-
if (isString$1(content))
|
|
127636
|
-
writeFileContent(filePath, content);
|
|
127637
|
-
|
|
127638
|
-
return filePath;
|
|
127639
|
-
};
|
|
127640
|
-
|
|
127641
|
-
function getFiles(dirPath) {
|
|
127642
|
-
return getProperty(dirPath, 'files');
|
|
127643
|
-
}
|
|
127644
|
-
|
|
127645
|
-
filesystem.createDirectory = (dirPath, name) => {
|
|
127646
|
-
const dirPathFiles = getFiles(dirPath);
|
|
127647
|
-
const parentFilename = getFilename$1(dirPath);
|
|
127648
|
-
const filename = join$1(parentFilename, name);
|
|
127649
|
-
|
|
127650
|
-
const typeProperty = createTypeProperty('directory');
|
|
127651
|
-
const filesProperty = createFilesProperty([]);
|
|
127652
|
-
const filenameProperty = createFilenameProperty(filename);
|
|
127653
|
-
|
|
127654
|
-
dirPathFiles.node.value.elements.push(ObjectExpression([
|
|
127655
|
-
typeProperty,
|
|
127656
|
-
filenameProperty,
|
|
127657
|
-
filesProperty,
|
|
127658
|
-
]));
|
|
127659
|
-
|
|
127660
|
-
maybeFS.createDirectory(filename);
|
|
127661
|
-
|
|
127662
|
-
return dirPathFiles
|
|
127663
|
-
.get('value.elements')
|
|
127664
|
-
.at(-1);
|
|
127665
|
-
};
|
|
127666
|
-
|
|
127667
|
-
filesystem.readFileContent = (filePath) => {
|
|
127668
|
-
const fileType = getFileType(filePath);
|
|
127669
|
-
|
|
127670
|
-
if (fileType === 'directory')
|
|
127671
|
-
return '';
|
|
127672
|
-
|
|
127673
|
-
const [hasContent, content] = getFileContent(filePath);
|
|
127674
|
-
|
|
127675
|
-
if (hasContent)
|
|
127676
|
-
return fromBase64(content);
|
|
127677
|
-
|
|
127678
|
-
const filename = getFilename$1(filePath);
|
|
127679
|
-
const fileContent = maybeFS.readFileContent(filename);
|
|
127680
|
-
|
|
127681
|
-
const property = createContentProperty(toBase64(fileContent));
|
|
127682
|
-
|
|
127683
|
-
filePath.node.properties.push(property);
|
|
127684
|
-
|
|
127685
|
-
return fileContent;
|
|
127686
|
-
};
|
|
127687
|
-
|
|
127688
|
-
filesystem.writeFileContent = writeFileContent;
|
|
127689
|
-
|
|
127690
|
-
function writeFileContent(filePath, content) {
|
|
127691
|
-
const fileType = getFileType(filePath);
|
|
127692
|
-
|
|
127693
|
-
if (fileType === 'directory')
|
|
127694
|
-
return;
|
|
127695
|
-
|
|
127696
|
-
const filename = getFilename$1(filePath);
|
|
127697
|
-
|
|
127698
|
-
maybeFS.writeFileContent(filename, content);
|
|
127699
|
-
|
|
127700
|
-
const contentPath = getProperty(filePath, 'content');
|
|
127701
|
-
|
|
127702
|
-
if (contentPath) {
|
|
127703
|
-
setLiteralValue(contentPath.node.value, toBase64(content));
|
|
127704
|
-
return;
|
|
127705
|
-
}
|
|
127706
|
-
|
|
127707
|
-
const property = createContentProperty(toBase64(content));
|
|
127708
|
-
filePath.node.properties.push(property);
|
|
127709
|
-
}
|
|
127710
|
-
|
|
127711
|
-
filesystem.init = maybeFS.init;
|
|
127712
|
-
filesystem.deinit = maybeFS.deinit;
|
|
127713
|
-
|
|
127714
|
-
filesystem.pause = maybeFS.pause;
|
|
127715
|
-
filesystem.start = maybeFS.start;
|
|
127716
|
-
|
|
127717
126595
|
const {join} = require$$0$2;
|
|
127718
126596
|
|
|
127719
126597
|
const {
|
|
@@ -128050,7 +126928,7 @@ var operator = putout$1.exports.operator = {
|
|
|
128050
126928
|
...declare$2,
|
|
128051
126929
|
...regexp,
|
|
128052
126930
|
...addArgs,
|
|
128053
|
-
...filesystem
|
|
126931
|
+
...filesystem,
|
|
128054
126932
|
...matchFiles,
|
|
128055
126933
|
...renameFiles,
|
|
128056
126934
|
...ignore,
|