@putout/bundle 3.18.5 → 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 +593 -1339
- package/bundle/putout.min.js +1 -1
- package/package.json +2 -2
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$4 () {
|
|
|
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$6(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$5 = (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 {
|
|
@@ -85178,15 +85184,52 @@ tsTypeReference.TSTypeReference = (path, {print}) => {
|
|
|
85178
85184
|
print('__typeParameters');
|
|
85179
85185
|
};
|
|
85180
85186
|
|
|
85181
|
-
var
|
|
85187
|
+
var tsInferType = {};
|
|
85182
85188
|
|
|
85183
85189
|
const {maybeParens} = maybeParens$8;
|
|
85184
85190
|
|
|
85185
|
-
|
|
85191
|
+
tsInferType.TSInferType = maybeParens((path, {print}) => {
|
|
85186
85192
|
print('infer ');
|
|
85187
85193
|
print('__typeParameter');
|
|
85188
85194
|
});
|
|
85189
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
|
+
|
|
85190
85233
|
const {isNext: isNext$1} = is$3;
|
|
85191
85234
|
const {TSTypeLiteral} = tsTypeLiteral;
|
|
85192
85235
|
const {TSTypeAliasDeclaration} = tsTypeAliasDeclaration;
|
|
@@ -85226,7 +85269,8 @@ const {maybePrintTypeAnnotation} = maybeTypeAnnotation$4;
|
|
|
85226
85269
|
const {TSImportType} = tsImportType;
|
|
85227
85270
|
const {TSExportAssignment} = tsExportAssignment;
|
|
85228
85271
|
const {TSTypeReference} = tsTypeReference;
|
|
85229
|
-
const {TSInferType} =
|
|
85272
|
+
const {TSInferType} = tsInferType;
|
|
85273
|
+
const {TSParameterProperty} = tsParameterProperty;
|
|
85230
85274
|
|
|
85231
85275
|
var typescript$1 = {
|
|
85232
85276
|
TSAsExpression,
|
|
@@ -85360,14 +85404,10 @@ var typescript$1 = {
|
|
|
85360
85404
|
print('.');
|
|
85361
85405
|
print('__right');
|
|
85362
85406
|
},
|
|
85363
|
-
TSParameterProperty(path, {write, print}) {
|
|
85364
|
-
write(path.node.accessibility);
|
|
85365
|
-
write.space();
|
|
85366
|
-
print('__parameter');
|
|
85367
|
-
},
|
|
85368
85407
|
TSTypeAnnotation(path, {print}) {
|
|
85369
85408
|
print('__typeAnnotation');
|
|
85370
85409
|
},
|
|
85410
|
+
TSParameterProperty,
|
|
85371
85411
|
TSConstructSignatureDeclaration,
|
|
85372
85412
|
TSIndexSignature(path, printer) {
|
|
85373
85413
|
const {print} = printer;
|
|
@@ -85724,7 +85764,7 @@ function snakeCase(str) {
|
|
|
85724
85764
|
}
|
|
85725
85765
|
|
|
85726
85766
|
const {stringify: stringify$8} = JSON;
|
|
85727
|
-
const {TYPES: TYPES$2} = types$
|
|
85767
|
+
const {TYPES: TYPES$2} = types$w;
|
|
85728
85768
|
const toSnakeCase = justSnakeCase;
|
|
85729
85769
|
|
|
85730
85770
|
const {codeFrameColumns: codeFrameColumns$1} = bundle;
|
|
@@ -85892,10 +85932,10 @@ function initSemantics(semantics = {}) {
|
|
|
85892
85932
|
}
|
|
85893
85933
|
|
|
85894
85934
|
const {round} = Math;
|
|
85895
|
-
const fullstore$
|
|
85935
|
+
const fullstore$2 = fullstore$3;
|
|
85896
85936
|
const isObject$4 = (a) => a && typeof a === 'object';
|
|
85897
85937
|
const babelTraverse$2 = bundle.traverse;
|
|
85898
|
-
const {TYPES: TYPES$1} = types$
|
|
85938
|
+
const {TYPES: TYPES$1} = types$w;
|
|
85899
85939
|
const baseVisitors = visitors$1;
|
|
85900
85940
|
|
|
85901
85941
|
const {
|
|
@@ -85914,8 +85954,8 @@ const {
|
|
|
85914
85954
|
|
|
85915
85955
|
const {parseOverrides} = overrides;
|
|
85916
85956
|
|
|
85917
|
-
const isString$
|
|
85918
|
-
const {assign: assign$
|
|
85957
|
+
const isString$8 = (a) => typeof a === 'string';
|
|
85958
|
+
const {assign: assign$a, freeze} = Object;
|
|
85919
85959
|
|
|
85920
85960
|
const GET = '__';
|
|
85921
85961
|
const get = (path, command) => path.get(command.replace(GET, ''));
|
|
@@ -85966,7 +86006,7 @@ tokenize$1.tokenize = (ast, overrides) => {
|
|
|
85966
86006
|
});
|
|
85967
86007
|
};
|
|
85968
86008
|
|
|
85969
|
-
assign$
|
|
86009
|
+
assign$a(indent, {
|
|
85970
86010
|
inc: incIndent,
|
|
85971
86011
|
dec: decIndent,
|
|
85972
86012
|
});
|
|
@@ -86016,7 +86056,7 @@ tokenize$1.tokenize = (ast, overrides) => {
|
|
|
86016
86056
|
});
|
|
86017
86057
|
};
|
|
86018
86058
|
|
|
86019
|
-
assign$
|
|
86059
|
+
assign$a(write, {
|
|
86020
86060
|
indent,
|
|
86021
86061
|
newline,
|
|
86022
86062
|
linebreak,
|
|
@@ -86027,7 +86067,7 @@ tokenize$1.tokenize = (ast, overrides) => {
|
|
|
86027
86067
|
endOfFile,
|
|
86028
86068
|
});
|
|
86029
86069
|
|
|
86030
|
-
assign$
|
|
86070
|
+
assign$a(maybeWrite, {
|
|
86031
86071
|
newline: maybeNewline,
|
|
86032
86072
|
breakline: maybeBreakline,
|
|
86033
86073
|
linebreak: maybeLinebreak,
|
|
@@ -86041,7 +86081,7 @@ tokenize$1.tokenize = (ast, overrides) => {
|
|
|
86041
86081
|
space: maybeSpace,
|
|
86042
86082
|
};
|
|
86043
86083
|
|
|
86044
|
-
assign$
|
|
86084
|
+
assign$a(maybe.indent, {
|
|
86045
86085
|
inc: maybeIndentInc,
|
|
86046
86086
|
dec: maybeIndentDec,
|
|
86047
86087
|
});
|
|
@@ -86054,7 +86094,7 @@ tokenize$1.tokenize = (ast, overrides) => {
|
|
|
86054
86094
|
traverse,
|
|
86055
86095
|
maybe,
|
|
86056
86096
|
quote,
|
|
86057
|
-
store: fullstore$
|
|
86097
|
+
store: fullstore$2(),
|
|
86058
86098
|
});
|
|
86059
86099
|
|
|
86060
86100
|
const currentTraversers = {
|
|
@@ -86084,7 +86124,7 @@ tokenize$1.tokenize = (ast, overrides) => {
|
|
|
86084
86124
|
traverse,
|
|
86085
86125
|
});
|
|
86086
86126
|
|
|
86087
|
-
assign$
|
|
86127
|
+
assign$a(print, write, {
|
|
86088
86128
|
space,
|
|
86089
86129
|
round,
|
|
86090
86130
|
});
|
|
@@ -86096,14 +86136,14 @@ tokenize$1.tokenize = (ast, overrides) => {
|
|
|
86096
86136
|
|
|
86097
86137
|
const maybePrint = (a, b) => a && print(b);
|
|
86098
86138
|
|
|
86099
|
-
assign$
|
|
86139
|
+
assign$a(maybePrint, {
|
|
86100
86140
|
newline: maybeNewline,
|
|
86101
86141
|
breakline: maybeBreakline,
|
|
86102
86142
|
linebreak: maybeLinebreak,
|
|
86103
86143
|
space: maybeSpace,
|
|
86104
86144
|
});
|
|
86105
86145
|
|
|
86106
|
-
assign$
|
|
86146
|
+
assign$a(printer.maybe, {
|
|
86107
86147
|
print: maybePrint,
|
|
86108
86148
|
});
|
|
86109
86149
|
|
|
@@ -86146,7 +86186,7 @@ const createPrint = (path, {traverse, write}) => (maybeLine) => {
|
|
|
86146
86186
|
};
|
|
86147
86187
|
|
|
86148
86188
|
const computePath = (path, maybeLine) => {
|
|
86149
|
-
if (isString$
|
|
86189
|
+
if (isString$8(maybeLine) && maybeLine.startsWith(GET))
|
|
86150
86190
|
return get(path, maybeLine);
|
|
86151
86191
|
|
|
86152
86192
|
if (isObject$4(maybeLine))
|
|
@@ -86364,9 +86404,9 @@ const putoutPrinter = printer;
|
|
|
86364
86404
|
const {generate: generate$5} = bundle;
|
|
86365
86405
|
|
|
86366
86406
|
const {stringify: stringify$7} = JSON;
|
|
86367
|
-
const {isArray: isArray$
|
|
86407
|
+
const {isArray: isArray$d} = Array;
|
|
86368
86408
|
|
|
86369
|
-
const maybeArray$
|
|
86409
|
+
const maybeArray$7 = (a) => isArray$d(a) ? a : [a, {}];
|
|
86370
86410
|
|
|
86371
86411
|
const btoa$1 = (a) => Buffer.from(a, 'binary').toString('base64');
|
|
86372
86412
|
|
|
@@ -86375,7 +86415,7 @@ const fixStrictMode = (a) => a.replace(`\n\n\n'use strict'`, `\n\n'use strict'`)
|
|
|
86375
86415
|
|
|
86376
86416
|
var print$4 = (ast, options = {}) => {
|
|
86377
86417
|
const {sourceMapName} = options;
|
|
86378
|
-
const [printer = 'putout', printerOptions] = maybeArray$
|
|
86418
|
+
const [printer = 'putout', printerOptions] = maybeArray$7(options.printer);
|
|
86379
86419
|
|
|
86380
86420
|
if (printer === 'recast') {
|
|
86381
86421
|
const printOptions = {
|
|
@@ -86419,7 +86459,7 @@ const {
|
|
|
86419
86459
|
ObjectMethod,
|
|
86420
86460
|
} = bundle.types;
|
|
86421
86461
|
|
|
86422
|
-
const {assign: assign$
|
|
86462
|
+
const {assign: assign$9} = Object;
|
|
86423
86463
|
|
|
86424
86464
|
var traverseObjectExpression$1 = (propertiesPaths) => {
|
|
86425
86465
|
for (const propPath of propertiesPaths) {
|
|
@@ -86433,7 +86473,7 @@ var traverseObjectExpression$1 = (propertiesPaths) => {
|
|
|
86433
86473
|
if (method && isFunctionExpression(value)) {
|
|
86434
86474
|
propPath.replaceWith(ObjectMethod('method', key, value.params, value.body, computed));
|
|
86435
86475
|
|
|
86436
|
-
assign$
|
|
86476
|
+
assign$9(propPath.node, {
|
|
86437
86477
|
id: null,
|
|
86438
86478
|
method: true,
|
|
86439
86479
|
generator: value.generator,
|
|
@@ -86462,7 +86502,7 @@ const {
|
|
|
86462
86502
|
Identifier: Identifier$1,
|
|
86463
86503
|
} = bundle.types;
|
|
86464
86504
|
|
|
86465
|
-
const {assign: assign$
|
|
86505
|
+
const {assign: assign$8} = Object;
|
|
86466
86506
|
|
|
86467
86507
|
var setClassMethod$1 = (path) => {
|
|
86468
86508
|
const {node} = path;
|
|
@@ -86490,7 +86530,7 @@ var setClassMethod$1 = (path) => {
|
|
|
86490
86530
|
});
|
|
86491
86531
|
|
|
86492
86532
|
path.replaceWith(method);
|
|
86493
|
-
assign$
|
|
86533
|
+
assign$8(path.node, {
|
|
86494
86534
|
loc,
|
|
86495
86535
|
expression,
|
|
86496
86536
|
generator,
|
|
@@ -86584,12 +86624,12 @@ var convertImportDeclaration$1 = (path) => {
|
|
|
86584
86624
|
path.node.attributes = attributes;
|
|
86585
86625
|
};
|
|
86586
86626
|
|
|
86587
|
-
const {assign: assign$
|
|
86627
|
+
const {assign: assign$7} = Object;
|
|
86588
86628
|
|
|
86589
86629
|
var convertExportDeclaration$1 = (path) => {
|
|
86590
86630
|
const {attributes = []} = path.node;
|
|
86591
86631
|
|
|
86592
|
-
assign$
|
|
86632
|
+
assign$7(path.node, {
|
|
86593
86633
|
attributes,
|
|
86594
86634
|
});
|
|
86595
86635
|
};
|
|
@@ -86718,7 +86758,7 @@ function getCommentGroup({trailing, leading}) {
|
|
|
86718
86758
|
return 'innerComments'; // Dangling comments, such as `[/* a */]`.
|
|
86719
86759
|
}
|
|
86720
86760
|
|
|
86721
|
-
const isString$
|
|
86761
|
+
const isString$7 = (a) => typeof a === 'string';
|
|
86722
86762
|
const isNumber$1 = (a) => typeof a === 'number';
|
|
86723
86763
|
const isNull = (a) => a === null;
|
|
86724
86764
|
const isBool$3 = (a) => typeof a === 'boolean';
|
|
@@ -86734,7 +86774,7 @@ var setLiteral$1 = (node) => {
|
|
|
86734
86774
|
return;
|
|
86735
86775
|
}
|
|
86736
86776
|
|
|
86737
|
-
if (isString$
|
|
86777
|
+
if (isString$7(value)) {
|
|
86738
86778
|
node.type = 'StringLiteral';
|
|
86739
86779
|
return;
|
|
86740
86780
|
}
|
|
@@ -86790,7 +86830,7 @@ var getAst = (node) => {
|
|
|
86790
86830
|
return ast;
|
|
86791
86831
|
};
|
|
86792
86832
|
|
|
86793
|
-
const {traverse: traverse$a, types: types$
|
|
86833
|
+
const {traverse: traverse$a, types: types$h} = bundle;
|
|
86794
86834
|
|
|
86795
86835
|
const traverseObjectExpression = traverseObjectExpression$1;
|
|
86796
86836
|
const setClassMethod = setClassMethod$1;
|
|
@@ -86816,7 +86856,7 @@ const getAST = getAst;
|
|
|
86816
86856
|
const {
|
|
86817
86857
|
isObjectExpression,
|
|
86818
86858
|
isExportDeclaration,
|
|
86819
|
-
} = types$
|
|
86859
|
+
} = types$h;
|
|
86820
86860
|
|
|
86821
86861
|
var estreeToBabel = (node) => {
|
|
86822
86862
|
const ast = getAST(node);
|
|
@@ -94398,7 +94438,7 @@ const options = options$1;
|
|
|
94398
94438
|
const getFlow = (a) => !a.indexOf('// @flow');
|
|
94399
94439
|
const clean = (a) => a.filter(Boolean);
|
|
94400
94440
|
const initBabel = once$6(() => bundle);
|
|
94401
|
-
const {assign: assign$
|
|
94441
|
+
const {assign: assign$6} = Object;
|
|
94402
94442
|
|
|
94403
94443
|
// There is a difference in options naming for babel and recast
|
|
94404
94444
|
// recast -> sourceFileName
|
|
@@ -94420,7 +94460,7 @@ babel$1.parse = function babelParse(source, {sourceFilename, isTS, isJSX = true,
|
|
|
94420
94460
|
]),
|
|
94421
94461
|
};
|
|
94422
94462
|
|
|
94423
|
-
sourceFilename && assign$
|
|
94463
|
+
sourceFilename && assign$6(parserOptions, {
|
|
94424
94464
|
sourceFilename,
|
|
94425
94465
|
});
|
|
94426
94466
|
|
|
@@ -107215,7 +107255,7 @@ function isAbsolute(path) {
|
|
|
107215
107255
|
}
|
|
107216
107256
|
|
|
107217
107257
|
// posix version
|
|
107218
|
-
function join$
|
|
107258
|
+
function join$3() {
|
|
107219
107259
|
var paths = Array.prototype.slice.call(arguments, 0);
|
|
107220
107260
|
return normalize(filter$1(paths, function(p, index) {
|
|
107221
107261
|
if (typeof p !== 'string') {
|
|
@@ -107290,7 +107330,7 @@ function dirname$1(path) {
|
|
|
107290
107330
|
return root + dir;
|
|
107291
107331
|
}
|
|
107292
107332
|
|
|
107293
|
-
function basename$
|
|
107333
|
+
function basename$3(path, ext) {
|
|
107294
107334
|
var f = splitPath(path)[2];
|
|
107295
107335
|
// TODO: make this comparison case-insensitive on windows?
|
|
107296
107336
|
if (ext && f.substr(-1 * ext.length) === ext) {
|
|
@@ -107305,12 +107345,12 @@ function extname(path) {
|
|
|
107305
107345
|
}
|
|
107306
107346
|
var _polyfillNode_path = {
|
|
107307
107347
|
extname: extname,
|
|
107308
|
-
basename: basename$
|
|
107348
|
+
basename: basename$3,
|
|
107309
107349
|
dirname: dirname$1,
|
|
107310
107350
|
sep: sep,
|
|
107311
107351
|
delimiter: delimiter,
|
|
107312
107352
|
relative: relative$1,
|
|
107313
|
-
join: join$
|
|
107353
|
+
join: join$3,
|
|
107314
107354
|
isAbsolute: isAbsolute,
|
|
107315
107355
|
normalize: normalize,
|
|
107316
107356
|
resolve: resolve
|
|
@@ -107335,13 +107375,13 @@ var substr = 'ab'.substr(-1) === 'b' ?
|
|
|
107335
107375
|
|
|
107336
107376
|
var _polyfillNode_path$1 = /*#__PURE__*/Object.freeze({
|
|
107337
107377
|
__proto__: null,
|
|
107338
|
-
basename: basename$
|
|
107378
|
+
basename: basename$3,
|
|
107339
107379
|
default: _polyfillNode_path,
|
|
107340
107380
|
delimiter: delimiter,
|
|
107341
107381
|
dirname: dirname$1,
|
|
107342
107382
|
extname: extname,
|
|
107343
107383
|
isAbsolute: isAbsolute,
|
|
107344
|
-
join: join$
|
|
107384
|
+
join: join$3,
|
|
107345
107385
|
normalize: normalize,
|
|
107346
107386
|
relative: relative$1,
|
|
107347
107387
|
resolve: resolve,
|
|
@@ -112440,7 +112480,7 @@ hermes$1.parse = function hermesParse(source) {
|
|
|
112440
112480
|
return parser.parse(source, options);
|
|
112441
112481
|
};
|
|
112442
112482
|
|
|
112443
|
-
var tryCatch$
|
|
112483
|
+
var tryCatch$6 = (fn, ...args) => {
|
|
112444
112484
|
try {
|
|
112445
112485
|
return [null, fn(...args)];
|
|
112446
112486
|
} catch(e) {
|
|
@@ -112448,11 +112488,11 @@ var tryCatch$8 = (fn, ...args) => {
|
|
|
112448
112488
|
}
|
|
112449
112489
|
};
|
|
112450
112490
|
|
|
112451
|
-
const tryCatch$
|
|
112491
|
+
const tryCatch$5 = tryCatch$6;
|
|
112452
112492
|
|
|
112453
112493
|
var secondChance$1 = (fn, source, messages, args) => {
|
|
112454
112494
|
const [a, ...others] = args;
|
|
112455
|
-
const [errorA, resultA] = tryCatch$
|
|
112495
|
+
const [errorA, resultA] = tryCatch$5(fn, source, a);
|
|
112456
112496
|
|
|
112457
112497
|
if (!errorA)
|
|
112458
112498
|
return resultA;
|
|
@@ -112461,7 +112501,7 @@ var secondChance$1 = (fn, source, messages, args) => {
|
|
|
112461
112501
|
throw errorA;
|
|
112462
112502
|
|
|
112463
112503
|
for (const b of others) {
|
|
112464
|
-
const [errorB, resultB] = tryCatch$
|
|
112504
|
+
const [errorB, resultB] = tryCatch$5(fn, source, b);
|
|
112465
112505
|
|
|
112466
112506
|
if (!errorB)
|
|
112467
112507
|
return resultB;
|
|
@@ -112550,13 +112590,13 @@ function customParse(source, {parser, isTS, isFlow, isJSX, isRecovery}) {
|
|
|
112550
112590
|
return commonjsRequire(parser).parse(source);
|
|
112551
112591
|
}
|
|
112552
112592
|
|
|
112553
|
-
const {types: types$
|
|
112593
|
+
const {types: types$g} = bundle;
|
|
112554
112594
|
const {
|
|
112555
|
-
StringLiteral: StringLiteral$
|
|
112595
|
+
StringLiteral: StringLiteral$4,
|
|
112556
112596
|
ExpressionStatement,
|
|
112557
|
-
} = types$
|
|
112597
|
+
} = types$g;
|
|
112558
112598
|
|
|
112559
|
-
const {assign: assign$
|
|
112599
|
+
const {assign: assign$5} = Object;
|
|
112560
112600
|
|
|
112561
112601
|
var moveOutDirectives$1 = (ast) => {
|
|
112562
112602
|
const {body, directives} = ast.program;
|
|
@@ -112569,7 +112609,7 @@ var moveOutDirectives$1 = (ast) => {
|
|
|
112569
112609
|
for (const directive of directives) {
|
|
112570
112610
|
const {leadingComments} = directive;
|
|
112571
112611
|
const {value} = directive.value;
|
|
112572
|
-
const expression = assign$
|
|
112612
|
+
const expression = assign$5(ExpressionStatement(StringLiteral$4(value)), {
|
|
112573
112613
|
leadingComments,
|
|
112574
112614
|
});
|
|
112575
112615
|
|
|
@@ -112893,9 +112933,9 @@ var require$$1 = /*@__PURE__*/getAugmentedNamespace(_polyfillNode_module$1);
|
|
|
112893
112933
|
|
|
112894
112934
|
const {createRequire} = require$$1;
|
|
112895
112935
|
|
|
112896
|
-
const tryCatch$
|
|
112936
|
+
const tryCatch$4 = tryCatch$6;
|
|
112897
112937
|
const once$1 = onceExports;
|
|
112898
|
-
const {assign: assign$
|
|
112938
|
+
const {assign: assign$4} = Object;
|
|
112899
112939
|
|
|
112900
112940
|
const bigFirst = (a) => `${a[0].toUpperCase()}${a.slice(1)}`;
|
|
112901
112941
|
|
|
@@ -112905,11 +112945,11 @@ const load = (type) => ({name, namespace}) => {
|
|
|
112905
112945
|
if (!pluginPath)
|
|
112906
112946
|
throw Error(`${bigFirst(type)} "${namespace}-${type}-${name}" could not be found!`);
|
|
112907
112947
|
|
|
112908
|
-
const [error, result] = tryCatch$
|
|
112948
|
+
const [error, result] = tryCatch$4(customRequire, pluginPath);
|
|
112909
112949
|
|
|
112910
112950
|
/* c8 ignore start */
|
|
112911
112951
|
if (error?.code === 'ERR_REQUIRE_ESM')
|
|
112912
|
-
assign$
|
|
112952
|
+
assign$4(error, {
|
|
112913
112953
|
message: `☝️ Looks like '${name}' is ESM, use 'await putoutAsync()' instead`,
|
|
112914
112954
|
name,
|
|
112915
112955
|
});
|
|
@@ -112957,12 +112997,12 @@ function getModulePath(name) {
|
|
|
112957
112997
|
const customRequire = createCustomRequire();
|
|
112958
112998
|
const putoutRequire = createPutoutRequire();
|
|
112959
112999
|
|
|
112960
|
-
[, path] = tryCatch$
|
|
113000
|
+
[, path] = tryCatch$4(putoutRequire.resolve, name);
|
|
112961
113001
|
|
|
112962
113002
|
if (path)
|
|
112963
113003
|
return [path, putoutRequire];
|
|
112964
113004
|
|
|
112965
|
-
[, path] = tryCatch$
|
|
113005
|
+
[, path] = tryCatch$4(customRequire.resolve, name);
|
|
112966
113006
|
|
|
112967
113007
|
return [path, customRequire];
|
|
112968
113008
|
}
|
|
@@ -112996,7 +113036,7 @@ const {nanomemoize} = require$$0$1;
|
|
|
112996
113036
|
const tryToCatch = tryToCatch$1;
|
|
112997
113037
|
const {simpleImport} = simpleImport$1;
|
|
112998
113038
|
|
|
112999
|
-
const {assign: assign$
|
|
113039
|
+
const {assign: assign$3} = Object;
|
|
113000
113040
|
const stub$2 = () => () => {};
|
|
113001
113041
|
|
|
113002
113042
|
asyncLoader.createAsyncLoader = (type) => nanomemoize(async (name, load) => {
|
|
@@ -113025,14 +113065,14 @@ async function cleverLoad(names, load = simpleImport) {
|
|
|
113025
113065
|
if (e.code === 'ERR_MODULE_NOT_FOUND')
|
|
113026
113066
|
continue;
|
|
113027
113067
|
|
|
113028
|
-
assign$
|
|
113068
|
+
assign$3(e, {
|
|
113029
113069
|
message: `${name}: ${e.message}`,
|
|
113030
113070
|
});
|
|
113031
113071
|
|
|
113032
113072
|
throw e;
|
|
113033
113073
|
}
|
|
113034
113074
|
|
|
113035
|
-
assign$
|
|
113075
|
+
assign$3(e, {
|
|
113036
113076
|
message: e.message.replace(/\simported.*/, ''),
|
|
113037
113077
|
});
|
|
113038
113078
|
|
|
@@ -113042,7 +113082,7 @@ async function cleverLoad(names, load = simpleImport) {
|
|
|
113042
113082
|
var parsePluginNames$2 = {};
|
|
113043
113083
|
|
|
113044
113084
|
const isStr$4 = (a) => typeof a === 'string';
|
|
113045
|
-
const {isArray: isArray$
|
|
113085
|
+
const {isArray: isArray$c} = Array;
|
|
113046
113086
|
const {entries: entries$9} = Object;
|
|
113047
113087
|
|
|
113048
113088
|
parsePluginNames$2.parsePluginNames = (plugins) => {
|
|
@@ -113054,7 +113094,7 @@ parsePluginNames$2.parsePluginNames = (plugins) => {
|
|
|
113054
113094
|
continue;
|
|
113055
113095
|
}
|
|
113056
113096
|
|
|
113057
|
-
if (isArray$
|
|
113097
|
+
if (isArray$c(plugin)) {
|
|
113058
113098
|
const [pluginName, fn] = plugin;
|
|
113059
113099
|
result.push([pluginName, fn]);
|
|
113060
113100
|
continue;
|
|
@@ -113067,7 +113107,7 @@ parsePluginNames$2.parsePluginNames = (plugins) => {
|
|
|
113067
113107
|
};
|
|
113068
113108
|
|
|
113069
113109
|
const isStr$3 = (a) => typeof a === 'string';
|
|
113070
|
-
const {isArray: isArray$
|
|
113110
|
+
const {isArray: isArray$b} = Array;
|
|
113071
113111
|
|
|
113072
113112
|
const isOn = (a) => a === 'on';
|
|
113073
113113
|
const isOff = (a) => a === 'off';
|
|
@@ -113081,7 +113121,7 @@ var parseProcessorNames$1 = (plugins) => {
|
|
|
113081
113121
|
continue;
|
|
113082
113122
|
}
|
|
113083
113123
|
|
|
113084
|
-
if (isArray$
|
|
113124
|
+
if (isArray$b(plugin)) {
|
|
113085
113125
|
const [pluginName, fn] = plugin;
|
|
113086
113126
|
|
|
113087
113127
|
if (isOff(fn))
|
|
@@ -113126,7 +113166,7 @@ var loadPluginsAsync$1 = {};
|
|
|
113126
113166
|
|
|
113127
113167
|
var parseRules$3 = {};
|
|
113128
113168
|
|
|
113129
|
-
const {isArray: isArray$
|
|
113169
|
+
const {isArray: isArray$a} = Array;
|
|
113130
113170
|
const isBool$2 = (a) => typeof a === 'boolean';
|
|
113131
113171
|
const isStr$2 = (a) => typeof a === 'string';
|
|
113132
113172
|
const isObj$1 = (a) => typeof a === 'object';
|
|
@@ -113180,7 +113220,7 @@ parseRules$3.parseRules = (rules) => {
|
|
|
113180
113220
|
continue;
|
|
113181
113221
|
}
|
|
113182
113222
|
|
|
113183
|
-
const looksLikeArray = isArray$
|
|
113223
|
+
const looksLikeArray = isArray$a(value);
|
|
113184
113224
|
const looksLikeNormalArray = looksLikeArray && value.length;
|
|
113185
113225
|
|
|
113186
113226
|
if (looksLikeNormalArray) {
|
|
@@ -113382,8 +113422,8 @@ var filterEnabledPlugins$2 = {};
|
|
|
113382
113422
|
|
|
113383
113423
|
const {isEnabled: isEnabled$2, mergeRules} = rules;
|
|
113384
113424
|
|
|
113385
|
-
const {isArray: isArray$
|
|
113386
|
-
const maybeTuple = (a) => isArray$
|
|
113425
|
+
const {isArray: isArray$9} = Array;
|
|
113426
|
+
const maybeTuple = (a) => isArray$9(a) ? a : ['on', a];
|
|
113387
113427
|
|
|
113388
113428
|
// Would be great to have ability to filter
|
|
113389
113429
|
// disabled plugins and prevent them from loading
|
|
@@ -113425,7 +113465,7 @@ function isExectRuleEnabled(name, status, rules) {
|
|
|
113425
113465
|
|
|
113426
113466
|
var check$9 = {};
|
|
113427
113467
|
|
|
113428
|
-
const isString$
|
|
113468
|
+
const isString$6 = (a) => typeof a === 'string';
|
|
113429
113469
|
|
|
113430
113470
|
check$9.check = (options) => {
|
|
113431
113471
|
if (!options || typeof options !== 'object')
|
|
@@ -113433,11 +113473,11 @@ check$9.check = (options) => {
|
|
|
113433
113473
|
};
|
|
113434
113474
|
|
|
113435
113475
|
check$9.checkRule = (rule) => {
|
|
113436
|
-
if (!isString$
|
|
113476
|
+
if (!isString$6(rule))
|
|
113437
113477
|
throw Error(`☝️ Looks like plugin name type is not 'string', but: '${typeof rule}'`);
|
|
113438
113478
|
};
|
|
113439
113479
|
|
|
113440
|
-
const {basename: basename$
|
|
113480
|
+
const {basename: basename$2} = require$$0$2;
|
|
113441
113481
|
|
|
113442
113482
|
const {
|
|
113443
113483
|
parseRules: parseRules$1,
|
|
@@ -113532,7 +113572,7 @@ function extendRules$1(rule, plugin) {
|
|
|
113532
113572
|
|
|
113533
113573
|
function parseRuleName(rule) {
|
|
113534
113574
|
if (rule.startsWith('import:')) {
|
|
113535
|
-
const shortName = basename$
|
|
113575
|
+
const shortName = basename$2(rule.replace('import:', ''));
|
|
113536
113576
|
|
|
113537
113577
|
return shortName.replace('plugin-', '');
|
|
113538
113578
|
}
|
|
@@ -113556,7 +113596,7 @@ const {
|
|
|
113556
113596
|
|
|
113557
113597
|
const {filterEnabledPlugins} = filterEnabledPlugins$2;
|
|
113558
113598
|
const {check: check$7, checkRule} = check$9;
|
|
113559
|
-
const {isArray: isArray$
|
|
113599
|
+
const {isArray: isArray$8} = Array;
|
|
113560
113600
|
|
|
113561
113601
|
lib$1.loadPluginsAsync = loadPluginsAsync;
|
|
113562
113602
|
lib$1.loadProcessorsAsync = async (options, load) => {
|
|
@@ -113624,7 +113664,7 @@ function parseRule(rule) {
|
|
|
113624
113664
|
.replace('@putout/plugin-', '');
|
|
113625
113665
|
}
|
|
113626
113666
|
|
|
113627
|
-
const maybeFromTuple = (a) => isArray$
|
|
113667
|
+
const maybeFromTuple = (a) => isArray$8(a) ? a[1] : a;
|
|
113628
113668
|
|
|
113629
113669
|
function loadPlugins({items, loadedRules}) {
|
|
113630
113670
|
const plugins = [];
|
|
@@ -114395,7 +114435,7 @@ var common = setup;
|
|
|
114395
114435
|
var browserExports = browser.exports;
|
|
114396
114436
|
browserExports.default;
|
|
114397
114437
|
|
|
114398
|
-
const tryCatch$
|
|
114438
|
+
const tryCatch$3 = tryCatch$6;
|
|
114399
114439
|
const debug$4 = browserExports('putout:runner:fix');
|
|
114400
114440
|
const {enabled} = debug$4;
|
|
114401
114441
|
const {stringify: stringify$5} = JSON;
|
|
@@ -114419,7 +114459,7 @@ const chooseFixArgs = ({path, pathOptions, options}) => {
|
|
|
114419
114459
|
};
|
|
114420
114460
|
|
|
114421
114461
|
const tryToFix = (fix, {path, pathOptions, position, options}) => {
|
|
114422
|
-
const [e] = tryCatch$
|
|
114462
|
+
const [e] = tryCatch$3(fix, ...chooseFixArgs({
|
|
114423
114463
|
path,
|
|
114424
114464
|
pathOptions,
|
|
114425
114465
|
options,
|
|
@@ -114494,14 +114534,14 @@ function validatePath(path) {
|
|
|
114494
114534
|
throw Error(`☝️ Looks like 'push' called without a 'path' argument.`);
|
|
114495
114535
|
}
|
|
114496
114536
|
|
|
114497
|
-
const {isArray: isArray$
|
|
114498
|
-
const maybeArray$
|
|
114537
|
+
const {isArray: isArray$7} = Array;
|
|
114538
|
+
const maybeArray$6 = (a) => isArray$7(a) ? a : [a];
|
|
114499
114539
|
|
|
114500
114540
|
var maybeArray_1 = (a) => {
|
|
114501
114541
|
if (!a)
|
|
114502
114542
|
return [];
|
|
114503
114543
|
|
|
114504
|
-
return maybeArray$
|
|
114544
|
+
return maybeArray$6(a);
|
|
114505
114545
|
};
|
|
114506
114546
|
|
|
114507
114547
|
var validate$2 = {};
|
|
@@ -114519,7 +114559,7 @@ var store = {};
|
|
|
114519
114559
|
const {
|
|
114520
114560
|
values,
|
|
114521
114561
|
entries: entries$7,
|
|
114522
|
-
assign: assign$
|
|
114562
|
+
assign: assign$2,
|
|
114523
114563
|
} = Object;
|
|
114524
114564
|
|
|
114525
114565
|
const toArray = (a) => Array.from(a);
|
|
@@ -114545,7 +114585,7 @@ store.upStore = createStore({
|
|
|
114545
114585
|
},
|
|
114546
114586
|
set(map, name, data) {
|
|
114547
114587
|
map[name] = map[name] || {};
|
|
114548
|
-
assign$
|
|
114588
|
+
assign$2(map[name], data);
|
|
114549
114589
|
},
|
|
114550
114590
|
});
|
|
114551
114591
|
|
|
@@ -114610,7 +114650,7 @@ const {generate: generate$2} = parser$6;
|
|
|
114610
114650
|
|
|
114611
114651
|
const runFix$2 = runFix$3;
|
|
114612
114652
|
const {getPosition: getPosition$1} = getPosition$2;
|
|
114613
|
-
const maybeArray$
|
|
114653
|
+
const maybeArray$5 = maybeArray_1;
|
|
114614
114654
|
const {validate: validate$1} = validate$2;
|
|
114615
114655
|
|
|
114616
114656
|
const {
|
|
@@ -114624,18 +114664,18 @@ const {
|
|
|
114624
114664
|
const shouldSkip = (a) => !a.parent;
|
|
114625
114665
|
const {merge: merge$2} = traverse$9.visitors;
|
|
114626
114666
|
|
|
114627
|
-
const {assign: assign$
|
|
114667
|
+
const {assign: assign$1} = Object;
|
|
114628
114668
|
|
|
114629
114669
|
const parse$3 = (name, plugin, options) => {
|
|
114630
114670
|
const list = [];
|
|
114631
114671
|
|
|
114632
114672
|
if (plugin[name]) {
|
|
114633
114673
|
validate$1(name, plugin[name]);
|
|
114634
|
-
list.push(...maybeArray$
|
|
114674
|
+
list.push(...maybeArray$5(plugin[name]()));
|
|
114635
114675
|
}
|
|
114636
114676
|
|
|
114637
114677
|
if (options[name])
|
|
114638
|
-
list.push(...maybeArray$
|
|
114678
|
+
list.push(...maybeArray$5(options[name]));
|
|
114639
114679
|
|
|
114640
114680
|
return list;
|
|
114641
114681
|
};
|
|
@@ -114677,7 +114717,7 @@ var mergeVisitors$1 = (pluginsToMerge, {fix, shebang, template}) => {
|
|
|
114677
114717
|
if (!visitor)
|
|
114678
114718
|
throw Error(`☝️ Visitors cannot be empty in "${rule}"`);
|
|
114679
114719
|
|
|
114680
|
-
assign$
|
|
114720
|
+
assign$1(options, {
|
|
114681
114721
|
include: parse$3('include', plugin, options),
|
|
114682
114722
|
exclude: parse$3('exclude', plugin, options),
|
|
114683
114723
|
});
|
|
@@ -114751,7 +114791,7 @@ function getStore(plugin, {fix, rule, shebang, msg, options}) {
|
|
|
114751
114791
|
|
|
114752
114792
|
mergeVisitors$1.default;
|
|
114753
114793
|
|
|
114754
|
-
const {traverse: babelTraverse$1, types: types$
|
|
114794
|
+
const {traverse: babelTraverse$1, types: types$f} = bundle;
|
|
114755
114795
|
|
|
114756
114796
|
const {generate: generate$1} = parser$6;
|
|
114757
114797
|
const {merge: merge$1} = babelTraverse$1.visitors;
|
|
@@ -114770,7 +114810,7 @@ var superFind$1 = function superFind({rule, find, ast, options, template}) {
|
|
|
114770
114810
|
template,
|
|
114771
114811
|
}),
|
|
114772
114812
|
generate: generate$1,
|
|
114773
|
-
types: types$
|
|
114813
|
+
types: types$f,
|
|
114774
114814
|
push,
|
|
114775
114815
|
options,
|
|
114776
114816
|
});
|
|
@@ -114794,7 +114834,7 @@ function traverse$8({rule, options, template}) {
|
|
|
114794
114834
|
}
|
|
114795
114835
|
|
|
114796
114836
|
const log$5 = browserExports('putout:runner:include');
|
|
114797
|
-
const maybeArray$
|
|
114837
|
+
const maybeArray$4 = maybeArray_1;
|
|
114798
114838
|
const {validate} = validate$2;
|
|
114799
114839
|
|
|
114800
114840
|
const stub$1 = () => [];
|
|
@@ -114821,7 +114861,7 @@ var include$2 = ({rule, plugin, msg, options}) => {
|
|
|
114821
114861
|
...options,
|
|
114822
114862
|
exclude: [
|
|
114823
114863
|
...exclude(),
|
|
114824
|
-
...maybeArray$
|
|
114864
|
+
...maybeArray$4(options.exclude),
|
|
114825
114865
|
],
|
|
114826
114866
|
},
|
|
114827
114867
|
plugin: {
|
|
@@ -114950,7 +114990,7 @@ function check$5(selector) {
|
|
|
114950
114990
|
var is$2 = {};
|
|
114951
114991
|
|
|
114952
114992
|
const {template: template$8} = parser$6;
|
|
114953
|
-
const {types: types$
|
|
114993
|
+
const {types: types$e} = bundle;
|
|
114954
114994
|
const {
|
|
114955
114995
|
isBlockStatement: isBlockStatement$1,
|
|
114956
114996
|
isBooleanLiteral,
|
|
@@ -114966,7 +115006,7 @@ const {
|
|
|
114966
115006
|
isJSXAttribute,
|
|
114967
115007
|
isTSTypeReference: isTSTypeReference$1,
|
|
114968
115008
|
isTSTypeParameterDeclaration,
|
|
114969
|
-
} = types$
|
|
115009
|
+
} = types$e;
|
|
114970
115010
|
|
|
114971
115011
|
const isStr$1 = (a) => typeof a === 'string';
|
|
114972
115012
|
|
|
@@ -115076,7 +115116,7 @@ const isBool$1 = (a, b) => {
|
|
|
115076
115116
|
};
|
|
115077
115117
|
|
|
115078
115118
|
const isEqualType$1 = (a, b) => a.type === b.type;
|
|
115079
|
-
const {isArray: isArray$
|
|
115119
|
+
const {isArray: isArray$6} = Array;
|
|
115080
115120
|
|
|
115081
115121
|
is$2.isId = isId$1;
|
|
115082
115122
|
is$2.isBool = isBool$1;
|
|
@@ -115099,7 +115139,7 @@ is$2.isAnyLiteral = (a, b) => {
|
|
|
115099
115139
|
};
|
|
115100
115140
|
|
|
115101
115141
|
is$2.isArgs = (a) => {
|
|
115102
|
-
const b = !isArray$
|
|
115142
|
+
const b = !isArray$6(a) ? a : a[0];
|
|
115103
115143
|
|
|
115104
115144
|
return isIdentifier$3(b, {
|
|
115105
115145
|
name: ARGS,
|
|
@@ -115129,12 +115169,12 @@ is$2.isEqualTypeParams = (a, b) => {
|
|
|
115129
115169
|
};
|
|
115130
115170
|
|
|
115131
115171
|
is$2.isLinkedArgs = (a) => {
|
|
115132
|
-
const b = !isArray$
|
|
115172
|
+
const b = !isArray$6(a) ? a : a[0];
|
|
115133
115173
|
return isIdentifier$3(b) && LINKED_ARGS.test(b.name);
|
|
115134
115174
|
};
|
|
115135
115175
|
|
|
115136
115176
|
is$2.isJSXChildren = (a) => {
|
|
115137
|
-
const b = !isArray$
|
|
115177
|
+
const b = !isArray$6(a) ? a : a[0];
|
|
115138
115178
|
|
|
115139
115179
|
return isJSXText$1(b, {
|
|
115140
115180
|
value: JSX_CHILDREN,
|
|
@@ -115142,7 +115182,7 @@ is$2.isJSXChildren = (a) => {
|
|
|
115142
115182
|
};
|
|
115143
115183
|
|
|
115144
115184
|
is$2.isJSXAttributes = (a) => {
|
|
115145
|
-
const b = !isArray$
|
|
115185
|
+
const b = !isArray$6(a) ? a : a[0];
|
|
115146
115186
|
|
|
115147
115187
|
if (!isJSXAttribute(b))
|
|
115148
115188
|
return false;
|
|
@@ -115174,27 +115214,27 @@ is$2.isLinkedRegExp = (a, b) => {
|
|
|
115174
115214
|
};
|
|
115175
115215
|
|
|
115176
115216
|
is$2.isPath = (path) => Boolean(path.node);
|
|
115177
|
-
is$2.isArray = isArray$
|
|
115217
|
+
is$2.isArray = isArray$6;
|
|
115178
115218
|
|
|
115179
115219
|
is$2.isObject = (a) => {
|
|
115180
115220
|
if (!a)
|
|
115181
115221
|
return false;
|
|
115182
115222
|
|
|
115183
|
-
if (isArray$
|
|
115223
|
+
if (isArray$6(a))
|
|
115184
115224
|
return false;
|
|
115185
115225
|
|
|
115186
115226
|
return typeof a === 'object';
|
|
115187
115227
|
};
|
|
115188
115228
|
|
|
115189
115229
|
is$2.isArrays = (a, b) => {
|
|
115190
|
-
if (!isArray$
|
|
115230
|
+
if (!isArray$6(a) || !isArray$6(b))
|
|
115191
115231
|
return false;
|
|
115192
115232
|
|
|
115193
115233
|
return a.length === b.length;
|
|
115194
115234
|
};
|
|
115195
115235
|
|
|
115196
115236
|
is$2.isImports = (a) => {
|
|
115197
|
-
const b = !isArray$
|
|
115237
|
+
const b = !isArray$6(a) ? a : a[0];
|
|
115198
115238
|
|
|
115199
115239
|
if (!isImportDefaultSpecifier(b))
|
|
115200
115240
|
return false;
|
|
@@ -115205,7 +115245,7 @@ is$2.isImports = (a) => {
|
|
|
115205
115245
|
};
|
|
115206
115246
|
|
|
115207
115247
|
is$2.isExports = (a) => {
|
|
115208
|
-
const b = !isArray$
|
|
115248
|
+
const b = !isArray$6(a) ? a : a[0];
|
|
115209
115249
|
|
|
115210
115250
|
if (!isExportSpecifier(b))
|
|
115211
115251
|
return false;
|
|
@@ -115309,7 +115349,7 @@ is$2.isInsideTypeReference = (path) => path.isIdentifier() && path.parentPath?.i
|
|
|
115309
115349
|
|
|
115310
115350
|
const jessy = jessy$1;
|
|
115311
115351
|
const nessy = nessy$1;
|
|
115312
|
-
const {traverse: traverse$7, types: types$
|
|
115352
|
+
const {traverse: traverse$7, types: types$d} = bundle;
|
|
115313
115353
|
const {template: template$7} = parser$6;
|
|
115314
115354
|
|
|
115315
115355
|
const {replaceWith: replaceWith$3, extract} = operate;
|
|
@@ -115333,13 +115373,13 @@ const {
|
|
|
115333
115373
|
isStringLiteral: isStringLiteral$3,
|
|
115334
115374
|
isTemplateLiteral: isTemplateLiteral$1,
|
|
115335
115375
|
TemplateElement,
|
|
115336
|
-
} = types$
|
|
115376
|
+
} = types$d;
|
|
115337
115377
|
|
|
115338
115378
|
const {extractExpression: extractExpression$1} = template$7;
|
|
115339
115379
|
|
|
115340
115380
|
const {entries: entries$6} = Object;
|
|
115341
115381
|
const isNumber = (a) => typeof a === 'number';
|
|
115342
|
-
const isString$
|
|
115382
|
+
const isString$5 = (a) => typeof a === 'string';
|
|
115343
115383
|
|
|
115344
115384
|
const parseNode$1 = (a) => a.node || a;
|
|
115345
115385
|
const {stringify: stringify$3} = JSON;
|
|
@@ -115347,7 +115387,7 @@ const {stringify: stringify$3} = JSON;
|
|
|
115347
115387
|
const BODY_AND_CLASS_REG = /\.body\.0(\.key)?$/;
|
|
115348
115388
|
|
|
115349
115389
|
vars.getTemplateValues = (node, str) => {
|
|
115350
|
-
if (!isString$
|
|
115390
|
+
if (!isString$5(str))
|
|
115351
115391
|
throw Error(`☝️ Looks like argument 'template' of 'getTemplateValues(node, template)': is not a string, but '${stringify$3(str)}'`);
|
|
115352
115392
|
|
|
115353
115393
|
node = parseNode$1(node);
|
|
@@ -115486,7 +115526,7 @@ var log$4 = {exports: {}};
|
|
|
115486
115526
|
|
|
115487
115527
|
const debug$3 = browserExports('putout:compare');
|
|
115488
115528
|
|
|
115489
|
-
const {isArray: isArray$
|
|
115529
|
+
const {isArray: isArray$5} = Array;
|
|
115490
115530
|
const isObject$2 = (a) => a && typeof a === 'object';
|
|
115491
115531
|
|
|
115492
115532
|
log$4.exports = (a, b) => {
|
|
@@ -115501,7 +115541,7 @@ log$4.exports = (a, b) => {
|
|
|
115501
115541
|
|
|
115502
115542
|
log$4.exports._parseValue = parseValue;
|
|
115503
115543
|
function parseValue(a) {
|
|
115504
|
-
if (isArray$
|
|
115544
|
+
if (isArray$5(a) && a[0]) {
|
|
115505
115545
|
const [{
|
|
115506
115546
|
type,
|
|
115507
115547
|
name,
|
|
@@ -115526,14 +115566,14 @@ function parseValue(a) {
|
|
|
115526
115566
|
|
|
115527
115567
|
var logExports = log$4.exports;
|
|
115528
115568
|
|
|
115529
|
-
const {types: types$
|
|
115569
|
+
const {types: types$c} = bundle;
|
|
115530
115570
|
const {
|
|
115531
115571
|
isIdentifier: isIdentifier$1,
|
|
115532
115572
|
isLiteral,
|
|
115533
115573
|
isStringLiteral: isStringLiteral$2,
|
|
115534
115574
|
isTemplateElement: isTemplateElement$1,
|
|
115535
115575
|
isTSTypeReference,
|
|
115536
|
-
} = types$
|
|
115576
|
+
} = types$c;
|
|
115537
115577
|
|
|
115538
115578
|
const parseName = (node) => {
|
|
115539
115579
|
node = node[0] || node;
|
|
@@ -115602,13 +115642,13 @@ const {
|
|
|
115602
115642
|
isLinkedRegExp: isLinkedRegExp$1,
|
|
115603
115643
|
} = is$2;
|
|
115604
115644
|
|
|
115605
|
-
const {types: types$
|
|
115645
|
+
const {types: types$b} = bundle;
|
|
115606
115646
|
const {
|
|
115607
115647
|
isClassBody,
|
|
115608
115648
|
isBlock,
|
|
115609
115649
|
isJSXText,
|
|
115610
115650
|
isTemplateElement,
|
|
115611
|
-
} = types$
|
|
115651
|
+
} = types$b;
|
|
115612
115652
|
|
|
115613
115653
|
const isEmptyBlock = (a) => isBlock(a) && !a.body.length;
|
|
115614
115654
|
const isPrimitive = (a) => typeof a !== 'object' || a === null;
|
|
@@ -115717,7 +115757,7 @@ function compareJSXTexts(node, template) {
|
|
|
115717
115757
|
|
|
115718
115758
|
var topLevelComparators = {};
|
|
115719
115759
|
|
|
115720
|
-
const {types: types$
|
|
115760
|
+
const {types: types$a} = bundle;
|
|
115721
115761
|
const {
|
|
115722
115762
|
isEqualBody,
|
|
115723
115763
|
isEqualAnyObject,
|
|
@@ -115731,7 +115771,7 @@ const {
|
|
|
115731
115771
|
const {
|
|
115732
115772
|
isIdentifier,
|
|
115733
115773
|
isStringLiteral: isStringLiteral$1,
|
|
115734
|
-
} = types$
|
|
115774
|
+
} = types$a;
|
|
115735
115775
|
|
|
115736
115776
|
const comparators = [
|
|
115737
115777
|
isEqualAnyObject,
|
|
@@ -115789,13 +115829,13 @@ const {
|
|
|
115789
115829
|
const {extractExpression} = template$6;
|
|
115790
115830
|
|
|
115791
115831
|
const {keys: keys$2} = Object;
|
|
115792
|
-
const {isArray: isArray$
|
|
115793
|
-
const noop$
|
|
115794
|
-
const isEmptyArray = (a) => isArray$
|
|
115832
|
+
const {isArray: isArray$4} = Array;
|
|
115833
|
+
const noop$2 = () => {};
|
|
115834
|
+
const isEmptyArray = (a) => isArray$4(a) && !a.length;
|
|
115795
115835
|
|
|
115796
115836
|
const compareType = (type) => (path) => path.type === type;
|
|
115797
115837
|
const superPush = (array) => (a, b) => array.push([a, b]);
|
|
115798
|
-
const maybeArray$
|
|
115838
|
+
const maybeArray$3 = (a) => isArray$4(a) ? a : [a];
|
|
115799
115839
|
|
|
115800
115840
|
const findParent = (path, type) => {
|
|
115801
115841
|
const newPathNode = path.findParent(compareType(type));
|
|
@@ -115825,7 +115865,7 @@ compare$5.getValues = getValues$1;
|
|
|
115825
115865
|
compare$5.setValues = setValues$1;
|
|
115826
115866
|
compare$5.getTemplateValues = getTemplateValues$1;
|
|
115827
115867
|
|
|
115828
|
-
function compare$4(path, template, options = {}, equal = noop$
|
|
115868
|
+
function compare$4(path, template, options = {}, equal = noop$2) {
|
|
115829
115869
|
const {findUp = true} = options;
|
|
115830
115870
|
|
|
115831
115871
|
if (!path && !template)
|
|
@@ -115859,7 +115899,7 @@ function compare$4(path, template, options = {}, equal = noop$4) {
|
|
|
115859
115899
|
}
|
|
115860
115900
|
|
|
115861
115901
|
compare$5.compareAny = (path, templateNodes, options) => {
|
|
115862
|
-
templateNodes = maybeArray$
|
|
115902
|
+
templateNodes = maybeArray$3(templateNodes);
|
|
115863
115903
|
|
|
115864
115904
|
for (const template of templateNodes) {
|
|
115865
115905
|
if (compare$4(path, template, options))
|
|
@@ -115870,7 +115910,7 @@ compare$5.compareAny = (path, templateNodes, options) => {
|
|
|
115870
115910
|
};
|
|
115871
115911
|
|
|
115872
115912
|
compare$5.compareAll = (path, templateNodes, options) => {
|
|
115873
|
-
templateNodes = maybeArray$
|
|
115913
|
+
templateNodes = maybeArray$3(templateNodes);
|
|
115874
115914
|
|
|
115875
115915
|
for (const template of templateNodes) {
|
|
115876
115916
|
if (!compare$4(path, template, options))
|
|
@@ -115951,7 +115991,7 @@ function check$3(fn) {
|
|
|
115951
115991
|
}
|
|
115952
115992
|
|
|
115953
115993
|
const {entries: entries$5} = Object;
|
|
115954
|
-
const {isArray: isArray$
|
|
115994
|
+
const {isArray: isArray$3} = Array;
|
|
115955
115995
|
|
|
115956
115996
|
var findPath$1 = (parentPath) => {
|
|
115957
115997
|
let current = {
|
|
@@ -115970,7 +116010,7 @@ function findKey(path, parent) {
|
|
|
115970
116010
|
const {node} = path;
|
|
115971
116011
|
|
|
115972
116012
|
for (const [key, value] of entries$5(parent)) {
|
|
115973
|
-
if (isArray$
|
|
116013
|
+
if (isArray$3(value)) {
|
|
115974
116014
|
const index = value.indexOf(node);
|
|
115975
116015
|
|
|
115976
116016
|
if (index >= 0)
|
|
@@ -115986,14 +116026,14 @@ function findKey(path, parent) {
|
|
|
115986
116026
|
|
|
115987
116027
|
const wraptile = wraptile$1;
|
|
115988
116028
|
const findPath = findPath$1;
|
|
115989
|
-
const {types: types$
|
|
115990
|
-
const {isProgram: isProgram$
|
|
116029
|
+
const {types: types$9} = bundle;
|
|
116030
|
+
const {isProgram: isProgram$2} = types$9;
|
|
115991
116031
|
const name = '__putout_runner_replace';
|
|
115992
116032
|
const hasWatermark = (watermark) => (path) => path.node?.[name]?.has(watermark);
|
|
115993
116033
|
|
|
115994
116034
|
watermark$1.exports = (from, to, path) => {
|
|
115995
116035
|
const {watermark, highWatermark} = create(from, to, path);
|
|
115996
|
-
const program = path.findParent(isProgram$
|
|
116036
|
+
const program = path.findParent(isProgram$2) || path;
|
|
115997
116037
|
const options = {
|
|
115998
116038
|
watermark,
|
|
115999
116039
|
highWatermark,
|
|
@@ -116002,7 +116042,7 @@ watermark$1.exports = (from, to, path) => {
|
|
|
116002
116042
|
};
|
|
116003
116043
|
|
|
116004
116044
|
return {
|
|
116005
|
-
init: wraptile(init$
|
|
116045
|
+
init: wraptile(init$1, options),
|
|
116006
116046
|
has: wraptile(has, options),
|
|
116007
116047
|
add: wraptile(add, options),
|
|
116008
116048
|
};
|
|
@@ -116021,8 +116061,8 @@ function create(from, to, path) {
|
|
|
116021
116061
|
};
|
|
116022
116062
|
}
|
|
116023
116063
|
|
|
116024
|
-
watermark$1.exports.init = init$
|
|
116025
|
-
function init$
|
|
116064
|
+
watermark$1.exports.init = init$1;
|
|
116065
|
+
function init$1({path, program}) {
|
|
116026
116066
|
if (path.node)
|
|
116027
116067
|
path.node[name] = path.node[name] || new Set();
|
|
116028
116068
|
|
|
@@ -116031,7 +116071,7 @@ function init$3({path, program}) {
|
|
|
116031
116071
|
|
|
116032
116072
|
watermark$1.exports.add = add;
|
|
116033
116073
|
function add({path, program, watermark, highWatermark}) {
|
|
116034
|
-
init$
|
|
116074
|
+
init$1({
|
|
116035
116075
|
path,
|
|
116036
116076
|
program,
|
|
116037
116077
|
});
|
|
@@ -116052,7 +116092,7 @@ var watermarkExports = watermark$1.exports;
|
|
|
116052
116092
|
|
|
116053
116093
|
const {template: template$5, print: print$2} = parser$6;
|
|
116054
116094
|
const {remove, replaceWith: replaceWith$2} = operate;
|
|
116055
|
-
const {types: types$
|
|
116095
|
+
const {types: types$8} = bundle;
|
|
116056
116096
|
|
|
116057
116097
|
const {
|
|
116058
116098
|
compare: compare$3,
|
|
@@ -116062,14 +116102,14 @@ const {
|
|
|
116062
116102
|
} = compare$5;
|
|
116063
116103
|
|
|
116064
116104
|
const debug$2 = browserExports('putout:runner:replace');
|
|
116065
|
-
const maybeArray$
|
|
116105
|
+
const maybeArray$2 = maybeArray_1;
|
|
116066
116106
|
|
|
116067
116107
|
const watermark = watermarkExports;
|
|
116068
116108
|
const {
|
|
116069
116109
|
isExpression,
|
|
116070
116110
|
isStatement,
|
|
116071
116111
|
isExpressionStatement,
|
|
116072
|
-
} = types$
|
|
116112
|
+
} = types$8;
|
|
116073
116113
|
|
|
116074
116114
|
const PRINT_OPTIONS = {
|
|
116075
116115
|
printer: ['putout', {
|
|
@@ -116082,7 +116122,7 @@ const PRINT_OPTIONS = {
|
|
|
116082
116122
|
}],
|
|
116083
116123
|
};
|
|
116084
116124
|
|
|
116085
|
-
const isString$
|
|
116125
|
+
const isString$4 = (a) => typeof a === 'string';
|
|
116086
116126
|
|
|
116087
116127
|
const log$2 = (from, path) => {
|
|
116088
116128
|
debug$2.enabled && debug$2(`${from} -> ${path}\n`);
|
|
@@ -116119,7 +116159,7 @@ replace$1.exports = ({rule, plugin, msg, options}) => {
|
|
|
116119
116159
|
...options,
|
|
116120
116160
|
exclude: [
|
|
116121
116161
|
...exclude(),
|
|
116122
|
-
...maybeArray$
|
|
116162
|
+
...maybeArray$2(options.exclude),
|
|
116123
116163
|
],
|
|
116124
116164
|
},
|
|
116125
116165
|
plugin: {
|
|
@@ -116231,7 +116271,7 @@ function parseTo(to, values, path) {
|
|
|
116231
116271
|
return toStr;
|
|
116232
116272
|
}
|
|
116233
116273
|
|
|
116234
|
-
if (!isString$
|
|
116274
|
+
if (!isString$4(toStr))
|
|
116235
116275
|
throw Error(`☝️ Looks like you passed 'replace' value with a wrong type. Allowed: 'string', 'node' and 'path'. Received: '${typeof toStr}' with value '${toStr}'.`);
|
|
116236
116276
|
|
|
116237
116277
|
return template$5.ast.fresh(toStr);
|
|
@@ -116314,14 +116354,14 @@ const {
|
|
|
116314
116354
|
setModuleType,
|
|
116315
116355
|
} = record;
|
|
116316
116356
|
|
|
116317
|
-
const {types: types$
|
|
116357
|
+
const {types: types$7} = bundle;
|
|
116318
116358
|
const {
|
|
116319
116359
|
isImportDeclaration,
|
|
116320
116360
|
isVariableDeclaration,
|
|
116321
|
-
} = types$
|
|
116361
|
+
} = types$7;
|
|
116322
116362
|
|
|
116323
116363
|
const {keys} = Object;
|
|
116324
|
-
const isString$
|
|
116364
|
+
const isString$3 = (a) => typeof a === 'string';
|
|
116325
116365
|
|
|
116326
116366
|
const getLastVarPath = (bodyPath) => bodyPath.filter(isVariableDeclaration).pop();
|
|
116327
116367
|
const isLast = (insertionPath, bodyPath) => bodyPath.at(-1) === insertionPath;
|
|
@@ -116419,7 +116459,7 @@ function isUseStrict(path) {
|
|
|
116419
116459
|
}
|
|
116420
116460
|
|
|
116421
116461
|
const parseCode = (type, current) => {
|
|
116422
|
-
if (isString$
|
|
116462
|
+
if (isString$3(current))
|
|
116423
116463
|
return current;
|
|
116424
116464
|
|
|
116425
116465
|
return current[type];
|
|
@@ -116517,90 +116557,90 @@ function validateDeclare(declare) {
|
|
|
116517
116557
|
throw Error(`☝️ Looks like 'declare' property value is not a 'function', but '${typeof declare}' with value '${stringify$1(declare)}'.`);
|
|
116518
116558
|
}
|
|
116519
116559
|
|
|
116520
|
-
var filesystem
|
|
116560
|
+
var filesystem = {};
|
|
116521
116561
|
|
|
116522
|
-
var maybeFs
|
|
116562
|
+
var maybeFs = {};
|
|
116523
116563
|
|
|
116524
|
-
const fullstore$
|
|
116525
|
-
const driverStore
|
|
116564
|
+
const fullstore$1 = fullstore$3;
|
|
116565
|
+
const driverStore = fullstore$1();
|
|
116526
116566
|
|
|
116527
|
-
const {assign
|
|
116528
|
-
const noop$
|
|
116529
|
-
const returns
|
|
116567
|
+
const {assign} = Object;
|
|
116568
|
+
const noop$1 = () => {};
|
|
116569
|
+
const returns = (a) => () => a;
|
|
116530
116570
|
|
|
116531
|
-
const defaultFS
|
|
116532
|
-
renameFile: noop$
|
|
116533
|
-
removeFile: noop$
|
|
116534
|
-
createDirectory: noop$
|
|
116535
|
-
readFileContent: returns
|
|
116536
|
-
writeFileContent: noop$
|
|
116537
|
-
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,
|
|
116538
116578
|
};
|
|
116539
116579
|
|
|
116540
|
-
const maybeFS$
|
|
116580
|
+
const maybeFS$1 = assign({}, defaultFS);
|
|
116541
116581
|
|
|
116542
|
-
maybeFs
|
|
116543
|
-
maybeFS$
|
|
116582
|
+
maybeFs.renameFile = (oldName, newName) => {
|
|
116583
|
+
maybeFS$1.renameFile(oldName, newName);
|
|
116544
116584
|
};
|
|
116545
116585
|
|
|
116546
|
-
maybeFs
|
|
116547
|
-
maybeFS$
|
|
116586
|
+
maybeFs.removeFile = (name) => {
|
|
116587
|
+
maybeFS$1.removeFile(name);
|
|
116548
116588
|
};
|
|
116549
116589
|
|
|
116550
|
-
maybeFs
|
|
116551
|
-
maybeFS$
|
|
116590
|
+
maybeFs.copyFile = (from, to) => {
|
|
116591
|
+
maybeFS$1.copyFile(from, to);
|
|
116552
116592
|
};
|
|
116553
116593
|
|
|
116554
|
-
maybeFs
|
|
116555
|
-
maybeFS$
|
|
116594
|
+
maybeFs.createDirectory = (name) => {
|
|
116595
|
+
maybeFS$1.createDirectory(name);
|
|
116556
116596
|
};
|
|
116557
116597
|
|
|
116558
|
-
maybeFs
|
|
116559
|
-
return maybeFS$
|
|
116598
|
+
maybeFs.readFileContent = (name) => {
|
|
116599
|
+
return maybeFS$1.readFileContent(name);
|
|
116560
116600
|
};
|
|
116561
116601
|
|
|
116562
|
-
maybeFs
|
|
116563
|
-
maybeFS$
|
|
116602
|
+
maybeFs.writeFileContent = (name, content) => {
|
|
116603
|
+
maybeFS$1.writeFileContent(name, content);
|
|
116564
116604
|
};
|
|
116565
116605
|
|
|
116566
|
-
maybeFs
|
|
116606
|
+
maybeFs.init = init;
|
|
116567
116607
|
|
|
116568
|
-
function init
|
|
116569
|
-
assign
|
|
116608
|
+
function init(fsDriver) {
|
|
116609
|
+
assign(maybeFS$1, fsDriver);
|
|
116570
116610
|
}
|
|
116571
116611
|
|
|
116572
|
-
maybeFs
|
|
116573
|
-
driverStore
|
|
116574
|
-
deinit
|
|
116612
|
+
maybeFs.pause = () => {
|
|
116613
|
+
driverStore(maybeFS$1);
|
|
116614
|
+
deinit();
|
|
116575
116615
|
};
|
|
116576
116616
|
|
|
116577
|
-
maybeFs
|
|
116578
|
-
init
|
|
116617
|
+
maybeFs.start = () => {
|
|
116618
|
+
init(driverStore());
|
|
116579
116619
|
};
|
|
116580
116620
|
|
|
116581
|
-
maybeFs
|
|
116621
|
+
maybeFs.deinit = deinit;
|
|
116582
116622
|
|
|
116583
|
-
function deinit
|
|
116584
|
-
assign
|
|
116623
|
+
function deinit() {
|
|
116624
|
+
assign(maybeFS$1, defaultFS);
|
|
116585
116625
|
}
|
|
116586
116626
|
|
|
116587
|
-
const {join: join$
|
|
116588
|
-
const tryCatch$
|
|
116589
|
-
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;
|
|
116590
116630
|
|
|
116591
116631
|
const {
|
|
116592
|
-
setLiteralValue
|
|
116593
|
-
getProperty: getProperty$
|
|
116594
|
-
traverseProperties: traverseProperties$
|
|
116632
|
+
setLiteralValue,
|
|
116633
|
+
getProperty: getProperty$2,
|
|
116634
|
+
traverseProperties: traverseProperties$1,
|
|
116595
116635
|
} = operate;
|
|
116596
116636
|
|
|
116597
|
-
const maybeFS
|
|
116598
|
-
const isString$
|
|
116599
|
-
const {isArray: isArray$
|
|
116600
|
-
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];
|
|
116601
116641
|
|
|
116602
|
-
const toBase64
|
|
116603
|
-
const [e, result] = tryCatch$
|
|
116642
|
+
const toBase64 = (content) => {
|
|
116643
|
+
const [e, result] = tryCatch$2(btoa, content);
|
|
116604
116644
|
|
|
116605
116645
|
if (e)
|
|
116606
116646
|
return btoa(encodeURI(content));
|
|
@@ -116608,8 +116648,8 @@ const toBase64$2 = (content) => {
|
|
|
116608
116648
|
return result;
|
|
116609
116649
|
};
|
|
116610
116650
|
|
|
116611
|
-
const fromBase64
|
|
116612
|
-
const [e, decoded] = tryCatch$
|
|
116651
|
+
const fromBase64 = (content) => {
|
|
116652
|
+
const [e, decoded] = tryCatch$2(atob, content);
|
|
116613
116653
|
|
|
116614
116654
|
if (!e)
|
|
116615
116655
|
return decodeURI(decoded);
|
|
@@ -116618,14 +116658,14 @@ const fromBase64$2 = (content) => {
|
|
|
116618
116658
|
};
|
|
116619
116659
|
|
|
116620
116660
|
const {
|
|
116621
|
-
ObjectExpression: ObjectExpression$
|
|
116622
|
-
ArrayExpression: ArrayExpression$
|
|
116623
|
-
StringLiteral: StringLiteral$
|
|
116624
|
-
ObjectProperty: ObjectProperty$
|
|
116625
|
-
isProgram: isProgram$
|
|
116626
|
-
} = types$
|
|
116661
|
+
ObjectExpression: ObjectExpression$1,
|
|
116662
|
+
ArrayExpression: ArrayExpression$2,
|
|
116663
|
+
StringLiteral: StringLiteral$3,
|
|
116664
|
+
ObjectProperty: ObjectProperty$2,
|
|
116665
|
+
isProgram: isProgram$1,
|
|
116666
|
+
} = types$6;
|
|
116627
116667
|
|
|
116628
|
-
const getRegExp
|
|
116668
|
+
const getRegExp = (wildcard) => {
|
|
116629
116669
|
const escaped = wildcard
|
|
116630
116670
|
.replace(/\./g, '\\.')
|
|
116631
116671
|
.replace(/\*/g, '.*')
|
|
@@ -116634,29 +116674,29 @@ const getRegExp$2 = (wildcard) => {
|
|
|
116634
116674
|
return RegExp(`^${escaped}$`);
|
|
116635
116675
|
};
|
|
116636
116676
|
|
|
116637
|
-
filesystem
|
|
116677
|
+
filesystem.getParentDirectory = (filePath) => {
|
|
116638
116678
|
const {parentPath} = filePath.parentPath.parentPath;
|
|
116639
116679
|
|
|
116640
|
-
if (isProgram$
|
|
116680
|
+
if (isProgram$1(parentPath))
|
|
116641
116681
|
return null;
|
|
116642
116682
|
|
|
116643
116683
|
return parentPath;
|
|
116644
116684
|
};
|
|
116645
116685
|
|
|
116646
|
-
filesystem
|
|
116686
|
+
filesystem.findFile = findFile$5;
|
|
116647
116687
|
|
|
116648
|
-
function findFile$
|
|
116649
|
-
checkName
|
|
116688
|
+
function findFile$5(node, name) {
|
|
116689
|
+
checkName(name);
|
|
116650
116690
|
|
|
116651
116691
|
const filePaths = [];
|
|
116652
|
-
const names = maybeArray$
|
|
116692
|
+
const names = maybeArray$1(name);
|
|
116653
116693
|
|
|
116654
|
-
for (const filenamePath of traverseProperties$
|
|
116694
|
+
for (const filenamePath of traverseProperties$1(node, 'filename')) {
|
|
116655
116695
|
const {value} = filenamePath.node.value;
|
|
116656
|
-
const base = basename$
|
|
116696
|
+
const base = basename$1(value);
|
|
116657
116697
|
|
|
116658
116698
|
for (const name of names) {
|
|
116659
|
-
if (value === name || getRegExp
|
|
116699
|
+
if (value === name || getRegExp(name).test(base))
|
|
116660
116700
|
filePaths.push(filenamePath.parentPath);
|
|
116661
116701
|
}
|
|
116662
116702
|
}
|
|
@@ -116664,32 +116704,32 @@ function findFile$7(node, name) {
|
|
|
116664
116704
|
return filePaths;
|
|
116665
116705
|
}
|
|
116666
116706
|
|
|
116667
|
-
function checkName
|
|
116668
|
-
if (!isString$
|
|
116707
|
+
function checkName(name) {
|
|
116708
|
+
if (!isString$2(name) && !isArray$2(name))
|
|
116669
116709
|
throw Error(`☝️ Looks like you forget to pass the 'name' of a file to 'findFile(filePath: Path|FilePath, name: string | string[]): FilePath'`);
|
|
116670
116710
|
}
|
|
116671
116711
|
|
|
116672
|
-
function getFilenamePath
|
|
116673
|
-
const filenamePath = getProperty$
|
|
116712
|
+
function getFilenamePath(filePath) {
|
|
116713
|
+
const filenamePath = getProperty$2(filePath, 'filename');
|
|
116674
116714
|
return filenamePath.get('value');
|
|
116675
116715
|
}
|
|
116676
116716
|
|
|
116677
|
-
function getFilename$
|
|
116678
|
-
const {value} = getFilenamePath
|
|
116717
|
+
function getFilename$4(filePath) {
|
|
116718
|
+
const {value} = getFilenamePath(filePath).node;
|
|
116679
116719
|
return value;
|
|
116680
116720
|
}
|
|
116681
116721
|
|
|
116682
|
-
filesystem
|
|
116722
|
+
filesystem.getFileType = getFileType$2;
|
|
116683
116723
|
|
|
116684
|
-
function getFileType$
|
|
116685
|
-
const typePath = getProperty$
|
|
116724
|
+
function getFileType$2(filePath) {
|
|
116725
|
+
const typePath = getProperty$2(filePath, 'type');
|
|
116686
116726
|
return typePath.node.value.value;
|
|
116687
116727
|
}
|
|
116688
116728
|
|
|
116689
|
-
filesystem
|
|
116729
|
+
filesystem.getFileContent = getFileContent;
|
|
116690
116730
|
|
|
116691
|
-
function getFileContent
|
|
116692
|
-
const content = getProperty$
|
|
116731
|
+
function getFileContent(filePath) {
|
|
116732
|
+
const content = getProperty$2(filePath, 'content');
|
|
116693
116733
|
|
|
116694
116734
|
return [
|
|
116695
116735
|
Boolean(content),
|
|
@@ -116697,11 +116737,11 @@ function getFileContent$2(filePath) {
|
|
|
116697
116737
|
];
|
|
116698
116738
|
}
|
|
116699
116739
|
|
|
116700
|
-
filesystem
|
|
116740
|
+
filesystem.getFilename = getFilename$4;
|
|
116701
116741
|
|
|
116702
|
-
filesystem
|
|
116703
|
-
const oldName = getFilename$
|
|
116704
|
-
const valuePath = getFilenamePath
|
|
116742
|
+
filesystem.renameFile = (filePath, name) => {
|
|
116743
|
+
const oldName = getFilename$4(filePath);
|
|
116744
|
+
const valuePath = getFilenamePath(filePath);
|
|
116705
116745
|
const baseName = oldName
|
|
116706
116746
|
.split('/')
|
|
116707
116747
|
.pop();
|
|
@@ -116712,77 +116752,77 @@ filesystem$2.renameFile = (filePath, name) => {
|
|
|
116712
116752
|
|
|
116713
116753
|
const newFilename = oldName.replace(baseName, newName);
|
|
116714
116754
|
|
|
116715
|
-
setLiteralValue
|
|
116716
|
-
maybeFS
|
|
116755
|
+
setLiteralValue(valuePath, newFilename);
|
|
116756
|
+
maybeFS.renameFile(oldName, newFilename);
|
|
116717
116757
|
};
|
|
116718
116758
|
|
|
116719
|
-
filesystem
|
|
116720
|
-
const filename = getFilename$
|
|
116759
|
+
filesystem.removeFile = (filePath) => {
|
|
116760
|
+
const filename = getFilename$4(filePath);
|
|
116721
116761
|
|
|
116722
116762
|
filePath.remove();
|
|
116723
|
-
maybeFS
|
|
116763
|
+
maybeFS.removeFile(filename);
|
|
116724
116764
|
};
|
|
116725
116765
|
|
|
116726
|
-
filesystem
|
|
116766
|
+
filesystem.moveFile = (filePath, dirPath) => {
|
|
116727
116767
|
if (filePath === dirPath)
|
|
116728
116768
|
return;
|
|
116729
116769
|
|
|
116730
|
-
const dirname = getFilename$
|
|
116731
|
-
const filename = getFilename$
|
|
116732
|
-
const dirPathFiles = getProperty$
|
|
116733
|
-
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');
|
|
116734
116774
|
|
|
116735
116775
|
const basename = filename
|
|
116736
116776
|
.split('/')
|
|
116737
116777
|
.pop();
|
|
116738
116778
|
|
|
116739
|
-
const newFilename = join$
|
|
116779
|
+
const newFilename = join$2(dirname, basename);
|
|
116740
116780
|
|
|
116741
|
-
maybeRemoveFile
|
|
116781
|
+
maybeRemoveFile(dirPath, newFilename);
|
|
116742
116782
|
|
|
116743
|
-
setLiteralValue
|
|
116783
|
+
setLiteralValue(filenamePath.get('value'), newFilename);
|
|
116744
116784
|
dirPathFiles.node.value.elements.push(filePath.node);
|
|
116745
116785
|
|
|
116746
116786
|
filePath.remove();
|
|
116747
|
-
maybeFS
|
|
116787
|
+
maybeFS.renameFile(filename, newFilename);
|
|
116748
116788
|
};
|
|
116749
116789
|
|
|
116750
|
-
filesystem
|
|
116751
|
-
const dirname = getFilename$
|
|
116752
|
-
const filename = getFilename$
|
|
116790
|
+
filesystem.copyFile = (filePath, dirPath) => {
|
|
116791
|
+
const dirname = getFilename$4(dirPath);
|
|
116792
|
+
const filename = getFilename$4(filePath);
|
|
116753
116793
|
|
|
116754
116794
|
const basename = filename
|
|
116755
116795
|
.split('/')
|
|
116756
116796
|
.pop();
|
|
116757
116797
|
|
|
116758
|
-
const newFilename = join$
|
|
116759
|
-
const [hasContent, content] = getFileContent
|
|
116798
|
+
const newFilename = join$2(dirname, basename);
|
|
116799
|
+
const [hasContent, content] = getFileContent(filePath);
|
|
116760
116800
|
|
|
116761
|
-
const copiedFile = ObjectExpression$
|
|
116762
|
-
createTypeProperty
|
|
116763
|
-
createFilenameProperty
|
|
116764
|
-
hasContent && createContentProperty
|
|
116801
|
+
const copiedFile = ObjectExpression$1([
|
|
116802
|
+
createTypeProperty('file'),
|
|
116803
|
+
createFilenameProperty(newFilename),
|
|
116804
|
+
hasContent && createContentProperty(content),
|
|
116765
116805
|
].filter(Boolean));
|
|
116766
116806
|
|
|
116767
|
-
maybeRemoveFile
|
|
116807
|
+
maybeRemoveFile(dirPath, newFilename);
|
|
116768
116808
|
|
|
116769
|
-
const dirPathFiles = getFiles$
|
|
116809
|
+
const dirPathFiles = getFiles$1(dirPath);
|
|
116770
116810
|
dirPathFiles.node.value.elements.push(copiedFile);
|
|
116771
116811
|
|
|
116772
|
-
maybeFS
|
|
116812
|
+
maybeFS.copyFile(filename, newFilename);
|
|
116773
116813
|
};
|
|
116774
116814
|
|
|
116775
|
-
function maybeRemoveFile
|
|
116776
|
-
const type = getFileType$
|
|
116815
|
+
function maybeRemoveFile(dirPath, filename) {
|
|
116816
|
+
const type = getFileType$2(dirPath);
|
|
116777
116817
|
|
|
116778
116818
|
if (type !== 'directory') {
|
|
116779
|
-
const filename = getFilename$
|
|
116819
|
+
const filename = getFilename$4(dirPath);
|
|
116780
116820
|
throw Error(`☝️ Looks like '${filename}' is not a directory, but: '${type}'. Rename to '${filename}/'`);
|
|
116781
116821
|
}
|
|
116782
116822
|
|
|
116783
|
-
const dirPathFiles = getProperty$
|
|
116784
|
-
const name = join$
|
|
116785
|
-
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);
|
|
116786
116826
|
|
|
116787
116827
|
if (!fileToOverwrite)
|
|
116788
116828
|
return;
|
|
@@ -116790,542 +116830,149 @@ function maybeRemoveFile$2(dirPath, filename) {
|
|
|
116790
116830
|
fileToOverwrite.remove();
|
|
116791
116831
|
}
|
|
116792
116832
|
|
|
116793
|
-
const createTypeProperty
|
|
116833
|
+
const createTypeProperty = (type) => ObjectProperty$2(StringLiteral$3('type'), StringLiteral$3(type));
|
|
116794
116834
|
|
|
116795
|
-
filesystem
|
|
116835
|
+
filesystem.createTypeProperty = createTypeProperty;
|
|
116796
116836
|
|
|
116797
|
-
const createFilesProperty
|
|
116837
|
+
const createFilesProperty = (files) => ObjectProperty$2(StringLiteral$3('files'), ArrayExpression$2(files));
|
|
116798
116838
|
|
|
116799
|
-
filesystem
|
|
116839
|
+
filesystem.createFilesProperty = createFilesProperty;
|
|
116800
116840
|
|
|
116801
|
-
const createFilenameProperty
|
|
116841
|
+
const createFilenameProperty = (filename) => ObjectProperty$2(StringLiteral$3('filename'), StringLiteral$3(filename));
|
|
116802
116842
|
|
|
116803
|
-
filesystem
|
|
116843
|
+
filesystem.createFilenameProperty = createFilenameProperty;
|
|
116804
116844
|
|
|
116805
|
-
const createContentProperty
|
|
116845
|
+
const createContentProperty = (content) => ObjectProperty$2(StringLiteral$3('content'), StringLiteral$3(content));
|
|
116806
116846
|
|
|
116807
|
-
filesystem
|
|
116847
|
+
filesystem.createContentProperty = createContentProperty;
|
|
116808
116848
|
|
|
116809
|
-
filesystem
|
|
116810
|
-
maybeRemoveFile
|
|
116849
|
+
filesystem.createFile = (dirPath, name, content) => {
|
|
116850
|
+
maybeRemoveFile(dirPath, name);
|
|
116811
116851
|
|
|
116812
|
-
const dirPathFiles = getFiles$
|
|
116813
|
-
const parentFilename = getFilename$
|
|
116814
|
-
const filename = join$
|
|
116852
|
+
const dirPathFiles = getFiles$1(dirPath);
|
|
116853
|
+
const parentFilename = getFilename$4(dirPath);
|
|
116854
|
+
const filename = join$2(parentFilename, name);
|
|
116815
116855
|
|
|
116816
|
-
const typeProperty = createTypeProperty
|
|
116817
|
-
const filenameProperty = createFilenameProperty
|
|
116856
|
+
const typeProperty = createTypeProperty('file');
|
|
116857
|
+
const filenameProperty = createFilenameProperty(filename);
|
|
116818
116858
|
|
|
116819
116859
|
const properties = [
|
|
116820
116860
|
typeProperty,
|
|
116821
116861
|
filenameProperty,
|
|
116822
|
-
content && createContentProperty
|
|
116862
|
+
content && createContentProperty(content),
|
|
116823
116863
|
].filter(Boolean);
|
|
116824
116864
|
|
|
116825
|
-
dirPathFiles.node.value.elements.push(ObjectExpression$
|
|
116865
|
+
dirPathFiles.node.value.elements.push(ObjectExpression$1(properties));
|
|
116826
116866
|
|
|
116827
116867
|
const filePath = dirPathFiles
|
|
116828
116868
|
.get('value.elements')
|
|
116829
116869
|
.at(-1);
|
|
116830
116870
|
|
|
116831
|
-
if (isString$
|
|
116832
|
-
writeFileContent$
|
|
116871
|
+
if (isString$2(content))
|
|
116872
|
+
writeFileContent$1(filePath, content);
|
|
116833
116873
|
|
|
116834
116874
|
return filePath;
|
|
116835
116875
|
};
|
|
116836
116876
|
|
|
116837
|
-
function getFiles$
|
|
116838
|
-
return getProperty$
|
|
116877
|
+
function getFiles$1(dirPath) {
|
|
116878
|
+
return getProperty$2(dirPath, 'files');
|
|
116839
116879
|
}
|
|
116840
116880
|
|
|
116841
|
-
filesystem
|
|
116842
|
-
const dirPathFiles = getFiles$
|
|
116843
|
-
const parentFilename = getFilename$
|
|
116844
|
-
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);
|
|
116845
116885
|
|
|
116846
|
-
const typeProperty = createTypeProperty
|
|
116847
|
-
const filesProperty = createFilesProperty
|
|
116848
|
-
const filenameProperty = createFilenameProperty
|
|
116886
|
+
const typeProperty = createTypeProperty('directory');
|
|
116887
|
+
const filesProperty = createFilesProperty([]);
|
|
116888
|
+
const filenameProperty = createFilenameProperty(filename);
|
|
116849
116889
|
|
|
116850
|
-
dirPathFiles.node.value.elements.push(ObjectExpression$
|
|
116890
|
+
dirPathFiles.node.value.elements.push(ObjectExpression$1([
|
|
116851
116891
|
typeProperty,
|
|
116852
116892
|
filenameProperty,
|
|
116853
116893
|
filesProperty,
|
|
116854
116894
|
]));
|
|
116855
116895
|
|
|
116856
|
-
maybeFS
|
|
116896
|
+
maybeFS.createDirectory(filename);
|
|
116857
116897
|
|
|
116858
116898
|
return dirPathFiles
|
|
116859
116899
|
.get('value.elements')
|
|
116860
116900
|
.at(-1);
|
|
116861
116901
|
};
|
|
116862
116902
|
|
|
116863
|
-
filesystem
|
|
116864
|
-
const fileType = getFileType$
|
|
116903
|
+
filesystem.readFileContent = (filePath) => {
|
|
116904
|
+
const fileType = getFileType$2(filePath);
|
|
116865
116905
|
|
|
116866
116906
|
if (fileType === 'directory')
|
|
116867
116907
|
return '';
|
|
116868
116908
|
|
|
116869
|
-
const [hasContent, content] = getFileContent
|
|
116909
|
+
const [hasContent, content] = getFileContent(filePath);
|
|
116870
116910
|
|
|
116871
116911
|
if (hasContent)
|
|
116872
|
-
return fromBase64
|
|
116912
|
+
return fromBase64(content);
|
|
116873
116913
|
|
|
116874
|
-
const filename = getFilename$
|
|
116875
|
-
const fileContent = maybeFS
|
|
116914
|
+
const filename = getFilename$4(filePath);
|
|
116915
|
+
const fileContent = maybeFS.readFileContent(filename);
|
|
116876
116916
|
|
|
116877
|
-
const property = createContentProperty
|
|
116917
|
+
const property = createContentProperty(toBase64(fileContent));
|
|
116878
116918
|
|
|
116879
116919
|
filePath.node.properties.push(property);
|
|
116880
116920
|
|
|
116881
116921
|
return fileContent;
|
|
116882
116922
|
};
|
|
116883
116923
|
|
|
116884
|
-
filesystem
|
|
116924
|
+
filesystem.writeFileContent = writeFileContent$1;
|
|
116885
116925
|
|
|
116886
|
-
function writeFileContent$
|
|
116887
|
-
const fileType = getFileType$
|
|
116926
|
+
function writeFileContent$1(filePath, content) {
|
|
116927
|
+
const fileType = getFileType$2(filePath);
|
|
116888
116928
|
|
|
116889
116929
|
if (fileType === 'directory')
|
|
116890
116930
|
return;
|
|
116891
116931
|
|
|
116892
|
-
const filename = getFilename$
|
|
116932
|
+
const filename = getFilename$4(filePath);
|
|
116893
116933
|
|
|
116894
|
-
maybeFS
|
|
116934
|
+
maybeFS.writeFileContent(filename, content);
|
|
116895
116935
|
|
|
116896
|
-
const contentPath = getProperty$
|
|
116936
|
+
const contentPath = getProperty$2(filePath, 'content');
|
|
116897
116937
|
|
|
116898
116938
|
if (contentPath) {
|
|
116899
|
-
setLiteralValue
|
|
116939
|
+
setLiteralValue(contentPath.node.value, toBase64(content));
|
|
116900
116940
|
return;
|
|
116901
116941
|
}
|
|
116902
116942
|
|
|
116903
|
-
const property = createContentProperty
|
|
116943
|
+
const property = createContentProperty(toBase64(content));
|
|
116904
116944
|
filePath.node.properties.push(property);
|
|
116905
116945
|
}
|
|
116906
116946
|
|
|
116907
|
-
filesystem
|
|
116908
|
-
filesystem
|
|
116947
|
+
filesystem.init = maybeFS.init;
|
|
116948
|
+
filesystem.deinit = maybeFS.deinit;
|
|
116909
116949
|
|
|
116910
|
-
filesystem
|
|
116911
|
-
filesystem
|
|
116950
|
+
filesystem.pause = maybeFS.pause;
|
|
116951
|
+
filesystem.start = maybeFS.start;
|
|
116912
116952
|
|
|
116913
116953
|
var convertSimpleFilesystemToFilesystem = {};
|
|
116914
116954
|
|
|
116915
|
-
|
|
116916
|
-
|
|
116917
|
-
var maybeFs$1 = {};
|
|
116918
|
-
|
|
116919
|
-
const fullstore$2 = fullstore$5;
|
|
116920
|
-
const driverStore$1 = fullstore$2();
|
|
116921
|
-
|
|
116922
|
-
const {assign: assign$1} = Object;
|
|
116923
|
-
const noop$2 = () => {};
|
|
116924
|
-
const returns$1 = (a) => () => a;
|
|
116925
|
-
|
|
116926
|
-
const defaultFS$1 = {
|
|
116927
|
-
renameFile: noop$2,
|
|
116928
|
-
removeFile: noop$2,
|
|
116929
|
-
createDirectory: noop$2,
|
|
116930
|
-
readFileContent: returns$1(''),
|
|
116931
|
-
writeFileContent: noop$2,
|
|
116932
|
-
copyFile: noop$2,
|
|
116933
|
-
};
|
|
116934
|
-
|
|
116935
|
-
const maybeFS$3 = assign$1({}, defaultFS$1);
|
|
116936
|
-
|
|
116937
|
-
maybeFs$1.renameFile = (oldName, newName) => {
|
|
116938
|
-
maybeFS$3.renameFile(oldName, newName);
|
|
116939
|
-
};
|
|
116940
|
-
|
|
116941
|
-
maybeFs$1.removeFile = (name) => {
|
|
116942
|
-
maybeFS$3.removeFile(name);
|
|
116943
|
-
};
|
|
116944
|
-
|
|
116945
|
-
maybeFs$1.copyFile = (from, to) => {
|
|
116946
|
-
maybeFS$3.copyFile(from, to);
|
|
116947
|
-
};
|
|
116948
|
-
|
|
116949
|
-
maybeFs$1.createDirectory = (name) => {
|
|
116950
|
-
maybeFS$3.createDirectory(name);
|
|
116951
|
-
};
|
|
116952
|
-
|
|
116953
|
-
maybeFs$1.readFileContent = (name) => {
|
|
116954
|
-
return maybeFS$3.readFileContent(name);
|
|
116955
|
-
};
|
|
116956
|
-
|
|
116957
|
-
maybeFs$1.writeFileContent = (name, content) => {
|
|
116958
|
-
maybeFS$3.writeFileContent(name, content);
|
|
116959
|
-
};
|
|
116960
|
-
|
|
116961
|
-
maybeFs$1.init = init$1;
|
|
116962
|
-
|
|
116963
|
-
function init$1(fsDriver) {
|
|
116964
|
-
assign$1(maybeFS$3, fsDriver);
|
|
116965
|
-
}
|
|
116966
|
-
|
|
116967
|
-
maybeFs$1.pause = () => {
|
|
116968
|
-
driverStore$1(maybeFS$3);
|
|
116969
|
-
deinit$1();
|
|
116970
|
-
};
|
|
116971
|
-
|
|
116972
|
-
maybeFs$1.start = () => {
|
|
116973
|
-
init$1(driverStore$1());
|
|
116974
|
-
};
|
|
116975
|
-
|
|
116976
|
-
maybeFs$1.deinit = deinit$1;
|
|
116977
|
-
|
|
116978
|
-
function deinit$1() {
|
|
116979
|
-
assign$1(maybeFS$3, defaultFS$1);
|
|
116980
|
-
}
|
|
116981
|
-
|
|
116982
|
-
const {join: join$3, basename: basename$2} = require$$0$2;
|
|
116983
|
-
const tryCatch$3 = tryCatch$8;
|
|
116984
|
-
const {types: types$7} = bundle;
|
|
116985
|
-
|
|
116986
|
-
const {
|
|
116987
|
-
setLiteralValue: setLiteralValue$1,
|
|
116988
|
-
getProperty: getProperty$3,
|
|
116989
|
-
traverseProperties: traverseProperties$2,
|
|
116990
|
-
} = operate;
|
|
116991
|
-
|
|
116992
|
-
const maybeFS$2 = maybeFs$1;
|
|
116993
|
-
const isString$3 = (a) => typeof a === 'string';
|
|
116994
|
-
const {isArray: isArray$3} = Array;
|
|
116995
|
-
const maybeArray$2 = (a) => isArray$3(a) ? a : [a];
|
|
116996
|
-
|
|
116997
|
-
const toBase64$1 = (content) => {
|
|
116998
|
-
const [e, result] = tryCatch$3(btoa, content);
|
|
116999
|
-
|
|
117000
|
-
if (e)
|
|
117001
|
-
return btoa(encodeURI(content));
|
|
117002
|
-
|
|
117003
|
-
return result;
|
|
117004
|
-
};
|
|
117005
|
-
|
|
117006
|
-
const fromBase64$1 = (content) => {
|
|
117007
|
-
const [e, decoded] = tryCatch$3(atob, content);
|
|
117008
|
-
|
|
117009
|
-
if (!e)
|
|
117010
|
-
return decodeURI(decoded);
|
|
117011
|
-
|
|
117012
|
-
return content;
|
|
117013
|
-
};
|
|
117014
|
-
|
|
117015
|
-
const {
|
|
117016
|
-
ObjectExpression: ObjectExpression$2,
|
|
117017
|
-
ArrayExpression: ArrayExpression$3,
|
|
117018
|
-
StringLiteral: StringLiteral$4,
|
|
117019
|
-
ObjectProperty: ObjectProperty$3,
|
|
117020
|
-
isProgram: isProgram$2,
|
|
117021
|
-
} = types$7;
|
|
117022
|
-
|
|
117023
|
-
const getRegExp$1 = (wildcard) => {
|
|
117024
|
-
const escaped = wildcard
|
|
117025
|
-
.replace(/\./g, '\\.')
|
|
117026
|
-
.replace(/\*/g, '.*')
|
|
117027
|
-
.replace('?', '.?');
|
|
117028
|
-
|
|
117029
|
-
return RegExp(`^${escaped}$`);
|
|
117030
|
-
};
|
|
117031
|
-
|
|
117032
|
-
filesystem$1.getParentDirectory = (filePath) => {
|
|
117033
|
-
const {parentPath} = filePath.parentPath.parentPath;
|
|
117034
|
-
|
|
117035
|
-
if (isProgram$2(parentPath))
|
|
117036
|
-
return null;
|
|
117037
|
-
|
|
117038
|
-
return parentPath;
|
|
117039
|
-
};
|
|
117040
|
-
|
|
117041
|
-
filesystem$1.findFile = findFile$6;
|
|
117042
|
-
|
|
117043
|
-
function findFile$6(node, name) {
|
|
117044
|
-
checkName$1(name);
|
|
117045
|
-
|
|
117046
|
-
const filePaths = [];
|
|
117047
|
-
const names = maybeArray$2(name);
|
|
117048
|
-
|
|
117049
|
-
for (const filenamePath of traverseProperties$2(node, 'filename')) {
|
|
117050
|
-
const {value} = filenamePath.node.value;
|
|
117051
|
-
const base = basename$2(value);
|
|
117052
|
-
|
|
117053
|
-
for (const name of names) {
|
|
117054
|
-
if (value === name || getRegExp$1(name).test(base))
|
|
117055
|
-
filePaths.push(filenamePath.parentPath);
|
|
117056
|
-
}
|
|
117057
|
-
}
|
|
117058
|
-
|
|
117059
|
-
return filePaths;
|
|
117060
|
-
}
|
|
117061
|
-
|
|
117062
|
-
function checkName$1(name) {
|
|
117063
|
-
if (!isString$3(name) && !isArray$3(name))
|
|
117064
|
-
throw Error(`☝️ Looks like you forget to pass the 'name' of a file to 'findFile(filePath: Path|FilePath, name: string | string[]): FilePath'`);
|
|
117065
|
-
}
|
|
117066
|
-
|
|
117067
|
-
function getFilenamePath$1(filePath) {
|
|
117068
|
-
const filenamePath = getProperty$3(filePath, 'filename');
|
|
117069
|
-
return filenamePath.get('value');
|
|
117070
|
-
}
|
|
117071
|
-
|
|
117072
|
-
function getFilename$5(filePath) {
|
|
117073
|
-
const {value} = getFilenamePath$1(filePath).node;
|
|
117074
|
-
return value;
|
|
117075
|
-
}
|
|
117076
|
-
|
|
117077
|
-
filesystem$1.getFileType = getFileType$3;
|
|
117078
|
-
|
|
117079
|
-
function getFileType$3(filePath) {
|
|
117080
|
-
const typePath = getProperty$3(filePath, 'type');
|
|
117081
|
-
return typePath.node.value.value;
|
|
117082
|
-
}
|
|
117083
|
-
|
|
117084
|
-
filesystem$1.getFileContent = getFileContent$1;
|
|
117085
|
-
|
|
117086
|
-
function getFileContent$1(filePath) {
|
|
117087
|
-
const content = getProperty$3(filePath, 'content');
|
|
117088
|
-
|
|
117089
|
-
return [
|
|
117090
|
-
Boolean(content),
|
|
117091
|
-
content?.node.value.value,
|
|
117092
|
-
];
|
|
117093
|
-
}
|
|
117094
|
-
|
|
117095
|
-
filesystem$1.getFilename = getFilename$5;
|
|
117096
|
-
|
|
117097
|
-
filesystem$1.renameFile = (filePath, name) => {
|
|
117098
|
-
const oldName = getFilename$5(filePath);
|
|
117099
|
-
const valuePath = getFilenamePath$1(filePath);
|
|
117100
|
-
const baseName = oldName
|
|
117101
|
-
.split('/')
|
|
117102
|
-
.pop();
|
|
117103
|
-
|
|
117104
|
-
const newName = name
|
|
117105
|
-
.split('/')
|
|
117106
|
-
.pop();
|
|
117107
|
-
|
|
117108
|
-
const newFilename = oldName.replace(baseName, newName);
|
|
117109
|
-
|
|
117110
|
-
setLiteralValue$1(valuePath, newFilename);
|
|
117111
|
-
maybeFS$2.renameFile(oldName, newFilename);
|
|
117112
|
-
};
|
|
117113
|
-
|
|
117114
|
-
filesystem$1.removeFile = (filePath) => {
|
|
117115
|
-
const filename = getFilename$5(filePath);
|
|
117116
|
-
|
|
117117
|
-
filePath.remove();
|
|
117118
|
-
maybeFS$2.removeFile(filename);
|
|
117119
|
-
};
|
|
117120
|
-
|
|
117121
|
-
filesystem$1.moveFile = (filePath, dirPath) => {
|
|
117122
|
-
if (filePath === dirPath)
|
|
117123
|
-
return;
|
|
117124
|
-
|
|
117125
|
-
const dirname = getFilename$5(dirPath);
|
|
117126
|
-
const filename = getFilename$5(filePath);
|
|
117127
|
-
const dirPathFiles = getProperty$3(dirPath, 'files');
|
|
117128
|
-
const filenamePath = getProperty$3(filePath, 'filename');
|
|
117129
|
-
|
|
117130
|
-
const basename = filename
|
|
117131
|
-
.split('/')
|
|
117132
|
-
.pop();
|
|
117133
|
-
|
|
117134
|
-
const newFilename = join$3(dirname, basename);
|
|
117135
|
-
|
|
117136
|
-
maybeRemoveFile$1(dirPath, newFilename);
|
|
117137
|
-
|
|
117138
|
-
setLiteralValue$1(filenamePath.get('value'), newFilename);
|
|
117139
|
-
dirPathFiles.node.value.elements.push(filePath.node);
|
|
117140
|
-
|
|
117141
|
-
filePath.remove();
|
|
117142
|
-
maybeFS$2.renameFile(filename, newFilename);
|
|
117143
|
-
};
|
|
117144
|
-
|
|
117145
|
-
filesystem$1.copyFile = (filePath, dirPath) => {
|
|
117146
|
-
const dirname = getFilename$5(dirPath);
|
|
117147
|
-
const filename = getFilename$5(filePath);
|
|
117148
|
-
|
|
117149
|
-
const basename = filename
|
|
117150
|
-
.split('/')
|
|
117151
|
-
.pop();
|
|
117152
|
-
|
|
117153
|
-
const newFilename = join$3(dirname, basename);
|
|
117154
|
-
const [hasContent, content] = getFileContent$1(filePath);
|
|
117155
|
-
|
|
117156
|
-
const copiedFile = ObjectExpression$2([
|
|
117157
|
-
createTypeProperty$1('file'),
|
|
117158
|
-
createFilenameProperty$1(newFilename),
|
|
117159
|
-
hasContent && createContentProperty$1(content),
|
|
117160
|
-
].filter(Boolean));
|
|
117161
|
-
|
|
117162
|
-
maybeRemoveFile$1(dirPath, newFilename);
|
|
117163
|
-
|
|
117164
|
-
const dirPathFiles = getFiles$2(dirPath);
|
|
117165
|
-
dirPathFiles.node.value.elements.push(copiedFile);
|
|
117166
|
-
|
|
117167
|
-
maybeFS$2.copyFile(filename, newFilename);
|
|
117168
|
-
};
|
|
117169
|
-
|
|
117170
|
-
function maybeRemoveFile$1(dirPath, filename) {
|
|
117171
|
-
const type = getFileType$3(dirPath);
|
|
117172
|
-
|
|
117173
|
-
if (type !== 'directory') {
|
|
117174
|
-
const filename = getFilename$5(dirPath);
|
|
117175
|
-
throw Error(`☝️ Looks like '${filename}' is not a directory, but: '${type}'. Rename to '${filename}/'`);
|
|
117176
|
-
}
|
|
117177
|
-
|
|
117178
|
-
const dirPathFiles = getProperty$3(dirPath, 'files');
|
|
117179
|
-
const name = join$3(getFilename$5(dirPath), basename$2(filename));
|
|
117180
|
-
const [fileToOverwrite] = findFile$6(dirPathFiles, name);
|
|
117181
|
-
|
|
117182
|
-
if (!fileToOverwrite)
|
|
117183
|
-
return;
|
|
117184
|
-
|
|
117185
|
-
fileToOverwrite.remove();
|
|
117186
|
-
}
|
|
117187
|
-
|
|
117188
|
-
const createTypeProperty$1 = (type) => ObjectProperty$3(StringLiteral$4('type'), StringLiteral$4(type));
|
|
117189
|
-
|
|
117190
|
-
filesystem$1.createTypeProperty = createTypeProperty$1;
|
|
117191
|
-
|
|
117192
|
-
const createFilesProperty$1 = (files) => ObjectProperty$3(StringLiteral$4('files'), ArrayExpression$3(files));
|
|
117193
|
-
|
|
117194
|
-
filesystem$1.createFilesProperty = createFilesProperty$1;
|
|
117195
|
-
|
|
117196
|
-
const createFilenameProperty$1 = (filename) => ObjectProperty$3(StringLiteral$4('filename'), StringLiteral$4(filename));
|
|
117197
|
-
|
|
117198
|
-
filesystem$1.createFilenameProperty = createFilenameProperty$1;
|
|
117199
|
-
|
|
117200
|
-
const createContentProperty$1 = (content) => ObjectProperty$3(StringLiteral$4('content'), StringLiteral$4(content));
|
|
117201
|
-
|
|
117202
|
-
filesystem$1.createContentProperty = createContentProperty$1;
|
|
117203
|
-
|
|
117204
|
-
filesystem$1.createFile = (dirPath, name, content) => {
|
|
117205
|
-
maybeRemoveFile$1(dirPath, name);
|
|
117206
|
-
|
|
117207
|
-
const dirPathFiles = getFiles$2(dirPath);
|
|
117208
|
-
const parentFilename = getFilename$5(dirPath);
|
|
117209
|
-
const filename = join$3(parentFilename, name);
|
|
117210
|
-
|
|
117211
|
-
const typeProperty = createTypeProperty$1('file');
|
|
117212
|
-
const filenameProperty = createFilenameProperty$1(filename);
|
|
117213
|
-
|
|
117214
|
-
const properties = [
|
|
117215
|
-
typeProperty,
|
|
117216
|
-
filenameProperty,
|
|
117217
|
-
content && createContentProperty$1(content),
|
|
117218
|
-
].filter(Boolean);
|
|
117219
|
-
|
|
117220
|
-
dirPathFiles.node.value.elements.push(ObjectExpression$2(properties));
|
|
117221
|
-
|
|
117222
|
-
const filePath = dirPathFiles
|
|
117223
|
-
.get('value.elements')
|
|
117224
|
-
.at(-1);
|
|
117225
|
-
|
|
117226
|
-
if (isString$3(content))
|
|
117227
|
-
writeFileContent$2(filePath, content);
|
|
117228
|
-
|
|
117229
|
-
return filePath;
|
|
117230
|
-
};
|
|
117231
|
-
|
|
117232
|
-
function getFiles$2(dirPath) {
|
|
117233
|
-
return getProperty$3(dirPath, 'files');
|
|
117234
|
-
}
|
|
117235
|
-
|
|
117236
|
-
filesystem$1.createDirectory = (dirPath, name) => {
|
|
117237
|
-
const dirPathFiles = getFiles$2(dirPath);
|
|
117238
|
-
const parentFilename = getFilename$5(dirPath);
|
|
117239
|
-
const filename = join$3(parentFilename, name);
|
|
117240
|
-
|
|
117241
|
-
const typeProperty = createTypeProperty$1('directory');
|
|
117242
|
-
const filesProperty = createFilesProperty$1([]);
|
|
117243
|
-
const filenameProperty = createFilenameProperty$1(filename);
|
|
117244
|
-
|
|
117245
|
-
dirPathFiles.node.value.elements.push(ObjectExpression$2([
|
|
117246
|
-
typeProperty,
|
|
117247
|
-
filenameProperty,
|
|
117248
|
-
filesProperty,
|
|
117249
|
-
]));
|
|
117250
|
-
|
|
117251
|
-
maybeFS$2.createDirectory(filename);
|
|
117252
|
-
|
|
117253
|
-
return dirPathFiles
|
|
117254
|
-
.get('value.elements')
|
|
117255
|
-
.at(-1);
|
|
117256
|
-
};
|
|
117257
|
-
|
|
117258
|
-
filesystem$1.readFileContent = (filePath) => {
|
|
117259
|
-
const fileType = getFileType$3(filePath);
|
|
117260
|
-
|
|
117261
|
-
if (fileType === 'directory')
|
|
117262
|
-
return '';
|
|
117263
|
-
|
|
117264
|
-
const [hasContent, content] = getFileContent$1(filePath);
|
|
117265
|
-
|
|
117266
|
-
if (hasContent)
|
|
117267
|
-
return fromBase64$1(content);
|
|
117268
|
-
|
|
117269
|
-
const filename = getFilename$5(filePath);
|
|
117270
|
-
const fileContent = maybeFS$2.readFileContent(filename);
|
|
117271
|
-
|
|
117272
|
-
const property = createContentProperty$1(toBase64$1(fileContent));
|
|
117273
|
-
|
|
117274
|
-
filePath.node.properties.push(property);
|
|
117275
|
-
|
|
117276
|
-
return fileContent;
|
|
117277
|
-
};
|
|
117278
|
-
|
|
117279
|
-
filesystem$1.writeFileContent = writeFileContent$2;
|
|
117280
|
-
|
|
117281
|
-
function writeFileContent$2(filePath, content) {
|
|
117282
|
-
const fileType = getFileType$3(filePath);
|
|
117283
|
-
|
|
117284
|
-
if (fileType === 'directory')
|
|
117285
|
-
return;
|
|
117286
|
-
|
|
117287
|
-
const filename = getFilename$5(filePath);
|
|
117288
|
-
|
|
117289
|
-
maybeFS$2.writeFileContent(filename, content);
|
|
117290
|
-
|
|
117291
|
-
const contentPath = getProperty$3(filePath, 'content');
|
|
117292
|
-
|
|
117293
|
-
if (contentPath) {
|
|
117294
|
-
setLiteralValue$1(contentPath.node.value, toBase64$1(content));
|
|
117295
|
-
return;
|
|
117296
|
-
}
|
|
117297
|
-
|
|
117298
|
-
const property = createContentProperty$1(toBase64$1(content));
|
|
117299
|
-
filePath.node.properties.push(property);
|
|
117300
|
-
}
|
|
117301
|
-
|
|
117302
|
-
filesystem$1.init = maybeFS$2.init;
|
|
117303
|
-
filesystem$1.deinit = maybeFS$2.deinit;
|
|
117304
|
-
|
|
117305
|
-
filesystem$1.pause = maybeFS$2.pause;
|
|
117306
|
-
filesystem$1.start = maybeFS$2.start;
|
|
117307
|
-
|
|
117308
|
-
const {types: types$6} = bundle;
|
|
117309
|
-
const {basename: basename$1, dirname} = require$$0$2;
|
|
116955
|
+
const {types: types$5} = bundle;
|
|
116956
|
+
const {basename, dirname} = require$$0$2;
|
|
117310
116957
|
const {
|
|
117311
116958
|
createDirectory,
|
|
117312
|
-
getFileType: getFileType$
|
|
117313
|
-
getFilename: getFilename$
|
|
117314
|
-
findFile: findFile$
|
|
117315
|
-
} = filesystem
|
|
116959
|
+
getFileType: getFileType$1,
|
|
116960
|
+
getFilename: getFilename$3,
|
|
116961
|
+
findFile: findFile$4,
|
|
116962
|
+
} = filesystem;
|
|
117316
116963
|
|
|
117317
116964
|
const {__filesystem_name: __filesystem_name$2} = json;
|
|
117318
|
-
const {replaceWith: replaceWith$1, getProperty: getProperty$
|
|
116965
|
+
const {replaceWith: replaceWith$1, getProperty: getProperty$1} = operate;
|
|
117319
116966
|
|
|
117320
116967
|
const {
|
|
117321
|
-
ObjectExpression
|
|
117322
|
-
ArrayExpression: ArrayExpression$
|
|
117323
|
-
StringLiteral: StringLiteral$
|
|
117324
|
-
ObjectProperty: ObjectProperty$
|
|
116968
|
+
ObjectExpression,
|
|
116969
|
+
ArrayExpression: ArrayExpression$1,
|
|
116970
|
+
StringLiteral: StringLiteral$2,
|
|
116971
|
+
ObjectProperty: ObjectProperty$1,
|
|
117325
116972
|
isArrayExpression,
|
|
117326
116973
|
isStringLiteral,
|
|
117327
116974
|
isTemplateLiteral,
|
|
117328
|
-
} = types$
|
|
116975
|
+
} = types$5;
|
|
117329
116976
|
|
|
117330
116977
|
convertSimpleFilesystemToFilesystem.report = () => `Convert Simple Filesystem to Filesystem`;
|
|
117331
116978
|
|
|
@@ -117333,22 +116980,22 @@ const isDirectory = (a) => a.endsWith('/');
|
|
|
117333
116980
|
const getType = (a) => {
|
|
117334
116981
|
const type = isDirectory(a) ? 'directory' : 'file';
|
|
117335
116982
|
|
|
117336
|
-
return ObjectProperty$
|
|
116983
|
+
return ObjectProperty$1(StringLiteral$2('type'), StringLiteral$2(type));
|
|
117337
116984
|
};
|
|
117338
116985
|
|
|
117339
116986
|
const createFilename = (filename) => {
|
|
117340
|
-
return ObjectProperty$
|
|
116987
|
+
return ObjectProperty$1(StringLiteral$2('filename'), StringLiteral$2(filename));
|
|
117341
116988
|
};
|
|
117342
116989
|
|
|
117343
|
-
const getFiles
|
|
116990
|
+
const getFiles = (a) => {
|
|
117344
116991
|
if (isDirectory(a))
|
|
117345
|
-
return ObjectProperty$
|
|
116992
|
+
return ObjectProperty$1(StringLiteral$2('files'), ArrayExpression$1([]));
|
|
117346
116993
|
|
|
117347
116994
|
return null;
|
|
117348
116995
|
};
|
|
117349
116996
|
|
|
117350
116997
|
const getContent = (a) => {
|
|
117351
|
-
return ObjectProperty$
|
|
116998
|
+
return ObjectProperty$1(StringLiteral$2('content'), StringLiteral$2(a));
|
|
117352
116999
|
};
|
|
117353
117000
|
|
|
117354
117001
|
function parseContent(node, path) {
|
|
@@ -117362,7 +117009,7 @@ function parseContent(node, path) {
|
|
|
117362
117009
|
}
|
|
117363
117010
|
|
|
117364
117011
|
convertSimpleFilesystemToFilesystem.fix = (path) => {
|
|
117365
|
-
const array = ArrayExpression$
|
|
117012
|
+
const array = ArrayExpression$1([]);
|
|
117366
117013
|
|
|
117367
117014
|
for (const element of path.get('elements')) {
|
|
117368
117015
|
if (isArrayExpression(element)) {
|
|
@@ -117371,7 +117018,7 @@ convertSimpleFilesystemToFilesystem.fix = (path) => {
|
|
|
117371
117018
|
|
|
117372
117019
|
const content = parseContent(nodeContent, element);
|
|
117373
117020
|
|
|
117374
|
-
array.elements.push(ObjectExpression
|
|
117021
|
+
array.elements.push(ObjectExpression([
|
|
117375
117022
|
getType(value),
|
|
117376
117023
|
createFilename(value),
|
|
117377
117024
|
getContent(content),
|
|
@@ -117382,10 +117029,10 @@ convertSimpleFilesystemToFilesystem.fix = (path) => {
|
|
|
117382
117029
|
if (isStringLiteral(element)) {
|
|
117383
117030
|
const {value} = element.node;
|
|
117384
117031
|
|
|
117385
|
-
array.elements.push(ObjectExpression
|
|
117032
|
+
array.elements.push(ObjectExpression([
|
|
117386
117033
|
getType(value),
|
|
117387
117034
|
createFilename(noTrailingSlash(value)),
|
|
117388
|
-
getFiles
|
|
117035
|
+
getFiles(value),
|
|
117389
117036
|
].filter(Boolean)));
|
|
117390
117037
|
continue;
|
|
117391
117038
|
}
|
|
@@ -117411,19 +117058,19 @@ const noTrailingSlash = (a) => {
|
|
|
117411
117058
|
};
|
|
117412
117059
|
|
|
117413
117060
|
function buildTree(path, list) {
|
|
117414
|
-
const [root, ...files] = findFile$
|
|
117061
|
+
const [root, ...files] = findFile$4(list, '*');
|
|
117415
117062
|
|
|
117416
117063
|
for (const filePath of files) {
|
|
117417
|
-
const filename = getFilename$
|
|
117064
|
+
const filename = getFilename$3(filePath);
|
|
117418
117065
|
|
|
117419
117066
|
check$2(filename);
|
|
117420
117067
|
|
|
117421
|
-
const type = getFileType$
|
|
117068
|
+
const type = getFileType$1(filePath);
|
|
117422
117069
|
const dir = dirname(filename);
|
|
117423
|
-
const name = basename
|
|
117424
|
-
const [dirPath] = findFile$
|
|
117070
|
+
const name = basename(filename);
|
|
117071
|
+
const [dirPath] = findFile$4(root, dir);
|
|
117425
117072
|
|
|
117426
|
-
if (!dirPath || getFileType$
|
|
117073
|
+
if (!dirPath || getFileType$1(dirPath) !== 'directory')
|
|
117427
117074
|
throw Error(`☝️ Looks like directory '${dir}/' is missing`);
|
|
117428
117075
|
|
|
117429
117076
|
if (type === 'directory') {
|
|
@@ -117431,7 +117078,7 @@ function buildTree(path, list) {
|
|
|
117431
117078
|
continue;
|
|
117432
117079
|
}
|
|
117433
117080
|
|
|
117434
|
-
const filesProperty = getProperty$
|
|
117081
|
+
const filesProperty = getProperty$1(dirPath, 'files');
|
|
117435
117082
|
filesProperty.node.value.elements.push(filePath.node);
|
|
117436
117083
|
}
|
|
117437
117084
|
|
|
@@ -117445,22 +117092,22 @@ function check$2(filename) {
|
|
|
117445
117092
|
|
|
117446
117093
|
var convertFilesystemToSimpleFilesystem = {};
|
|
117447
117094
|
|
|
117448
|
-
const {types: types$
|
|
117449
|
-
const {replaceWith, getProperty
|
|
117095
|
+
const {types: types$4} = bundle;
|
|
117096
|
+
const {replaceWith, getProperty} = operate;
|
|
117450
117097
|
const {__filesystem_name: __filesystem_name$1} = json;
|
|
117451
117098
|
|
|
117452
117099
|
const {
|
|
117453
|
-
findFile: findFile$
|
|
117454
|
-
getFilename: getFilename$
|
|
117455
|
-
getFileType
|
|
117456
|
-
} = filesystem
|
|
117100
|
+
findFile: findFile$3,
|
|
117101
|
+
getFilename: getFilename$2,
|
|
117102
|
+
getFileType,
|
|
117103
|
+
} = filesystem;
|
|
117457
117104
|
|
|
117458
117105
|
const {
|
|
117459
|
-
StringLiteral: StringLiteral$
|
|
117460
|
-
ArrayExpression
|
|
117461
|
-
} = types$
|
|
117106
|
+
StringLiteral: StringLiteral$1,
|
|
117107
|
+
ArrayExpression,
|
|
117108
|
+
} = types$4;
|
|
117462
117109
|
|
|
117463
|
-
const {isArray: isArray$
|
|
117110
|
+
const {isArray: isArray$1} = Array;
|
|
117464
117111
|
const maybeAddSlash = (a) => a === '/' ? a : `${a}/`;
|
|
117465
117112
|
|
|
117466
117113
|
convertFilesystemToSimpleFilesystem.report = () => `Convert Filesystem to Simple Filesystem`;
|
|
@@ -117469,9 +117116,9 @@ convertFilesystemToSimpleFilesystem.fix = (root, {files}) => {
|
|
|
117469
117116
|
const names = [];
|
|
117470
117117
|
|
|
117471
117118
|
for (const file of files) {
|
|
117472
|
-
const filename = getFilename$
|
|
117473
|
-
const type = getFileType
|
|
117474
|
-
const contentPath = getProperty
|
|
117119
|
+
const filename = getFilename$2(file);
|
|
117120
|
+
const type = getFileType(file);
|
|
117121
|
+
const contentPath = getProperty(file, 'content');
|
|
117475
117122
|
const content = contentPath?.node?.value;
|
|
117476
117123
|
|
|
117477
117124
|
if (content) {
|
|
@@ -117490,24 +117137,24 @@ convertFilesystemToSimpleFilesystem.fix = (root, {files}) => {
|
|
|
117490
117137
|
const list = [];
|
|
117491
117138
|
|
|
117492
117139
|
for (const name of names) {
|
|
117493
|
-
if (isArray$
|
|
117494
|
-
list.push(ArrayExpression
|
|
117495
|
-
StringLiteral$
|
|
117496
|
-
StringLiteral$
|
|
117140
|
+
if (isArray$1(name)) {
|
|
117141
|
+
list.push(ArrayExpression([
|
|
117142
|
+
StringLiteral$1(name[0]),
|
|
117143
|
+
StringLiteral$1(name[1]),
|
|
117497
117144
|
]));
|
|
117498
117145
|
continue;
|
|
117499
117146
|
}
|
|
117500
117147
|
|
|
117501
|
-
list.push(StringLiteral$
|
|
117148
|
+
list.push(StringLiteral$1(name));
|
|
117502
117149
|
}
|
|
117503
117150
|
|
|
117504
|
-
replaceWith(root, ArrayExpression
|
|
117151
|
+
replaceWith(root, ArrayExpression(list));
|
|
117505
117152
|
};
|
|
117506
117153
|
|
|
117507
117154
|
convertFilesystemToSimpleFilesystem.traverse = ({push}) => ({
|
|
117508
117155
|
[`${__filesystem_name$1}(__object)`]: (path) => {
|
|
117509
117156
|
const root = path.get('arguments.0');
|
|
117510
|
-
const files = findFile$
|
|
117157
|
+
const files = findFile$3(root, '*');
|
|
117511
117158
|
|
|
117512
117159
|
push(root, {
|
|
117513
117160
|
files,
|
|
@@ -117515,15 +117162,15 @@ convertFilesystemToSimpleFilesystem.traverse = ({push}) => ({
|
|
|
117515
117162
|
},
|
|
117516
117163
|
});
|
|
117517
117164
|
|
|
117518
|
-
const fullstore
|
|
117165
|
+
const fullstore = fullstore$3;
|
|
117519
117166
|
const {compare: compare$1} = compare$5;
|
|
117520
117167
|
const {__filesystem_name} = json;
|
|
117521
117168
|
|
|
117522
117169
|
const {
|
|
117523
|
-
findFile: findFile$
|
|
117170
|
+
findFile: findFile$2,
|
|
117524
117171
|
pause,
|
|
117525
117172
|
start,
|
|
117526
|
-
} = filesystem
|
|
117173
|
+
} = filesystem;
|
|
117527
117174
|
|
|
117528
117175
|
const log$1 = browserExports('putout:runner:scanner');
|
|
117529
117176
|
|
|
@@ -117575,7 +117222,7 @@ const createFileProgress = ({rule, progress}) => ({i, n}) => {
|
|
|
117575
117222
|
};
|
|
117576
117223
|
|
|
117577
117224
|
const createTrackFile = (fileProgress) => function*(...a) {
|
|
117578
|
-
const files = findFile$
|
|
117225
|
+
const files = findFile$2(...a);
|
|
117579
117226
|
const n = files.length;
|
|
117580
117227
|
|
|
117581
117228
|
for (const [i, file] of files.entries()) {
|
|
@@ -117593,7 +117240,7 @@ const getTraverse = ({scan, rule, progress}) => ({push, options}) => ({
|
|
|
117593
117240
|
progress.start(rule);
|
|
117594
117241
|
|
|
117595
117242
|
const rootPath = path.get('arguments.0');
|
|
117596
|
-
const isSimple = fullstore
|
|
117243
|
+
const isSimple = fullstore(false);
|
|
117597
117244
|
|
|
117598
117245
|
const fileProgress = createFileProgress({
|
|
117599
117246
|
rule,
|
|
@@ -117677,7 +117324,7 @@ function parseVisitor(visitors) {
|
|
|
117677
117324
|
|
|
117678
117325
|
var template$3 = {exports: {}};
|
|
117679
117326
|
|
|
117680
|
-
const tryCatch$
|
|
117327
|
+
const tryCatch$1 = tryCatch$6;
|
|
117681
117328
|
|
|
117682
117329
|
const {
|
|
117683
117330
|
compareAny: compareAny$1,
|
|
@@ -117686,7 +117333,7 @@ const {
|
|
|
117686
117333
|
isTemplate: isTemplate$1,
|
|
117687
117334
|
} = compare$5;
|
|
117688
117335
|
|
|
117689
|
-
const maybeArray
|
|
117336
|
+
const maybeArray = maybeArray_1;
|
|
117690
117337
|
const debug$1 = browserExports('putout:runner:template');
|
|
117691
117338
|
|
|
117692
117339
|
const {entries: entries$3} = Object;
|
|
@@ -117720,8 +117367,8 @@ const exclude = ({rule, tmpl, fn, nodesExclude}) => {
|
|
|
117720
117367
|
|
|
117721
117368
|
template$3.exports = ({rule, visitor, options}) => {
|
|
117722
117369
|
const parsed = [];
|
|
117723
|
-
const nodesExclude = maybeArray
|
|
117724
|
-
const nodesInclude = maybeArray
|
|
117370
|
+
const nodesExclude = maybeArray(options.exclude);
|
|
117371
|
+
const nodesInclude = maybeArray(options.include);
|
|
117725
117372
|
|
|
117726
117373
|
for (const [tmpl, fn] of entries$3(visitor)) {
|
|
117727
117374
|
if (!tmpl)
|
|
@@ -117772,7 +117419,7 @@ function wrapWithCheck({rule, nodesInclude, nodesExclude, fn}) {
|
|
|
117772
117419
|
if (!isFn(fn))
|
|
117773
117420
|
throw Error(`☝️ Looks like provided visitor is not a function: ${stringify(fn)}. More on using Traverser: https://git.io/JqcMn`);
|
|
117774
117421
|
|
|
117775
|
-
const [e] = tryCatch$
|
|
117422
|
+
const [e] = tryCatch$1(fn, path);
|
|
117776
117423
|
|
|
117777
117424
|
if (e) {
|
|
117778
117425
|
e.rule = rule;
|
|
@@ -118565,7 +118212,7 @@ function cutBrackets(a) {
|
|
|
118565
118212
|
return a.replace(/\s\(\d:\d+\)/, '');
|
|
118566
118213
|
}
|
|
118567
118214
|
|
|
118568
|
-
const tryCatch
|
|
118215
|
+
const tryCatch = tryCatch$6;
|
|
118569
118216
|
const {defaultOptions: defaultOptions$1} = defaultOptions$4;
|
|
118570
118217
|
const {cutShebang: cutShebang$1} = shebang;
|
|
118571
118218
|
const parseError$1 = parseError$2;
|
|
@@ -118598,7 +118245,7 @@ transform$5.transform = (ast, source, opts) => {
|
|
|
118598
118245
|
|
|
118599
118246
|
const [, shebang] = cutShebang$1(source);
|
|
118600
118247
|
|
|
118601
|
-
const [validationError] = tryCatch
|
|
118248
|
+
const [validationError] = tryCatch(validateRules, {
|
|
118602
118249
|
rules,
|
|
118603
118250
|
pluginNames,
|
|
118604
118251
|
});
|
|
@@ -118640,7 +118287,7 @@ transform$5.transformAsync = async (ast, source, opts) => {
|
|
|
118640
118287
|
|
|
118641
118288
|
const [, shebang] = cutShebang$1(source);
|
|
118642
118289
|
|
|
118643
|
-
const [validationError] = tryCatch
|
|
118290
|
+
const [validationError] = tryCatch(validateRules, {
|
|
118644
118291
|
rules,
|
|
118645
118292
|
pluginNames,
|
|
118646
118293
|
});
|
|
@@ -118684,8 +118331,8 @@ findPlaces$2.findPlacesAsync = async (ast, source, opts) => {
|
|
|
118684
118331
|
});
|
|
118685
118332
|
};
|
|
118686
118333
|
|
|
118687
|
-
const {isArray
|
|
118688
|
-
const noop
|
|
118334
|
+
const {isArray} = Array;
|
|
118335
|
+
const noop = () => {};
|
|
118689
118336
|
|
|
118690
118337
|
var report$3 = () => {
|
|
118691
118338
|
let filesCount = 0;
|
|
@@ -118699,11 +118346,11 @@ var report$3 = () => {
|
|
|
118699
118346
|
places,
|
|
118700
118347
|
index = 0,
|
|
118701
118348
|
count = 1,
|
|
118702
|
-
trace = noop
|
|
118349
|
+
trace = noop,
|
|
118703
118350
|
formatterOptions = {},
|
|
118704
118351
|
} = options;
|
|
118705
118352
|
|
|
118706
|
-
if (!isArray
|
|
118353
|
+
if (!isArray(places))
|
|
118707
118354
|
throw Error(`☝️ Looks like for 'places: Places[]' you passed the wrong type: '${typeof places}'`);
|
|
118708
118355
|
|
|
118709
118356
|
if (places.length)
|
|
@@ -118741,7 +118388,7 @@ report$3.default;
|
|
|
118741
118388
|
|
|
118742
118389
|
var traverse$5 = {};
|
|
118743
118390
|
|
|
118744
|
-
const {types: types$
|
|
118391
|
+
const {types: types$3, traverse: babelTraverse} = bundle;
|
|
118745
118392
|
|
|
118746
118393
|
const {
|
|
118747
118394
|
compare,
|
|
@@ -118750,7 +118397,7 @@ const {
|
|
|
118750
118397
|
getTemplateValues,
|
|
118751
118398
|
} = compare$5;
|
|
118752
118399
|
|
|
118753
|
-
const {isFile, isProgram
|
|
118400
|
+
const {isFile, isProgram} = types$3;
|
|
118754
118401
|
const {merge} = babelTraverse.visitors;
|
|
118755
118402
|
const {entries: entries$2} = Object;
|
|
118756
118403
|
|
|
@@ -118761,7 +118408,7 @@ const createTraverse = (path) => {
|
|
|
118761
118408
|
if (isPath(path))
|
|
118762
118409
|
return path.traverse.bind(path);
|
|
118763
118410
|
|
|
118764
|
-
const noScope = !isFile(path) && !isProgram
|
|
118411
|
+
const noScope = !isFile(path) && !isProgram(path);
|
|
118765
118412
|
|
|
118766
118413
|
return (visitors) => {
|
|
118767
118414
|
babelTraverse(path, {
|
|
@@ -125938,16 +125585,16 @@ var addArgs = {};
|
|
|
125938
125585
|
|
|
125939
125586
|
const {compareAny} = compare$5;
|
|
125940
125587
|
const {template: template$1} = parser$6;
|
|
125941
|
-
const {types: types$
|
|
125588
|
+
const {types: types$2} = bundle;
|
|
125942
125589
|
const {
|
|
125943
125590
|
ObjectPattern,
|
|
125944
|
-
ObjectProperty
|
|
125591
|
+
ObjectProperty,
|
|
125945
125592
|
isBlockStatement,
|
|
125946
125593
|
isFunction,
|
|
125947
125594
|
isLabeledStatement,
|
|
125948
125595
|
isObjectPattern,
|
|
125949
125596
|
isCallExpression,
|
|
125950
|
-
} = types$
|
|
125597
|
+
} = types$2;
|
|
125951
125598
|
|
|
125952
125599
|
const {entries: entries$1} = Object;
|
|
125953
125600
|
|
|
@@ -126049,12 +125696,12 @@ const traverse$1 = (args) => ({push, options}) => {
|
|
|
126049
125696
|
function createProperty(node) {
|
|
126050
125697
|
if (!isLabeledStatement(node)) {
|
|
126051
125698
|
const {expression} = node;
|
|
126052
|
-
return ObjectProperty
|
|
125699
|
+
return ObjectProperty(expression, expression, !COMPUTED, SHORTHAND);
|
|
126053
125700
|
}
|
|
126054
125701
|
|
|
126055
125702
|
const {label, body} = node;
|
|
126056
125703
|
|
|
126057
|
-
return ObjectProperty
|
|
125704
|
+
return ObjectProperty(label, body.expression, !COMPUTED, SHORTHAND);
|
|
126058
125705
|
}
|
|
126059
125706
|
|
|
126060
125707
|
function getObjectPattern(params) {
|
|
@@ -126069,399 +125716,6 @@ function getObjectPattern(params) {
|
|
|
126069
125716
|
];
|
|
126070
125717
|
}
|
|
126071
125718
|
|
|
126072
|
-
var filesystem = {};
|
|
126073
|
-
|
|
126074
|
-
var maybeFs = {};
|
|
126075
|
-
|
|
126076
|
-
const fullstore = fullstore$5;
|
|
126077
|
-
const driverStore = fullstore();
|
|
126078
|
-
|
|
126079
|
-
const {assign} = Object;
|
|
126080
|
-
const noop = () => {};
|
|
126081
|
-
const returns = (a) => () => a;
|
|
126082
|
-
|
|
126083
|
-
const defaultFS = {
|
|
126084
|
-
renameFile: noop,
|
|
126085
|
-
removeFile: noop,
|
|
126086
|
-
createDirectory: noop,
|
|
126087
|
-
readFileContent: returns(''),
|
|
126088
|
-
writeFileContent: noop,
|
|
126089
|
-
copyFile: noop,
|
|
126090
|
-
};
|
|
126091
|
-
|
|
126092
|
-
const maybeFS$1 = assign({}, defaultFS);
|
|
126093
|
-
|
|
126094
|
-
maybeFs.renameFile = (oldName, newName) => {
|
|
126095
|
-
maybeFS$1.renameFile(oldName, newName);
|
|
126096
|
-
};
|
|
126097
|
-
|
|
126098
|
-
maybeFs.removeFile = (name) => {
|
|
126099
|
-
maybeFS$1.removeFile(name);
|
|
126100
|
-
};
|
|
126101
|
-
|
|
126102
|
-
maybeFs.copyFile = (from, to) => {
|
|
126103
|
-
maybeFS$1.copyFile(from, to);
|
|
126104
|
-
};
|
|
126105
|
-
|
|
126106
|
-
maybeFs.createDirectory = (name) => {
|
|
126107
|
-
maybeFS$1.createDirectory(name);
|
|
126108
|
-
};
|
|
126109
|
-
|
|
126110
|
-
maybeFs.readFileContent = (name) => {
|
|
126111
|
-
return maybeFS$1.readFileContent(name);
|
|
126112
|
-
};
|
|
126113
|
-
|
|
126114
|
-
maybeFs.writeFileContent = (name, content) => {
|
|
126115
|
-
maybeFS$1.writeFileContent(name, content);
|
|
126116
|
-
};
|
|
126117
|
-
|
|
126118
|
-
maybeFs.init = init;
|
|
126119
|
-
|
|
126120
|
-
function init(fsDriver) {
|
|
126121
|
-
assign(maybeFS$1, fsDriver);
|
|
126122
|
-
}
|
|
126123
|
-
|
|
126124
|
-
maybeFs.pause = () => {
|
|
126125
|
-
driverStore(maybeFS$1);
|
|
126126
|
-
deinit();
|
|
126127
|
-
};
|
|
126128
|
-
|
|
126129
|
-
maybeFs.start = () => {
|
|
126130
|
-
init(driverStore());
|
|
126131
|
-
};
|
|
126132
|
-
|
|
126133
|
-
maybeFs.deinit = deinit;
|
|
126134
|
-
|
|
126135
|
-
function deinit() {
|
|
126136
|
-
assign(maybeFS$1, defaultFS);
|
|
126137
|
-
}
|
|
126138
|
-
|
|
126139
|
-
const {join: join$2, basename} = require$$0$2;
|
|
126140
|
-
const tryCatch = tryCatch$8;
|
|
126141
|
-
const {types: types$2} = bundle;
|
|
126142
|
-
|
|
126143
|
-
const {
|
|
126144
|
-
setLiteralValue,
|
|
126145
|
-
getProperty,
|
|
126146
|
-
traverseProperties: traverseProperties$1,
|
|
126147
|
-
} = operate;
|
|
126148
|
-
|
|
126149
|
-
const maybeFS = maybeFs;
|
|
126150
|
-
const isString$2 = (a) => typeof a === 'string';
|
|
126151
|
-
const {isArray} = Array;
|
|
126152
|
-
const maybeArray = (a) => isArray(a) ? a : [a];
|
|
126153
|
-
|
|
126154
|
-
const toBase64 = (content) => {
|
|
126155
|
-
const [e, result] = tryCatch(btoa, content);
|
|
126156
|
-
|
|
126157
|
-
if (e)
|
|
126158
|
-
return btoa(encodeURI(content));
|
|
126159
|
-
|
|
126160
|
-
return result;
|
|
126161
|
-
};
|
|
126162
|
-
|
|
126163
|
-
const fromBase64 = (content) => {
|
|
126164
|
-
const [e, decoded] = tryCatch(atob, content);
|
|
126165
|
-
|
|
126166
|
-
if (!e)
|
|
126167
|
-
return decodeURI(decoded);
|
|
126168
|
-
|
|
126169
|
-
return content;
|
|
126170
|
-
};
|
|
126171
|
-
|
|
126172
|
-
const {
|
|
126173
|
-
ObjectExpression,
|
|
126174
|
-
ArrayExpression,
|
|
126175
|
-
StringLiteral: StringLiteral$1,
|
|
126176
|
-
ObjectProperty,
|
|
126177
|
-
isProgram,
|
|
126178
|
-
} = types$2;
|
|
126179
|
-
|
|
126180
|
-
const getRegExp = (wildcard) => {
|
|
126181
|
-
const escaped = wildcard
|
|
126182
|
-
.replace(/\./g, '\\.')
|
|
126183
|
-
.replace(/\*/g, '.*')
|
|
126184
|
-
.replace('?', '.?');
|
|
126185
|
-
|
|
126186
|
-
return RegExp(`^${escaped}$`);
|
|
126187
|
-
};
|
|
126188
|
-
|
|
126189
|
-
filesystem.getParentDirectory = (filePath) => {
|
|
126190
|
-
const {parentPath} = filePath.parentPath.parentPath;
|
|
126191
|
-
|
|
126192
|
-
if (isProgram(parentPath))
|
|
126193
|
-
return null;
|
|
126194
|
-
|
|
126195
|
-
return parentPath;
|
|
126196
|
-
};
|
|
126197
|
-
|
|
126198
|
-
filesystem.findFile = findFile$2;
|
|
126199
|
-
|
|
126200
|
-
function findFile$2(node, name) {
|
|
126201
|
-
checkName(name);
|
|
126202
|
-
|
|
126203
|
-
const filePaths = [];
|
|
126204
|
-
const names = maybeArray(name);
|
|
126205
|
-
|
|
126206
|
-
for (const filenamePath of traverseProperties$1(node, 'filename')) {
|
|
126207
|
-
const {value} = filenamePath.node.value;
|
|
126208
|
-
const base = basename(value);
|
|
126209
|
-
|
|
126210
|
-
for (const name of names) {
|
|
126211
|
-
if (value === name || getRegExp(name).test(base))
|
|
126212
|
-
filePaths.push(filenamePath.parentPath);
|
|
126213
|
-
}
|
|
126214
|
-
}
|
|
126215
|
-
|
|
126216
|
-
return filePaths;
|
|
126217
|
-
}
|
|
126218
|
-
|
|
126219
|
-
function checkName(name) {
|
|
126220
|
-
if (!isString$2(name) && !isArray(name))
|
|
126221
|
-
throw Error(`☝️ Looks like you forget to pass the 'name' of a file to 'findFile(filePath: Path|FilePath, name: string | string[]): FilePath'`);
|
|
126222
|
-
}
|
|
126223
|
-
|
|
126224
|
-
function getFilenamePath(filePath) {
|
|
126225
|
-
const filenamePath = getProperty(filePath, 'filename');
|
|
126226
|
-
return filenamePath.get('value');
|
|
126227
|
-
}
|
|
126228
|
-
|
|
126229
|
-
function getFilename$2(filePath) {
|
|
126230
|
-
const {value} = getFilenamePath(filePath).node;
|
|
126231
|
-
return value;
|
|
126232
|
-
}
|
|
126233
|
-
|
|
126234
|
-
filesystem.getFileType = getFileType;
|
|
126235
|
-
|
|
126236
|
-
function getFileType(filePath) {
|
|
126237
|
-
const typePath = getProperty(filePath, 'type');
|
|
126238
|
-
return typePath.node.value.value;
|
|
126239
|
-
}
|
|
126240
|
-
|
|
126241
|
-
filesystem.getFileContent = getFileContent;
|
|
126242
|
-
|
|
126243
|
-
function getFileContent(filePath) {
|
|
126244
|
-
const content = getProperty(filePath, 'content');
|
|
126245
|
-
|
|
126246
|
-
return [
|
|
126247
|
-
Boolean(content),
|
|
126248
|
-
content?.node.value.value,
|
|
126249
|
-
];
|
|
126250
|
-
}
|
|
126251
|
-
|
|
126252
|
-
filesystem.getFilename = getFilename$2;
|
|
126253
|
-
|
|
126254
|
-
filesystem.renameFile = (filePath, name) => {
|
|
126255
|
-
const oldName = getFilename$2(filePath);
|
|
126256
|
-
const valuePath = getFilenamePath(filePath);
|
|
126257
|
-
const baseName = oldName
|
|
126258
|
-
.split('/')
|
|
126259
|
-
.pop();
|
|
126260
|
-
|
|
126261
|
-
const newName = name
|
|
126262
|
-
.split('/')
|
|
126263
|
-
.pop();
|
|
126264
|
-
|
|
126265
|
-
const newFilename = oldName.replace(baseName, newName);
|
|
126266
|
-
|
|
126267
|
-
setLiteralValue(valuePath, newFilename);
|
|
126268
|
-
maybeFS.renameFile(oldName, newFilename);
|
|
126269
|
-
};
|
|
126270
|
-
|
|
126271
|
-
filesystem.removeFile = (filePath) => {
|
|
126272
|
-
const filename = getFilename$2(filePath);
|
|
126273
|
-
|
|
126274
|
-
filePath.remove();
|
|
126275
|
-
maybeFS.removeFile(filename);
|
|
126276
|
-
};
|
|
126277
|
-
|
|
126278
|
-
filesystem.moveFile = (filePath, dirPath) => {
|
|
126279
|
-
if (filePath === dirPath)
|
|
126280
|
-
return;
|
|
126281
|
-
|
|
126282
|
-
const dirname = getFilename$2(dirPath);
|
|
126283
|
-
const filename = getFilename$2(filePath);
|
|
126284
|
-
const dirPathFiles = getProperty(dirPath, 'files');
|
|
126285
|
-
const filenamePath = getProperty(filePath, 'filename');
|
|
126286
|
-
|
|
126287
|
-
const basename = filename
|
|
126288
|
-
.split('/')
|
|
126289
|
-
.pop();
|
|
126290
|
-
|
|
126291
|
-
const newFilename = join$2(dirname, basename);
|
|
126292
|
-
|
|
126293
|
-
maybeRemoveFile(dirPath, newFilename);
|
|
126294
|
-
|
|
126295
|
-
setLiteralValue(filenamePath.get('value'), newFilename);
|
|
126296
|
-
dirPathFiles.node.value.elements.push(filePath.node);
|
|
126297
|
-
|
|
126298
|
-
filePath.remove();
|
|
126299
|
-
maybeFS.renameFile(filename, newFilename);
|
|
126300
|
-
};
|
|
126301
|
-
|
|
126302
|
-
filesystem.copyFile = (filePath, dirPath) => {
|
|
126303
|
-
const dirname = getFilename$2(dirPath);
|
|
126304
|
-
const filename = getFilename$2(filePath);
|
|
126305
|
-
|
|
126306
|
-
const basename = filename
|
|
126307
|
-
.split('/')
|
|
126308
|
-
.pop();
|
|
126309
|
-
|
|
126310
|
-
const newFilename = join$2(dirname, basename);
|
|
126311
|
-
const [hasContent, content] = getFileContent(filePath);
|
|
126312
|
-
|
|
126313
|
-
const copiedFile = ObjectExpression([
|
|
126314
|
-
createTypeProperty('file'),
|
|
126315
|
-
createFilenameProperty(newFilename),
|
|
126316
|
-
hasContent && createContentProperty(content),
|
|
126317
|
-
].filter(Boolean));
|
|
126318
|
-
|
|
126319
|
-
maybeRemoveFile(dirPath, newFilename);
|
|
126320
|
-
|
|
126321
|
-
const dirPathFiles = getFiles(dirPath);
|
|
126322
|
-
dirPathFiles.node.value.elements.push(copiedFile);
|
|
126323
|
-
|
|
126324
|
-
maybeFS.copyFile(filename, newFilename);
|
|
126325
|
-
};
|
|
126326
|
-
|
|
126327
|
-
function maybeRemoveFile(dirPath, filename) {
|
|
126328
|
-
const type = getFileType(dirPath);
|
|
126329
|
-
|
|
126330
|
-
if (type !== 'directory') {
|
|
126331
|
-
const filename = getFilename$2(dirPath);
|
|
126332
|
-
throw Error(`☝️ Looks like '${filename}' is not a directory, but: '${type}'. Rename to '${filename}/'`);
|
|
126333
|
-
}
|
|
126334
|
-
|
|
126335
|
-
const dirPathFiles = getProperty(dirPath, 'files');
|
|
126336
|
-
const name = join$2(getFilename$2(dirPath), basename(filename));
|
|
126337
|
-
const [fileToOverwrite] = findFile$2(dirPathFiles, name);
|
|
126338
|
-
|
|
126339
|
-
if (!fileToOverwrite)
|
|
126340
|
-
return;
|
|
126341
|
-
|
|
126342
|
-
fileToOverwrite.remove();
|
|
126343
|
-
}
|
|
126344
|
-
|
|
126345
|
-
const createTypeProperty = (type) => ObjectProperty(StringLiteral$1('type'), StringLiteral$1(type));
|
|
126346
|
-
|
|
126347
|
-
filesystem.createTypeProperty = createTypeProperty;
|
|
126348
|
-
|
|
126349
|
-
const createFilesProperty = (files) => ObjectProperty(StringLiteral$1('files'), ArrayExpression(files));
|
|
126350
|
-
|
|
126351
|
-
filesystem.createFilesProperty = createFilesProperty;
|
|
126352
|
-
|
|
126353
|
-
const createFilenameProperty = (filename) => ObjectProperty(StringLiteral$1('filename'), StringLiteral$1(filename));
|
|
126354
|
-
|
|
126355
|
-
filesystem.createFilenameProperty = createFilenameProperty;
|
|
126356
|
-
|
|
126357
|
-
const createContentProperty = (content) => ObjectProperty(StringLiteral$1('content'), StringLiteral$1(content));
|
|
126358
|
-
|
|
126359
|
-
filesystem.createContentProperty = createContentProperty;
|
|
126360
|
-
|
|
126361
|
-
filesystem.createFile = (dirPath, name, content) => {
|
|
126362
|
-
maybeRemoveFile(dirPath, name);
|
|
126363
|
-
|
|
126364
|
-
const dirPathFiles = getFiles(dirPath);
|
|
126365
|
-
const parentFilename = getFilename$2(dirPath);
|
|
126366
|
-
const filename = join$2(parentFilename, name);
|
|
126367
|
-
|
|
126368
|
-
const typeProperty = createTypeProperty('file');
|
|
126369
|
-
const filenameProperty = createFilenameProperty(filename);
|
|
126370
|
-
|
|
126371
|
-
const properties = [
|
|
126372
|
-
typeProperty,
|
|
126373
|
-
filenameProperty,
|
|
126374
|
-
content && createContentProperty(content),
|
|
126375
|
-
].filter(Boolean);
|
|
126376
|
-
|
|
126377
|
-
dirPathFiles.node.value.elements.push(ObjectExpression(properties));
|
|
126378
|
-
|
|
126379
|
-
const filePath = dirPathFiles
|
|
126380
|
-
.get('value.elements')
|
|
126381
|
-
.at(-1);
|
|
126382
|
-
|
|
126383
|
-
if (isString$2(content))
|
|
126384
|
-
writeFileContent$1(filePath, content);
|
|
126385
|
-
|
|
126386
|
-
return filePath;
|
|
126387
|
-
};
|
|
126388
|
-
|
|
126389
|
-
function getFiles(dirPath) {
|
|
126390
|
-
return getProperty(dirPath, 'files');
|
|
126391
|
-
}
|
|
126392
|
-
|
|
126393
|
-
filesystem.createDirectory = (dirPath, name) => {
|
|
126394
|
-
const dirPathFiles = getFiles(dirPath);
|
|
126395
|
-
const parentFilename = getFilename$2(dirPath);
|
|
126396
|
-
const filename = join$2(parentFilename, name);
|
|
126397
|
-
|
|
126398
|
-
const typeProperty = createTypeProperty('directory');
|
|
126399
|
-
const filesProperty = createFilesProperty([]);
|
|
126400
|
-
const filenameProperty = createFilenameProperty(filename);
|
|
126401
|
-
|
|
126402
|
-
dirPathFiles.node.value.elements.push(ObjectExpression([
|
|
126403
|
-
typeProperty,
|
|
126404
|
-
filenameProperty,
|
|
126405
|
-
filesProperty,
|
|
126406
|
-
]));
|
|
126407
|
-
|
|
126408
|
-
maybeFS.createDirectory(filename);
|
|
126409
|
-
|
|
126410
|
-
return dirPathFiles
|
|
126411
|
-
.get('value.elements')
|
|
126412
|
-
.at(-1);
|
|
126413
|
-
};
|
|
126414
|
-
|
|
126415
|
-
filesystem.readFileContent = (filePath) => {
|
|
126416
|
-
const fileType = getFileType(filePath);
|
|
126417
|
-
|
|
126418
|
-
if (fileType === 'directory')
|
|
126419
|
-
return '';
|
|
126420
|
-
|
|
126421
|
-
const [hasContent, content] = getFileContent(filePath);
|
|
126422
|
-
|
|
126423
|
-
if (hasContent)
|
|
126424
|
-
return fromBase64(content);
|
|
126425
|
-
|
|
126426
|
-
const filename = getFilename$2(filePath);
|
|
126427
|
-
const fileContent = maybeFS.readFileContent(filename);
|
|
126428
|
-
|
|
126429
|
-
const property = createContentProperty(toBase64(fileContent));
|
|
126430
|
-
|
|
126431
|
-
filePath.node.properties.push(property);
|
|
126432
|
-
|
|
126433
|
-
return fileContent;
|
|
126434
|
-
};
|
|
126435
|
-
|
|
126436
|
-
filesystem.writeFileContent = writeFileContent$1;
|
|
126437
|
-
|
|
126438
|
-
function writeFileContent$1(filePath, content) {
|
|
126439
|
-
const fileType = getFileType(filePath);
|
|
126440
|
-
|
|
126441
|
-
if (fileType === 'directory')
|
|
126442
|
-
return;
|
|
126443
|
-
|
|
126444
|
-
const filename = getFilename$2(filePath);
|
|
126445
|
-
|
|
126446
|
-
maybeFS.writeFileContent(filename, content);
|
|
126447
|
-
|
|
126448
|
-
const contentPath = getProperty(filePath, 'content');
|
|
126449
|
-
|
|
126450
|
-
if (contentPath) {
|
|
126451
|
-
setLiteralValue(contentPath.node.value, toBase64(content));
|
|
126452
|
-
return;
|
|
126453
|
-
}
|
|
126454
|
-
|
|
126455
|
-
const property = createContentProperty(toBase64(content));
|
|
126456
|
-
filePath.node.properties.push(property);
|
|
126457
|
-
}
|
|
126458
|
-
|
|
126459
|
-
filesystem.init = maybeFS.init;
|
|
126460
|
-
filesystem.deinit = maybeFS.deinit;
|
|
126461
|
-
|
|
126462
|
-
filesystem.pause = maybeFS.pause;
|
|
126463
|
-
filesystem.start = maybeFS.start;
|
|
126464
|
-
|
|
126465
125719
|
var matchFiles = {};
|
|
126466
125720
|
|
|
126467
125721
|
// A simple implementation of make-array
|
|
@@ -127151,7 +126405,7 @@ const {
|
|
|
127151
126405
|
createFile,
|
|
127152
126406
|
removeFile,
|
|
127153
126407
|
getParentDirectory: getParentDirectory$1,
|
|
127154
|
-
} = filesystem
|
|
126408
|
+
} = filesystem;
|
|
127155
126409
|
|
|
127156
126410
|
const {join: join$1} = path;
|
|
127157
126411
|
|
|
@@ -127346,7 +126600,7 @@ const {
|
|
|
127346
126600
|
readFileContent,
|
|
127347
126601
|
findFile,
|
|
127348
126602
|
renameFile,
|
|
127349
|
-
} = filesystem
|
|
126603
|
+
} = filesystem;
|
|
127350
126604
|
|
|
127351
126605
|
const {parse: parse$1} = JSON;
|
|
127352
126606
|
|