@putout/bundle 3.18.3 → 3.18.5
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 +1188 -1547
- package/bundle/putout.min.js +1 -1
- package/package.json +4 -3
package/bundle/putout.js
CHANGED
|
@@ -174,15 +174,15 @@ var versions = {};
|
|
|
174
174
|
var release$1 = {};
|
|
175
175
|
var config = {};
|
|
176
176
|
|
|
177
|
-
function noop$
|
|
177
|
+
function noop$6() {}
|
|
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$6;
|
|
180
|
+
var addListener = noop$6;
|
|
181
|
+
var once$a = noop$6;
|
|
182
|
+
var off = noop$6;
|
|
183
|
+
var removeListener = noop$6;
|
|
184
|
+
var removeAllListeners = noop$6;
|
|
185
|
+
var emit = noop$6;
|
|
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$4 () {
|
|
261
261
|
inited = true;
|
|
262
262
|
var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
|
263
263
|
for (var i = 0, len = code.length; i < len; ++i) {
|
|
@@ -271,7 +271,7 @@ function init$5 () {
|
|
|
271
271
|
|
|
272
272
|
function toByteArray (b64) {
|
|
273
273
|
if (!inited) {
|
|
274
|
-
init$
|
|
274
|
+
init$4();
|
|
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$4();
|
|
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$i = 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$i(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$i(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$e(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$e(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$h(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$e(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$h(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$e(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$e,
|
|
3098
3098
|
isNumber: isNumber$3,
|
|
3099
3099
|
isNullOrUndefined: isNullOrUndefined,
|
|
3100
3100
|
isNull: isNull$1,
|
|
3101
3101
|
isBoolean: isBoolean,
|
|
3102
|
-
isArray: isArray$
|
|
3102
|
+
isArray: isArray$h,
|
|
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$h,
|
|
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$e,
|
|
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$5;
|
|
8994
8994
|
},
|
|
8995
8995
|
NullLiteral: function() {
|
|
8996
8996
|
return nullLiteral;
|
|
@@ -11312,7 +11312,7 @@ __export(lib_exports, {
|
|
|
11312
11312
|
return isPrivateName;
|
|
11313
11313
|
},
|
|
11314
11314
|
isProgram: function() {
|
|
11315
|
-
return isProgram$
|
|
11315
|
+
return isProgram$6;
|
|
11316
11316
|
},
|
|
11317
11317
|
isProperty: function() {
|
|
11318
11318
|
return isProperty$1;
|
|
@@ -11825,7 +11825,7 @@ __export(lib_exports, {
|
|
|
11825
11825
|
return newExpression$1;
|
|
11826
11826
|
},
|
|
11827
11827
|
noop: function() {
|
|
11828
|
-
return noop$
|
|
11828
|
+
return noop$5;
|
|
11829
11829
|
},
|
|
11830
11830
|
nullLiteral: function() {
|
|
11831
11831
|
return nullLiteral;
|
|
@@ -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$6(node, opts) {
|
|
14003
14003
|
if (!node) return false;
|
|
14004
14004
|
if (node.type !== "Program") return false;
|
|
14005
14005
|
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$5() {
|
|
23220
23220
|
return {
|
|
23221
23221
|
type: "Noop"
|
|
23222
23222
|
};
|
|
@@ -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$z = {
|
|
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$z.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$z.j_oTag || currentContext === types$z.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$z.brace);
|
|
35403
35403
|
this.next();
|
|
35404
|
-
node = this.jsxParseExpressionContainer(node, types$
|
|
35404
|
+
node = this.jsxParseExpressionContainer(node, types$z.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$z.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$z.brace);
|
|
35462
35462
|
this.next();
|
|
35463
35463
|
this.expect(21);
|
|
35464
35464
|
node.argument = this.parseMaybeAssignAllowIn();
|
|
35465
|
-
this.setContext(types$
|
|
35465
|
+
this.setContext(types$z.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$z.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$z.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$z.j_expr) {
|
|
35617
35617
|
this.jsxReadToken();
|
|
35618
35618
|
return;
|
|
35619
35619
|
}
|
|
35620
|
-
if (context === types$
|
|
35620
|
+
if (context === types$z.j_oTag || context === types$z.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$z.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$z.j_cTag);
|
|
35649
35649
|
this.state.canStartJSXElement = false;
|
|
35650
35650
|
} else if (type === 142) {
|
|
35651
|
-
context.push(types$
|
|
35651
|
+
context.push(types$z.j_oTag);
|
|
35652
35652
|
} else if (type === 143) {
|
|
35653
35653
|
var out = context[context.length - 1];
|
|
35654
|
-
if (out === types$
|
|
35654
|
+
if (out === types$z.j_oTag && prevType === 56 || out === types$z.j_cTag) {
|
|
35655
35655
|
context.pop();
|
|
35656
|
-
this.state.canStartJSXElement = context[context.length - 1] === types$
|
|
35656
|
+
this.state.canStartJSXElement = context[context.length - 1] === types$z.j_expr;
|
|
35657
35657
|
} else {
|
|
35658
|
-
this.setContext(types$
|
|
35658
|
+
this.setContext(types$z.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$z.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$z.j_oTag || currentContext === types$z.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$6(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$6(node) {
|
|
48907
48907
|
this.printJoin(node.decorators);
|
|
48908
48908
|
if (node.computed) {
|
|
48909
48909
|
this.tokenChar(91);
|
|
@@ -48923,7 +48923,7 @@ function ObjectProperty$7(node) {
|
|
|
48923
48923
|
this.space();
|
|
48924
48924
|
this.print(node.value);
|
|
48925
48925
|
}
|
|
48926
|
-
function ArrayExpression$
|
|
48926
|
+
function ArrayExpression$7(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$8(node) {
|
|
49013
49013
|
var raw = this.getPossibleRaw(node);
|
|
49014
49014
|
if (!this.format.minified && raw !== void 0) {
|
|
49015
49015
|
this.token(raw);
|
|
@@ -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$7,
|
|
50513
|
+
ArrayPattern: ArrayExpression$7,
|
|
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$6,
|
|
50631
50631
|
ObjectMethod: ObjectMethod$2,
|
|
50632
|
-
ObjectPattern: ObjectExpression$
|
|
50633
|
-
ObjectProperty: ObjectProperty$
|
|
50632
|
+
ObjectPattern: ObjectExpression$6,
|
|
50633
|
+
ObjectProperty: ObjectProperty$6,
|
|
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$8,
|
|
50660
|
+
StringLiteralTypeAnnotation: StringLiteral$8,
|
|
50661
50661
|
StringTypeAnnotation: StringTypeAnnotation,
|
|
50662
50662
|
Super: Super,
|
|
50663
50663
|
SwitchCase: SwitchCase,
|
|
@@ -58227,10 +58227,19 @@ var __setModuleDefault = Object.create ? (function(o, v) {
|
|
|
58227
58227
|
o["default"] = v;
|
|
58228
58228
|
};
|
|
58229
58229
|
|
|
58230
|
+
var ownKeys = function(o) {
|
|
58231
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
58232
|
+
var ar = [];
|
|
58233
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
58234
|
+
return ar;
|
|
58235
|
+
};
|
|
58236
|
+
return ownKeys(o);
|
|
58237
|
+
};
|
|
58238
|
+
|
|
58230
58239
|
function __importStar(mod) {
|
|
58231
58240
|
if (mod && mod.__esModule) return mod;
|
|
58232
58241
|
var result = {};
|
|
58233
|
-
if (mod != null) for (var k
|
|
58242
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
58234
58243
|
__setModuleDefault(result, mod);
|
|
58235
58244
|
return result;
|
|
58236
58245
|
}
|
|
@@ -58407,7 +58416,7 @@ var main = {};
|
|
|
58407
58416
|
|
|
58408
58417
|
var fork = {exports: {}};
|
|
58409
58418
|
|
|
58410
|
-
var types$
|
|
58419
|
+
var types$y = {exports: {}};
|
|
58411
58420
|
|
|
58412
58421
|
var shared = {};
|
|
58413
58422
|
|
|
@@ -58507,12 +58516,12 @@ function requireShared () {
|
|
|
58507
58516
|
return shared;
|
|
58508
58517
|
}
|
|
58509
58518
|
|
|
58510
|
-
types$
|
|
58519
|
+
types$y.exports;
|
|
58511
58520
|
|
|
58512
58521
|
var hasRequiredTypes;
|
|
58513
58522
|
|
|
58514
58523
|
function requireTypes () {
|
|
58515
|
-
if (hasRequiredTypes) return types$
|
|
58524
|
+
if (hasRequiredTypes) return types$y.exports;
|
|
58516
58525
|
hasRequiredTypes = 1;
|
|
58517
58526
|
(function (module, exports) {
|
|
58518
58527
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -59304,8 +59313,8 @@ function requireTypes () {
|
|
|
59304
59313
|
exports.default = typesPlugin;
|
|
59305
59314
|
(0, shared_1.maybeSetModuleExports)(function () { return module; });
|
|
59306
59315
|
|
|
59307
|
-
} (types$
|
|
59308
|
-
return types$
|
|
59316
|
+
} (types$y, types$y.exports));
|
|
59317
|
+
return types$y.exports;
|
|
59309
59318
|
}
|
|
59310
59319
|
|
|
59311
59320
|
var pathVisitor = {exports: {}};
|
|
@@ -78636,7 +78645,7 @@ var printer = {};
|
|
|
78636
78645
|
|
|
78637
78646
|
var tokenize$1 = {};
|
|
78638
78647
|
|
|
78639
|
-
var fullstore$
|
|
78648
|
+
var fullstore$5 = (value) => {
|
|
78640
78649
|
const data = {
|
|
78641
78650
|
value,
|
|
78642
78651
|
};
|
|
@@ -78653,9 +78662,9 @@ var fullstore$6 = (value) => {
|
|
|
78653
78662
|
};
|
|
78654
78663
|
};
|
|
78655
78664
|
|
|
78656
|
-
var types$
|
|
78665
|
+
var types$x = {};
|
|
78657
78666
|
|
|
78658
|
-
types$
|
|
78667
|
+
types$x.TYPES = {
|
|
78659
78668
|
TOKEN: 'Token',
|
|
78660
78669
|
NEWLINE: 'Newline',
|
|
78661
78670
|
LINEBREAK: 'Linebreak',
|
|
@@ -78675,7 +78684,7 @@ var arrowFunctionExpression = {};
|
|
|
78675
78684
|
|
|
78676
78685
|
var is$3 = {};
|
|
78677
78686
|
|
|
78678
|
-
const {types: types$
|
|
78687
|
+
const {types: types$w} = bundle;
|
|
78679
78688
|
const {
|
|
78680
78689
|
isStringLiteral: isStringLiteral$9,
|
|
78681
78690
|
isSpreadElement: isSpreadElement$3,
|
|
@@ -78687,7 +78696,7 @@ const {
|
|
|
78687
78696
|
isMemberExpression: isMemberExpression$5,
|
|
78688
78697
|
isArrayExpression: isArrayExpression$4,
|
|
78689
78698
|
isObjectExpression: isObjectExpression$6,
|
|
78690
|
-
} = types$
|
|
78699
|
+
} = types$w;
|
|
78691
78700
|
|
|
78692
78701
|
const isParentProgram$1 = (path) => path.parentPath?.isProgram();
|
|
78693
78702
|
const isParentBlock$3 = (path) => path.parentPath.isBlockStatement();
|
|
@@ -78866,7 +78875,7 @@ maybeInsideFn$1.maybeInsideFn = (insideFn, {print, indent}) => {
|
|
|
78866
78875
|
indent.dec();
|
|
78867
78876
|
};
|
|
78868
78877
|
|
|
78869
|
-
const {types: types$
|
|
78878
|
+
const {types: types$v} = bundle;
|
|
78870
78879
|
const {
|
|
78871
78880
|
hasTrailingComment: hasTrailingComment$4,
|
|
78872
78881
|
satisfy: satisfy$4,
|
|
@@ -78882,7 +78891,7 @@ const {
|
|
|
78882
78891
|
isClassProperty,
|
|
78883
78892
|
isTSPropertySignature,
|
|
78884
78893
|
isSpreadElement: isSpreadElement$2,
|
|
78885
|
-
} = types$
|
|
78894
|
+
} = types$v;
|
|
78886
78895
|
|
|
78887
78896
|
const isProperty = satisfy$4([
|
|
78888
78897
|
isObjectProperty$1,
|
|
@@ -79621,7 +79630,7 @@ var memberExpressions$1 = {};
|
|
|
79621
79630
|
|
|
79622
79631
|
var chain$1 = {};
|
|
79623
79632
|
|
|
79624
|
-
const {assign: assign$
|
|
79633
|
+
const {assign: assign$e} = Object;
|
|
79625
79634
|
|
|
79626
79635
|
chain$1.chain = (path) => {
|
|
79627
79636
|
const all = [
|
|
@@ -79686,7 +79695,7 @@ function build(path) {
|
|
|
79686
79695
|
};
|
|
79687
79696
|
|
|
79688
79697
|
if (path.isCallExpression())
|
|
79689
|
-
assign$
|
|
79698
|
+
assign$e(prop, {
|
|
79690
79699
|
args: path.node.arguments.length,
|
|
79691
79700
|
name: path.node.callee.property?.name || '',
|
|
79692
79701
|
});
|
|
@@ -79920,12 +79929,12 @@ var callExpression = {};
|
|
|
79920
79929
|
|
|
79921
79930
|
const {exists: exists$c} = is$3;
|
|
79922
79931
|
const {maybeParens: maybeParens$4} = maybeParens$8;
|
|
79923
|
-
const {isArray: isArray$
|
|
79932
|
+
const {isArray: isArray$g} = Array;
|
|
79924
79933
|
|
|
79925
79934
|
const parseArgs = (path) => {
|
|
79926
79935
|
const argsPath = path.get('arguments');
|
|
79927
79936
|
|
|
79928
|
-
if (!isArray$
|
|
79937
|
+
if (!isArray$g(argsPath))
|
|
79929
79938
|
return [];
|
|
79930
79939
|
|
|
79931
79940
|
return argsPath;
|
|
@@ -80062,8 +80071,8 @@ const {
|
|
|
80062
80071
|
|
|
80063
80072
|
const {parseComments: parseComments$4} = comment;
|
|
80064
80073
|
const {likeChain} = memberExpressions$1;
|
|
80065
|
-
const {types: types$
|
|
80066
|
-
const {isStringLiteral: isStringLiteral$8} = types$
|
|
80074
|
+
const {types: types$u} = bundle;
|
|
80075
|
+
const {isStringLiteral: isStringLiteral$8} = types$u;
|
|
80067
80076
|
|
|
80068
80077
|
const isBodyOfArrow = (path) => path.parentPath.node.body === path.node;
|
|
80069
80078
|
const isLogical = (path) => path.get('argument').isLogicalExpression();
|
|
@@ -80772,13 +80781,13 @@ var operate = {};
|
|
|
80772
80781
|
|
|
80773
80782
|
var getBinding$2 = {};
|
|
80774
80783
|
|
|
80775
|
-
const {types: types$
|
|
80784
|
+
const {types: types$t} = bundle;
|
|
80776
80785
|
const {
|
|
80777
80786
|
isIdentifier: isIdentifier$8,
|
|
80778
80787
|
isMemberExpression: isMemberExpression$3,
|
|
80779
|
-
} = types$
|
|
80788
|
+
} = types$t;
|
|
80780
80789
|
|
|
80781
|
-
const isString$
|
|
80790
|
+
const isString$d = (a) => typeof a === 'string';
|
|
80782
80791
|
|
|
80783
80792
|
getBinding$2.getBinding = getBinding$1;
|
|
80784
80793
|
function getBinding$1(path, node) {
|
|
@@ -80789,7 +80798,7 @@ function getBinding$1(path, node) {
|
|
|
80789
80798
|
getBinding$2.getBindingPath = (path, name) => getBinding$1(path, name)?.path;
|
|
80790
80799
|
|
|
80791
80800
|
const parseName$1 = (node) => {
|
|
80792
|
-
if (isString$
|
|
80801
|
+
if (isString$d(node))
|
|
80793
80802
|
return node;
|
|
80794
80803
|
|
|
80795
80804
|
if (isIdentifier$8(node))
|
|
@@ -80803,13 +80812,13 @@ const parseName$1 = (node) => {
|
|
|
80803
80812
|
|
|
80804
80813
|
var isSimple$2 = {};
|
|
80805
80814
|
|
|
80806
|
-
const {types: types$
|
|
80815
|
+
const {types: types$s} = bundle;
|
|
80807
80816
|
const {
|
|
80808
80817
|
isOptionalMemberExpression,
|
|
80809
80818
|
isMemberExpression: isMemberExpression$2,
|
|
80810
80819
|
isIdentifier: isIdentifier$7,
|
|
80811
80820
|
isLiteral: isLiteral$3,
|
|
80812
|
-
} = types$
|
|
80821
|
+
} = types$s;
|
|
80813
80822
|
|
|
80814
80823
|
isSimple$2.isSimple = (a) => {
|
|
80815
80824
|
if (isLiteral$3(a))
|
|
@@ -80826,7 +80835,7 @@ isSimple$2.isSimple = (a) => {
|
|
|
80826
80835
|
|
|
80827
80836
|
var extract$6 = {};
|
|
80828
80837
|
|
|
80829
|
-
const {types: types$
|
|
80838
|
+
const {types: types$r} = bundle;
|
|
80830
80839
|
const {
|
|
80831
80840
|
isArrayExpression: isArrayExpression$3,
|
|
80832
80841
|
isLiteral: isLiteral$2,
|
|
@@ -80840,7 +80849,7 @@ const {
|
|
|
80840
80849
|
isJSXAttribute: isJSXAttribute$1,
|
|
80841
80850
|
isTSTypeReference: isTSTypeReference$2,
|
|
80842
80851
|
isTSTypeParameter,
|
|
80843
|
-
} = types$
|
|
80852
|
+
} = types$r;
|
|
80844
80853
|
|
|
80845
80854
|
extract$6.extract = extract$5;
|
|
80846
80855
|
|
|
@@ -81164,9 +81173,9 @@ rename$1.rename = (path, from, to) => {
|
|
|
81164
81173
|
bindingPath.scope.rename(from, to);
|
|
81165
81174
|
};
|
|
81166
81175
|
|
|
81167
|
-
var setLiteralValue$
|
|
81176
|
+
var setLiteralValue$4 = {};
|
|
81168
81177
|
|
|
81169
|
-
setLiteralValue$
|
|
81178
|
+
setLiteralValue$4.setLiteralValue = (path, newValue) => {
|
|
81170
81179
|
const node = path.node || path;
|
|
81171
81180
|
const {
|
|
81172
81181
|
raw,
|
|
@@ -81223,15 +81232,15 @@ function isRequire$1(path) {
|
|
|
81223
81232
|
|
|
81224
81233
|
var properties = {};
|
|
81225
81234
|
|
|
81226
|
-
var traverseProperties$
|
|
81235
|
+
var traverseProperties$6 = {};
|
|
81227
81236
|
|
|
81228
|
-
const {traverse: traverse$b, types: types$
|
|
81237
|
+
const {traverse: traverse$b, types: types$q} = bundle;
|
|
81229
81238
|
const {extract: extract$3} = extract$6;
|
|
81230
81239
|
|
|
81231
81240
|
const {
|
|
81232
81241
|
isObjectExpression: isObjectExpression$5,
|
|
81233
81242
|
isCallExpression: isCallExpression$3,
|
|
81234
|
-
} = types$
|
|
81243
|
+
} = types$q;
|
|
81235
81244
|
|
|
81236
81245
|
const nodeOrPath = (path) => path.node || path;
|
|
81237
81246
|
|
|
@@ -81248,7 +81257,7 @@ function getNode(path) {
|
|
|
81248
81257
|
};
|
|
81249
81258
|
}
|
|
81250
81259
|
|
|
81251
|
-
traverseProperties$
|
|
81260
|
+
traverseProperties$6.traverseProperties = (path, name, {firstLevel = false} = {}) => {
|
|
81252
81261
|
const collector = [];
|
|
81253
81262
|
const node = getNode(path);
|
|
81254
81263
|
|
|
@@ -81288,9 +81297,9 @@ const {
|
|
|
81288
81297
|
isObjectPattern: isObjectPattern$1,
|
|
81289
81298
|
} = bundle.types;
|
|
81290
81299
|
const {extract: extract$2} = extract$6;
|
|
81291
|
-
const {traverseProperties: traverseProperties$
|
|
81300
|
+
const {traverseProperties: traverseProperties$5} = traverseProperties$6;
|
|
81292
81301
|
|
|
81293
|
-
properties.traverseProperties = traverseProperties$
|
|
81302
|
+
properties.traverseProperties = traverseProperties$5;
|
|
81294
81303
|
|
|
81295
81304
|
properties.getProperties = (path, names) => {
|
|
81296
81305
|
const result = {};
|
|
@@ -81332,7 +81341,7 @@ properties.getProperty = (path, name) => {
|
|
|
81332
81341
|
|
|
81333
81342
|
var getLiteralRaw$1 = {};
|
|
81334
81343
|
|
|
81335
|
-
const isString$
|
|
81344
|
+
const isString$c = (a) => typeof a === 'string';
|
|
81336
81345
|
|
|
81337
81346
|
getLiteralRaw$1.getLiteralRaw = (path) => {
|
|
81338
81347
|
const {
|
|
@@ -81341,10 +81350,10 @@ getLiteralRaw$1.getLiteralRaw = (path) => {
|
|
|
81341
81350
|
value,
|
|
81342
81351
|
} = path.node || path;
|
|
81343
81352
|
|
|
81344
|
-
if (isString$
|
|
81353
|
+
if (isString$c(raw))
|
|
81345
81354
|
return raw;
|
|
81346
81355
|
|
|
81347
|
-
if (extra && isString$
|
|
81356
|
+
if (extra && isString$c(extra.raw))
|
|
81348
81357
|
return extra.raw;
|
|
81349
81358
|
|
|
81350
81359
|
return `'${maybeEncode$1(value)}'`;
|
|
@@ -81363,13 +81372,13 @@ var replaceWithMultiple$2 = {};
|
|
|
81363
81372
|
|
|
81364
81373
|
var maybeBody$2 = {};
|
|
81365
81374
|
|
|
81366
|
-
const {types: types$
|
|
81375
|
+
const {types: types$p} = bundle;
|
|
81367
81376
|
const {
|
|
81368
81377
|
isStatement: isStatement$4,
|
|
81369
81378
|
isBlockStatement: isBlockStatement$3,
|
|
81370
81379
|
BlockStatement: BlockStatement$1,
|
|
81371
81380
|
ExpressionStatement: ExpressionStatement$5,
|
|
81372
|
-
} = types$
|
|
81381
|
+
} = types$p;
|
|
81373
81382
|
|
|
81374
81383
|
maybeBody$2.maybeBody = (path, node) => {
|
|
81375
81384
|
const {parentPath} = path;
|
|
@@ -81390,12 +81399,12 @@ maybeBody$2.maybeBody = (path, node) => {
|
|
|
81390
81399
|
|
|
81391
81400
|
var toExpression$3 = {};
|
|
81392
81401
|
|
|
81393
|
-
const {types: types$
|
|
81402
|
+
const {types: types$o} = bundle;
|
|
81394
81403
|
const {
|
|
81395
81404
|
isExpression: isExpression$1,
|
|
81396
81405
|
ExpressionStatement: ExpressionStatement$4,
|
|
81397
81406
|
toStatement,
|
|
81398
|
-
} = types$
|
|
81407
|
+
} = types$o;
|
|
81399
81408
|
|
|
81400
81409
|
toExpression$3.toExpression = (el) => {
|
|
81401
81410
|
const {type} = el;
|
|
@@ -81445,7 +81454,7 @@ replaceWithMultiple$2.replaceWithMultiple = (path, nodes) => {
|
|
|
81445
81454
|
var replaceWith$6 = {};
|
|
81446
81455
|
|
|
81447
81456
|
const {maybeBody} = maybeBody$2;
|
|
81448
|
-
const {assign: assign$
|
|
81457
|
+
const {assign: assign$d} = Object;
|
|
81449
81458
|
|
|
81450
81459
|
replaceWith$6.replaceWith = (path, node) => {
|
|
81451
81460
|
if (path?.parentPath?.isExpressionStatement() && !path.parentPath.isProgram())
|
|
@@ -81456,7 +81465,7 @@ replaceWith$6.replaceWith = (path, node) => {
|
|
|
81456
81465
|
|
|
81457
81466
|
currentPath.replaceWith(node);
|
|
81458
81467
|
|
|
81459
|
-
assign$
|
|
81468
|
+
assign$d(currentPath.node, {
|
|
81460
81469
|
comments,
|
|
81461
81470
|
loc,
|
|
81462
81471
|
});
|
|
@@ -81472,7 +81481,7 @@ replaceWith$7.replaceWith = replaceWith$5;
|
|
|
81472
81481
|
replaceWith$7.replaceWithMultiple = replaceWithMultiple$1;
|
|
81473
81482
|
replaceWith$7.toExpression = toExpression$1;
|
|
81474
81483
|
|
|
81475
|
-
const {types: types$
|
|
81484
|
+
const {types: types$n} = bundle;
|
|
81476
81485
|
|
|
81477
81486
|
const {getBinding, getBindingPath} = getBinding$2;
|
|
81478
81487
|
const {isSimple: isSimple$1} = isSimple$2;
|
|
@@ -81482,13 +81491,13 @@ const {remove: remove$1} = remove$2;
|
|
|
81482
81491
|
const {getExportDefault} = getExportDefault$1;
|
|
81483
81492
|
const {rename} = rename$1;
|
|
81484
81493
|
const {renameProperty} = renameProperty$2;
|
|
81485
|
-
const {setLiteralValue: setLiteralValue$
|
|
81494
|
+
const {setLiteralValue: setLiteralValue$3} = setLiteralValue$4;
|
|
81486
81495
|
const {getPathAfterRequires} = getPathAfterRequires$1;
|
|
81487
81496
|
|
|
81488
81497
|
const {
|
|
81489
|
-
getProperty: getProperty$
|
|
81498
|
+
getProperty: getProperty$5,
|
|
81490
81499
|
getProperties,
|
|
81491
|
-
traverseProperties: traverseProperties$
|
|
81500
|
+
traverseProperties: traverseProperties$4,
|
|
81492
81501
|
} = properties;
|
|
81493
81502
|
|
|
81494
81503
|
const {getLiteralRaw} = getLiteralRaw$1;
|
|
@@ -81505,7 +81514,7 @@ const {
|
|
|
81505
81514
|
isImportDeclaration: isImportDeclaration$1,
|
|
81506
81515
|
isExportDeclaration: isExportDeclaration$4,
|
|
81507
81516
|
isStatement: isStatement$3,
|
|
81508
|
-
} = types$
|
|
81517
|
+
} = types$n;
|
|
81509
81518
|
|
|
81510
81519
|
operate.getBinding = getBinding;
|
|
81511
81520
|
operate.getBindingPath = getBindingPath;
|
|
@@ -81518,11 +81527,11 @@ operate.toExpression = toExpression;
|
|
|
81518
81527
|
operate.isSimple = isSimple$1;
|
|
81519
81528
|
operate.rename = rename;
|
|
81520
81529
|
operate.renameProperty = renameProperty;
|
|
81521
|
-
operate.setLiteralValue = setLiteralValue$
|
|
81530
|
+
operate.setLiteralValue = setLiteralValue$3;
|
|
81522
81531
|
|
|
81523
|
-
operate.getProperty = getProperty$
|
|
81532
|
+
operate.getProperty = getProperty$5;
|
|
81524
81533
|
operate.getProperties = getProperties;
|
|
81525
|
-
operate.traverseProperties = traverseProperties$
|
|
81534
|
+
operate.traverseProperties = traverseProperties$4;
|
|
81526
81535
|
|
|
81527
81536
|
operate.replaceWithMultiple = replaceWithMultiple;
|
|
81528
81537
|
|
|
@@ -81887,13 +81896,13 @@ newline.isCurrentNewLine = (path) => {
|
|
|
81887
81896
|
|
|
81888
81897
|
var indent = {};
|
|
81889
81898
|
|
|
81890
|
-
const {types: types$
|
|
81899
|
+
const {types: types$m} = bundle;
|
|
81891
81900
|
const {isIndented} = is$3;
|
|
81892
81901
|
|
|
81893
81902
|
const {
|
|
81894
81903
|
isStringLiteral: isStringLiteral$5,
|
|
81895
81904
|
isArrayExpression: isArrayExpression$1,
|
|
81896
|
-
} = types$
|
|
81905
|
+
} = types$m;
|
|
81897
81906
|
|
|
81898
81907
|
const isInsideArray$1 = (path) => path.parentPath.isArrayExpression();
|
|
81899
81908
|
|
|
@@ -81956,7 +81965,7 @@ isObjectAfterSimple$1.isObjectAfterSimple = (a) => {
|
|
|
81956
81965
|
return SIMPLE_TYPES.includes(type);
|
|
81957
81966
|
};
|
|
81958
81967
|
|
|
81959
|
-
const {types: types$
|
|
81968
|
+
const {types: types$l} = bundle;
|
|
81960
81969
|
const {
|
|
81961
81970
|
isCoupleLines: isCoupleLines$5,
|
|
81962
81971
|
isStringAndIdentifier,
|
|
@@ -81986,7 +81995,7 @@ const {
|
|
|
81986
81995
|
isStringLiteral: isStringLiteral$4,
|
|
81987
81996
|
isIdentifier: isIdentifier$5,
|
|
81988
81997
|
isFunction: isFunction$2,
|
|
81989
|
-
} = types$
|
|
81998
|
+
} = types$l;
|
|
81990
81999
|
|
|
81991
82000
|
const isNextString = (path) => isStringLiteral$4(path.getNextSibling());
|
|
81992
82001
|
const isPrevString = (path) => isStringLiteral$4(path.getPrevSibling());
|
|
@@ -82440,19 +82449,19 @@ staticBlock.StaticBlock = (path, {print, traverse}) => {
|
|
|
82440
82449
|
|
|
82441
82450
|
var recordExpression = {};
|
|
82442
82451
|
|
|
82443
|
-
const {ObjectExpression: ObjectExpression$
|
|
82452
|
+
const {ObjectExpression: ObjectExpression$5} = objectExpression;
|
|
82444
82453
|
|
|
82445
82454
|
recordExpression.RecordExpression = (path, operations, semantics) => {
|
|
82446
82455
|
const {write} = operations;
|
|
82447
82456
|
write('#');
|
|
82448
|
-
ObjectExpression$
|
|
82457
|
+
ObjectExpression$5(path, operations, semantics);
|
|
82449
82458
|
};
|
|
82450
82459
|
|
|
82451
82460
|
var tupleExpression = {};
|
|
82452
82461
|
|
|
82453
82462
|
var maybe = {};
|
|
82454
82463
|
|
|
82455
|
-
const isString$
|
|
82464
|
+
const isString$b = (a) => typeof a === 'string';
|
|
82456
82465
|
const constant = (a) => () => a;
|
|
82457
82466
|
const {keys: keys$3} = Object;
|
|
82458
82467
|
|
|
@@ -82478,7 +82487,7 @@ var rendy$1 = (template, values, modifiers) => {
|
|
|
82478
82487
|
};
|
|
82479
82488
|
|
|
82480
82489
|
function check$c(template, values) {
|
|
82481
|
-
if (!isString$
|
|
82490
|
+
if (!isString$b(template))
|
|
82482
82491
|
throw Error('template should be a string!');
|
|
82483
82492
|
|
|
82484
82493
|
if (typeof values !== 'object')
|
|
@@ -82540,7 +82549,7 @@ const rendy = rendy$1;
|
|
|
82540
82549
|
const maybeSatisfy = satisfy_1;
|
|
82541
82550
|
|
|
82542
82551
|
const {
|
|
82543
|
-
isProgram: isProgram$
|
|
82552
|
+
isProgram: isProgram$5,
|
|
82544
82553
|
isFile: isFile$1,
|
|
82545
82554
|
File,
|
|
82546
82555
|
ExpressionStatement: ExpressionStatement$2,
|
|
@@ -82562,7 +82571,7 @@ maybe.maybeThrow = (a, path, b) => {
|
|
|
82562
82571
|
|
|
82563
82572
|
const maybeStatement = (ast) => isStatement$2(ast) ? ast : ExpressionStatement$2(ast);
|
|
82564
82573
|
|
|
82565
|
-
const maybeProgram = (ast) => isProgram$
|
|
82574
|
+
const maybeProgram = (ast) => isProgram$5(ast) ? ast : Program$1([
|
|
82566
82575
|
maybeStatement(ast),
|
|
82567
82576
|
]);
|
|
82568
82577
|
|
|
@@ -82595,13 +82604,13 @@ function objectPlugin(plugin, path, printer, options) {
|
|
|
82595
82604
|
after(path, printer);
|
|
82596
82605
|
}
|
|
82597
82606
|
|
|
82598
|
-
const {ArrayExpression: ArrayExpression$
|
|
82607
|
+
const {ArrayExpression: ArrayExpression$6} = arrayExpression;
|
|
82599
82608
|
const {maybeVisitor: maybeVisitor$2} = maybe;
|
|
82600
82609
|
|
|
82601
82610
|
tupleExpression.TupleExpression = (path, operations, semantics) => {
|
|
82602
82611
|
const {write} = operations;
|
|
82603
82612
|
write('#');
|
|
82604
|
-
maybeVisitor$2(ArrayExpression$
|
|
82613
|
+
maybeVisitor$2(ArrayExpression$6, path, operations, semantics);
|
|
82605
82614
|
};
|
|
82606
82615
|
|
|
82607
82616
|
var importExpression = {};
|
|
@@ -82639,8 +82648,8 @@ const {
|
|
|
82639
82648
|
|
|
82640
82649
|
const {NewExpression} = newExpression;
|
|
82641
82650
|
|
|
82642
|
-
const {ObjectExpression: ObjectExpression$
|
|
82643
|
-
const {ObjectProperty: ObjectProperty$
|
|
82651
|
+
const {ObjectExpression: ObjectExpression$4} = objectExpression;
|
|
82652
|
+
const {ObjectProperty: ObjectProperty$5} = objectProperty;
|
|
82644
82653
|
const {ObjectPattern: ObjectPattern$1} = objectPattern;
|
|
82645
82654
|
|
|
82646
82655
|
const {
|
|
@@ -82651,7 +82660,7 @@ const {
|
|
|
82651
82660
|
} = classProperty;
|
|
82652
82661
|
|
|
82653
82662
|
const {AssignmentExpression} = assignmentExpression;
|
|
82654
|
-
const {ArrayExpression: ArrayExpression$
|
|
82663
|
+
const {ArrayExpression: ArrayExpression$5} = arrayExpression;
|
|
82655
82664
|
const {ArrayPattern} = arrayPattern;
|
|
82656
82665
|
const {AssignmentPattern} = assignmentPattern;
|
|
82657
82666
|
const {RestElement} = restElement;
|
|
@@ -82675,7 +82684,7 @@ var expressions$1 = {
|
|
|
82675
82684
|
...unaryExpressions,
|
|
82676
82685
|
...memberExpressions,
|
|
82677
82686
|
ArrayPattern,
|
|
82678
|
-
ArrayExpression: ArrayExpression$
|
|
82687
|
+
ArrayExpression: ArrayExpression$5,
|
|
82679
82688
|
AssignmentExpression,
|
|
82680
82689
|
AssignmentPattern,
|
|
82681
82690
|
BinaryExpression,
|
|
@@ -82689,8 +82698,8 @@ var expressions$1 = {
|
|
|
82689
82698
|
NewExpression,
|
|
82690
82699
|
LogicalExpression,
|
|
82691
82700
|
OptionalCallExpression,
|
|
82692
|
-
ObjectExpression: ObjectExpression$
|
|
82693
|
-
ObjectProperty: ObjectProperty$
|
|
82701
|
+
ObjectExpression: ObjectExpression$4,
|
|
82702
|
+
ObjectProperty: ObjectProperty$5,
|
|
82694
82703
|
ObjectPattern: ObjectPattern$1,
|
|
82695
82704
|
PrivateName: PrivateName$1,
|
|
82696
82705
|
RestElement,
|
|
@@ -84403,7 +84412,7 @@ const {TemplateLiteral} = templateLiteral;
|
|
|
84403
84412
|
const {Identifier: Identifier$2} = identifier;
|
|
84404
84413
|
|
|
84405
84414
|
const {Decorator} = decorator;
|
|
84406
|
-
const {StringLiteral: StringLiteral$
|
|
84415
|
+
const {StringLiteral: StringLiteral$7} = stringLiteral;
|
|
84407
84416
|
|
|
84408
84417
|
var literals$1 = {
|
|
84409
84418
|
Identifier: Identifier$2,
|
|
@@ -84434,7 +84443,7 @@ var literals$1 = {
|
|
|
84434
84443
|
BooleanLiteral(path, {write}) {
|
|
84435
84444
|
write(path.node.value);
|
|
84436
84445
|
},
|
|
84437
|
-
StringLiteral: StringLiteral$
|
|
84446
|
+
StringLiteral: StringLiteral$7,
|
|
84438
84447
|
RegExpLiteral(path, {print}) {
|
|
84439
84448
|
const {raw, pattern} = path.node;
|
|
84440
84449
|
print(raw || `/${pattern}/`);
|
|
@@ -84541,8 +84550,8 @@ tsTypeAliasDeclaration.TSTypeAliasDeclaration = {
|
|
|
84541
84550
|
|
|
84542
84551
|
var tsMappedType = {};
|
|
84543
84552
|
|
|
84544
|
-
const {types: types$
|
|
84545
|
-
const {isTSConditionalType} = types$
|
|
84553
|
+
const {types: types$k} = bundle;
|
|
84554
|
+
const {isTSConditionalType} = types$k;
|
|
84546
84555
|
|
|
84547
84556
|
tsMappedType.TSMappedType = (path, {print, indent, maybe}) => {
|
|
84548
84557
|
const {
|
|
@@ -85010,20 +85019,37 @@ tsTupleType.TSTupleType = (path, {write, traverse, indent, maybe}) => {
|
|
|
85010
85019
|
|
|
85011
85020
|
write('[');
|
|
85012
85021
|
indent.inc();
|
|
85013
|
-
maybe.write.newline(elementTypes.length);
|
|
85014
85022
|
|
|
85015
|
-
|
|
85016
|
-
|
|
85023
|
+
const isSame = isSameType(elementTypes);
|
|
85024
|
+
maybe.write.newline(isSame && elementTypes.length);
|
|
85025
|
+
const n = elementTypes.length - 1;
|
|
85026
|
+
|
|
85027
|
+
for (const [i, elementType] of elementTypes.entries()) {
|
|
85028
|
+
maybe.indent(isSame);
|
|
85017
85029
|
traverse(elementType);
|
|
85018
|
-
write(',');
|
|
85019
|
-
write.newline();
|
|
85030
|
+
maybe.write(i < n || isSame, ',');
|
|
85031
|
+
maybe.write.newline(isSame);
|
|
85032
|
+
maybe.write.space(i < n && !isSame);
|
|
85020
85033
|
}
|
|
85021
85034
|
|
|
85022
85035
|
indent.dec();
|
|
85023
|
-
indent();
|
|
85036
|
+
maybe.indent(isSame && elementTypes.length);
|
|
85024
85037
|
write(']');
|
|
85025
85038
|
};
|
|
85026
85039
|
|
|
85040
|
+
function isSameType(array) {
|
|
85041
|
+
let type;
|
|
85042
|
+
|
|
85043
|
+
for (const current of array) {
|
|
85044
|
+
if (type && current.type !== type)
|
|
85045
|
+
return false;
|
|
85046
|
+
|
|
85047
|
+
({type} = current);
|
|
85048
|
+
}
|
|
85049
|
+
|
|
85050
|
+
return true;
|
|
85051
|
+
}
|
|
85052
|
+
|
|
85027
85053
|
var tsNamedTupleMember = {};
|
|
85028
85054
|
|
|
85029
85055
|
tsNamedTupleMember.TSNamedTupleMember = (path, {print}) => {
|
|
@@ -85698,7 +85724,7 @@ function snakeCase(str) {
|
|
|
85698
85724
|
}
|
|
85699
85725
|
|
|
85700
85726
|
const {stringify: stringify$8} = JSON;
|
|
85701
|
-
const {TYPES: TYPES$2} = types$
|
|
85727
|
+
const {TYPES: TYPES$2} = types$x;
|
|
85702
85728
|
const toSnakeCase = justSnakeCase;
|
|
85703
85729
|
|
|
85704
85730
|
const {codeFrameColumns: codeFrameColumns$1} = bundle;
|
|
@@ -85866,10 +85892,10 @@ function initSemantics(semantics = {}) {
|
|
|
85866
85892
|
}
|
|
85867
85893
|
|
|
85868
85894
|
const {round} = Math;
|
|
85869
|
-
const fullstore$
|
|
85895
|
+
const fullstore$4 = fullstore$5;
|
|
85870
85896
|
const isObject$4 = (a) => a && typeof a === 'object';
|
|
85871
85897
|
const babelTraverse$2 = bundle.traverse;
|
|
85872
|
-
const {TYPES: TYPES$1} = types$
|
|
85898
|
+
const {TYPES: TYPES$1} = types$x;
|
|
85873
85899
|
const baseVisitors = visitors$1;
|
|
85874
85900
|
|
|
85875
85901
|
const {
|
|
@@ -85888,8 +85914,8 @@ const {
|
|
|
85888
85914
|
|
|
85889
85915
|
const {parseOverrides} = overrides;
|
|
85890
85916
|
|
|
85891
|
-
const isString$
|
|
85892
|
-
const {assign: assign$
|
|
85917
|
+
const isString$a = (a) => typeof a === 'string';
|
|
85918
|
+
const {assign: assign$c, freeze} = Object;
|
|
85893
85919
|
|
|
85894
85920
|
const GET = '__';
|
|
85895
85921
|
const get = (path, command) => path.get(command.replace(GET, ''));
|
|
@@ -85940,7 +85966,7 @@ tokenize$1.tokenize = (ast, overrides) => {
|
|
|
85940
85966
|
});
|
|
85941
85967
|
};
|
|
85942
85968
|
|
|
85943
|
-
assign$
|
|
85969
|
+
assign$c(indent, {
|
|
85944
85970
|
inc: incIndent,
|
|
85945
85971
|
dec: decIndent,
|
|
85946
85972
|
});
|
|
@@ -85990,7 +86016,7 @@ tokenize$1.tokenize = (ast, overrides) => {
|
|
|
85990
86016
|
});
|
|
85991
86017
|
};
|
|
85992
86018
|
|
|
85993
|
-
assign$
|
|
86019
|
+
assign$c(write, {
|
|
85994
86020
|
indent,
|
|
85995
86021
|
newline,
|
|
85996
86022
|
linebreak,
|
|
@@ -86001,7 +86027,7 @@ tokenize$1.tokenize = (ast, overrides) => {
|
|
|
86001
86027
|
endOfFile,
|
|
86002
86028
|
});
|
|
86003
86029
|
|
|
86004
|
-
assign$
|
|
86030
|
+
assign$c(maybeWrite, {
|
|
86005
86031
|
newline: maybeNewline,
|
|
86006
86032
|
breakline: maybeBreakline,
|
|
86007
86033
|
linebreak: maybeLinebreak,
|
|
@@ -86015,7 +86041,7 @@ tokenize$1.tokenize = (ast, overrides) => {
|
|
|
86015
86041
|
space: maybeSpace,
|
|
86016
86042
|
};
|
|
86017
86043
|
|
|
86018
|
-
assign$
|
|
86044
|
+
assign$c(maybe.indent, {
|
|
86019
86045
|
inc: maybeIndentInc,
|
|
86020
86046
|
dec: maybeIndentDec,
|
|
86021
86047
|
});
|
|
@@ -86028,7 +86054,7 @@ tokenize$1.tokenize = (ast, overrides) => {
|
|
|
86028
86054
|
traverse,
|
|
86029
86055
|
maybe,
|
|
86030
86056
|
quote,
|
|
86031
|
-
store: fullstore$
|
|
86057
|
+
store: fullstore$4(),
|
|
86032
86058
|
});
|
|
86033
86059
|
|
|
86034
86060
|
const currentTraversers = {
|
|
@@ -86058,7 +86084,7 @@ tokenize$1.tokenize = (ast, overrides) => {
|
|
|
86058
86084
|
traverse,
|
|
86059
86085
|
});
|
|
86060
86086
|
|
|
86061
|
-
assign$
|
|
86087
|
+
assign$c(print, write, {
|
|
86062
86088
|
space,
|
|
86063
86089
|
round,
|
|
86064
86090
|
});
|
|
@@ -86070,14 +86096,14 @@ tokenize$1.tokenize = (ast, overrides) => {
|
|
|
86070
86096
|
|
|
86071
86097
|
const maybePrint = (a, b) => a && print(b);
|
|
86072
86098
|
|
|
86073
|
-
assign$
|
|
86099
|
+
assign$c(maybePrint, {
|
|
86074
86100
|
newline: maybeNewline,
|
|
86075
86101
|
breakline: maybeBreakline,
|
|
86076
86102
|
linebreak: maybeLinebreak,
|
|
86077
86103
|
space: maybeSpace,
|
|
86078
86104
|
});
|
|
86079
86105
|
|
|
86080
|
-
assign$
|
|
86106
|
+
assign$c(printer.maybe, {
|
|
86081
86107
|
print: maybePrint,
|
|
86082
86108
|
});
|
|
86083
86109
|
|
|
@@ -86120,7 +86146,7 @@ const createPrint = (path, {traverse, write}) => (maybeLine) => {
|
|
|
86120
86146
|
};
|
|
86121
86147
|
|
|
86122
86148
|
const computePath = (path, maybeLine) => {
|
|
86123
|
-
if (isString$
|
|
86149
|
+
if (isString$a(maybeLine) && maybeLine.startsWith(GET))
|
|
86124
86150
|
return get(path, maybeLine);
|
|
86125
86151
|
|
|
86126
86152
|
if (isObject$4(maybeLine))
|
|
@@ -86338,9 +86364,9 @@ const putoutPrinter = printer;
|
|
|
86338
86364
|
const {generate: generate$5} = bundle;
|
|
86339
86365
|
|
|
86340
86366
|
const {stringify: stringify$7} = JSON;
|
|
86341
|
-
const {isArray: isArray$
|
|
86367
|
+
const {isArray: isArray$f} = Array;
|
|
86342
86368
|
|
|
86343
|
-
const maybeArray$
|
|
86369
|
+
const maybeArray$9 = (a) => isArray$f(a) ? a : [a, {}];
|
|
86344
86370
|
|
|
86345
86371
|
const btoa$1 = (a) => Buffer.from(a, 'binary').toString('base64');
|
|
86346
86372
|
|
|
@@ -86349,7 +86375,7 @@ const fixStrictMode = (a) => a.replace(`\n\n\n'use strict'`, `\n\n'use strict'`)
|
|
|
86349
86375
|
|
|
86350
86376
|
var print$4 = (ast, options = {}) => {
|
|
86351
86377
|
const {sourceMapName} = options;
|
|
86352
|
-
const [printer = 'putout', printerOptions] = maybeArray$
|
|
86378
|
+
const [printer = 'putout', printerOptions] = maybeArray$9(options.printer);
|
|
86353
86379
|
|
|
86354
86380
|
if (printer === 'recast') {
|
|
86355
86381
|
const printOptions = {
|
|
@@ -86393,7 +86419,7 @@ const {
|
|
|
86393
86419
|
ObjectMethod,
|
|
86394
86420
|
} = bundle.types;
|
|
86395
86421
|
|
|
86396
|
-
const {assign: assign$
|
|
86422
|
+
const {assign: assign$b} = Object;
|
|
86397
86423
|
|
|
86398
86424
|
var traverseObjectExpression$1 = (propertiesPaths) => {
|
|
86399
86425
|
for (const propPath of propertiesPaths) {
|
|
@@ -86407,7 +86433,7 @@ var traverseObjectExpression$1 = (propertiesPaths) => {
|
|
|
86407
86433
|
if (method && isFunctionExpression(value)) {
|
|
86408
86434
|
propPath.replaceWith(ObjectMethod('method', key, value.params, value.body, computed));
|
|
86409
86435
|
|
|
86410
|
-
assign$
|
|
86436
|
+
assign$b(propPath.node, {
|
|
86411
86437
|
id: null,
|
|
86412
86438
|
method: true,
|
|
86413
86439
|
generator: value.generator,
|
|
@@ -86436,7 +86462,7 @@ const {
|
|
|
86436
86462
|
Identifier: Identifier$1,
|
|
86437
86463
|
} = bundle.types;
|
|
86438
86464
|
|
|
86439
|
-
const {assign: assign$
|
|
86465
|
+
const {assign: assign$a} = Object;
|
|
86440
86466
|
|
|
86441
86467
|
var setClassMethod$1 = (path) => {
|
|
86442
86468
|
const {node} = path;
|
|
@@ -86464,7 +86490,7 @@ var setClassMethod$1 = (path) => {
|
|
|
86464
86490
|
});
|
|
86465
86491
|
|
|
86466
86492
|
path.replaceWith(method);
|
|
86467
|
-
assign$
|
|
86493
|
+
assign$a(path.node, {
|
|
86468
86494
|
loc,
|
|
86469
86495
|
expression,
|
|
86470
86496
|
generator,
|
|
@@ -86558,12 +86584,12 @@ var convertImportDeclaration$1 = (path) => {
|
|
|
86558
86584
|
path.node.attributes = attributes;
|
|
86559
86585
|
};
|
|
86560
86586
|
|
|
86561
|
-
const {assign: assign$
|
|
86587
|
+
const {assign: assign$9} = Object;
|
|
86562
86588
|
|
|
86563
86589
|
var convertExportDeclaration$1 = (path) => {
|
|
86564
86590
|
const {attributes = []} = path.node;
|
|
86565
86591
|
|
|
86566
|
-
assign$
|
|
86592
|
+
assign$9(path.node, {
|
|
86567
86593
|
attributes,
|
|
86568
86594
|
});
|
|
86569
86595
|
};
|
|
@@ -86692,7 +86718,7 @@ function getCommentGroup({trailing, leading}) {
|
|
|
86692
86718
|
return 'innerComments'; // Dangling comments, such as `[/* a */]`.
|
|
86693
86719
|
}
|
|
86694
86720
|
|
|
86695
|
-
const isString$
|
|
86721
|
+
const isString$9 = (a) => typeof a === 'string';
|
|
86696
86722
|
const isNumber$1 = (a) => typeof a === 'number';
|
|
86697
86723
|
const isNull = (a) => a === null;
|
|
86698
86724
|
const isBool$3 = (a) => typeof a === 'boolean';
|
|
@@ -86708,7 +86734,7 @@ var setLiteral$1 = (node) => {
|
|
|
86708
86734
|
return;
|
|
86709
86735
|
}
|
|
86710
86736
|
|
|
86711
|
-
if (isString$
|
|
86737
|
+
if (isString$9(value)) {
|
|
86712
86738
|
node.type = 'StringLiteral';
|
|
86713
86739
|
return;
|
|
86714
86740
|
}
|
|
@@ -86764,7 +86790,7 @@ var getAst = (node) => {
|
|
|
86764
86790
|
return ast;
|
|
86765
86791
|
};
|
|
86766
86792
|
|
|
86767
|
-
const {traverse: traverse$a, types: types$
|
|
86793
|
+
const {traverse: traverse$a, types: types$j} = bundle;
|
|
86768
86794
|
|
|
86769
86795
|
const traverseObjectExpression = traverseObjectExpression$1;
|
|
86770
86796
|
const setClassMethod = setClassMethod$1;
|
|
@@ -86790,7 +86816,7 @@ const getAST = getAst;
|
|
|
86790
86816
|
const {
|
|
86791
86817
|
isObjectExpression,
|
|
86792
86818
|
isExportDeclaration,
|
|
86793
|
-
} = types$
|
|
86819
|
+
} = types$j;
|
|
86794
86820
|
|
|
86795
86821
|
var estreeToBabel = (node) => {
|
|
86796
86822
|
const ast = getAST(node);
|
|
@@ -94372,7 +94398,7 @@ const options = options$1;
|
|
|
94372
94398
|
const getFlow = (a) => !a.indexOf('// @flow');
|
|
94373
94399
|
const clean = (a) => a.filter(Boolean);
|
|
94374
94400
|
const initBabel = once$6(() => bundle);
|
|
94375
|
-
const {assign: assign$
|
|
94401
|
+
const {assign: assign$8} = Object;
|
|
94376
94402
|
|
|
94377
94403
|
// There is a difference in options naming for babel and recast
|
|
94378
94404
|
// recast -> sourceFileName
|
|
@@ -94394,7 +94420,7 @@ babel$1.parse = function babelParse(source, {sourceFilename, isTS, isJSX = true,
|
|
|
94394
94420
|
]),
|
|
94395
94421
|
};
|
|
94396
94422
|
|
|
94397
|
-
sourceFilename && assign$
|
|
94423
|
+
sourceFilename && assign$8(parserOptions, {
|
|
94398
94424
|
sourceFilename,
|
|
94399
94425
|
});
|
|
94400
94426
|
|
|
@@ -94516,7 +94542,8 @@ function requireEslintVisitorKeys () {
|
|
|
94516
94542
|
],
|
|
94517
94543
|
ExportAllDeclaration: [
|
|
94518
94544
|
"exported",
|
|
94519
|
-
"source"
|
|
94545
|
+
"source",
|
|
94546
|
+
"attributes"
|
|
94520
94547
|
],
|
|
94521
94548
|
ExportDefaultDeclaration: [
|
|
94522
94549
|
"declaration"
|
|
@@ -94524,7 +94551,8 @@ function requireEslintVisitorKeys () {
|
|
|
94524
94551
|
ExportNamedDeclaration: [
|
|
94525
94552
|
"declaration",
|
|
94526
94553
|
"specifiers",
|
|
94527
|
-
"source"
|
|
94554
|
+
"source",
|
|
94555
|
+
"attributes"
|
|
94528
94556
|
],
|
|
94529
94557
|
ExportSpecifier: [
|
|
94530
94558
|
"exported",
|
|
@@ -94565,15 +94593,21 @@ function requireEslintVisitorKeys () {
|
|
|
94565
94593
|
"consequent",
|
|
94566
94594
|
"alternate"
|
|
94567
94595
|
],
|
|
94596
|
+
ImportAttribute: [
|
|
94597
|
+
"key",
|
|
94598
|
+
"value"
|
|
94599
|
+
],
|
|
94568
94600
|
ImportDeclaration: [
|
|
94569
94601
|
"specifiers",
|
|
94570
|
-
"source"
|
|
94602
|
+
"source",
|
|
94603
|
+
"attributes"
|
|
94571
94604
|
],
|
|
94572
94605
|
ImportDefaultSpecifier: [
|
|
94573
94606
|
"local"
|
|
94574
94607
|
],
|
|
94575
94608
|
ImportExpression: [
|
|
94576
|
-
"source"
|
|
94609
|
+
"source",
|
|
94610
|
+
"options"
|
|
94577
94611
|
],
|
|
94578
94612
|
ImportNamespaceSpecifier: [
|
|
94579
94613
|
"local"
|
|
@@ -95582,7 +95616,7 @@ function requireEspree () {
|
|
|
95582
95616
|
};
|
|
95583
95617
|
};
|
|
95584
95618
|
|
|
95585
|
-
const version$1 = "10.
|
|
95619
|
+
const version$1 = "10.3.0";
|
|
95586
95620
|
|
|
95587
95621
|
/**
|
|
95588
95622
|
* @fileoverview Main Espree file that converts Acorn into Esprima output.
|
|
@@ -107181,7 +107215,7 @@ function isAbsolute(path) {
|
|
|
107181
107215
|
}
|
|
107182
107216
|
|
|
107183
107217
|
// posix version
|
|
107184
|
-
function join$
|
|
107218
|
+
function join$5() {
|
|
107185
107219
|
var paths = Array.prototype.slice.call(arguments, 0);
|
|
107186
107220
|
return normalize(filter$1(paths, function(p, index) {
|
|
107187
107221
|
if (typeof p !== 'string') {
|
|
@@ -107256,7 +107290,7 @@ function dirname$1(path) {
|
|
|
107256
107290
|
return root + dir;
|
|
107257
107291
|
}
|
|
107258
107292
|
|
|
107259
|
-
function basename$
|
|
107293
|
+
function basename$5(path, ext) {
|
|
107260
107294
|
var f = splitPath(path)[2];
|
|
107261
107295
|
// TODO: make this comparison case-insensitive on windows?
|
|
107262
107296
|
if (ext && f.substr(-1 * ext.length) === ext) {
|
|
@@ -107271,12 +107305,12 @@ function extname(path) {
|
|
|
107271
107305
|
}
|
|
107272
107306
|
var _polyfillNode_path = {
|
|
107273
107307
|
extname: extname,
|
|
107274
|
-
basename: basename$
|
|
107308
|
+
basename: basename$5,
|
|
107275
107309
|
dirname: dirname$1,
|
|
107276
107310
|
sep: sep,
|
|
107277
107311
|
delimiter: delimiter,
|
|
107278
107312
|
relative: relative$1,
|
|
107279
|
-
join: join$
|
|
107313
|
+
join: join$5,
|
|
107280
107314
|
isAbsolute: isAbsolute,
|
|
107281
107315
|
normalize: normalize,
|
|
107282
107316
|
resolve: resolve
|
|
@@ -107301,13 +107335,13 @@ var substr = 'ab'.substr(-1) === 'b' ?
|
|
|
107301
107335
|
|
|
107302
107336
|
var _polyfillNode_path$1 = /*#__PURE__*/Object.freeze({
|
|
107303
107337
|
__proto__: null,
|
|
107304
|
-
basename: basename$
|
|
107338
|
+
basename: basename$5,
|
|
107305
107339
|
default: _polyfillNode_path,
|
|
107306
107340
|
delimiter: delimiter,
|
|
107307
107341
|
dirname: dirname$1,
|
|
107308
107342
|
extname: extname,
|
|
107309
107343
|
isAbsolute: isAbsolute,
|
|
107310
|
-
join: join$
|
|
107344
|
+
join: join$5,
|
|
107311
107345
|
normalize: normalize,
|
|
107312
107346
|
relative: relative$1,
|
|
107313
107347
|
resolve: resolve,
|
|
@@ -112406,7 +112440,7 @@ hermes$1.parse = function hermesParse(source) {
|
|
|
112406
112440
|
return parser.parse(source, options);
|
|
112407
112441
|
};
|
|
112408
112442
|
|
|
112409
|
-
var tryCatch$
|
|
112443
|
+
var tryCatch$8 = (fn, ...args) => {
|
|
112410
112444
|
try {
|
|
112411
112445
|
return [null, fn(...args)];
|
|
112412
112446
|
} catch(e) {
|
|
@@ -112414,11 +112448,11 @@ var tryCatch$9 = (fn, ...args) => {
|
|
|
112414
112448
|
}
|
|
112415
112449
|
};
|
|
112416
112450
|
|
|
112417
|
-
const tryCatch$
|
|
112451
|
+
const tryCatch$7 = tryCatch$8;
|
|
112418
112452
|
|
|
112419
112453
|
var secondChance$1 = (fn, source, messages, args) => {
|
|
112420
112454
|
const [a, ...others] = args;
|
|
112421
|
-
const [errorA, resultA] = tryCatch$
|
|
112455
|
+
const [errorA, resultA] = tryCatch$7(fn, source, a);
|
|
112422
112456
|
|
|
112423
112457
|
if (!errorA)
|
|
112424
112458
|
return resultA;
|
|
@@ -112427,7 +112461,7 @@ var secondChance$1 = (fn, source, messages, args) => {
|
|
|
112427
112461
|
throw errorA;
|
|
112428
112462
|
|
|
112429
112463
|
for (const b of others) {
|
|
112430
|
-
const [errorB, resultB] = tryCatch$
|
|
112464
|
+
const [errorB, resultB] = tryCatch$7(fn, source, b);
|
|
112431
112465
|
|
|
112432
112466
|
if (!errorB)
|
|
112433
112467
|
return resultB;
|
|
@@ -112516,13 +112550,13 @@ function customParse(source, {parser, isTS, isFlow, isJSX, isRecovery}) {
|
|
|
112516
112550
|
return commonjsRequire(parser).parse(source);
|
|
112517
112551
|
}
|
|
112518
112552
|
|
|
112519
|
-
const {types: types$
|
|
112553
|
+
const {types: types$i} = bundle;
|
|
112520
112554
|
const {
|
|
112521
|
-
StringLiteral: StringLiteral$
|
|
112555
|
+
StringLiteral: StringLiteral$6,
|
|
112522
112556
|
ExpressionStatement,
|
|
112523
|
-
} = types$
|
|
112557
|
+
} = types$i;
|
|
112524
112558
|
|
|
112525
|
-
const {assign: assign$
|
|
112559
|
+
const {assign: assign$7} = Object;
|
|
112526
112560
|
|
|
112527
112561
|
var moveOutDirectives$1 = (ast) => {
|
|
112528
112562
|
const {body, directives} = ast.program;
|
|
@@ -112535,7 +112569,7 @@ var moveOutDirectives$1 = (ast) => {
|
|
|
112535
112569
|
for (const directive of directives) {
|
|
112536
112570
|
const {leadingComments} = directive;
|
|
112537
112571
|
const {value} = directive.value;
|
|
112538
|
-
const expression = assign$
|
|
112572
|
+
const expression = assign$7(ExpressionStatement(StringLiteral$6(value)), {
|
|
112539
112573
|
leadingComments,
|
|
112540
112574
|
});
|
|
112541
112575
|
|
|
@@ -112859,9 +112893,9 @@ var require$$1 = /*@__PURE__*/getAugmentedNamespace(_polyfillNode_module$1);
|
|
|
112859
112893
|
|
|
112860
112894
|
const {createRequire} = require$$1;
|
|
112861
112895
|
|
|
112862
|
-
const tryCatch$
|
|
112896
|
+
const tryCatch$6 = tryCatch$8;
|
|
112863
112897
|
const once$1 = onceExports;
|
|
112864
|
-
const {assign: assign$
|
|
112898
|
+
const {assign: assign$6} = Object;
|
|
112865
112899
|
|
|
112866
112900
|
const bigFirst = (a) => `${a[0].toUpperCase()}${a.slice(1)}`;
|
|
112867
112901
|
|
|
@@ -112871,11 +112905,11 @@ const load = (type) => ({name, namespace}) => {
|
|
|
112871
112905
|
if (!pluginPath)
|
|
112872
112906
|
throw Error(`${bigFirst(type)} "${namespace}-${type}-${name}" could not be found!`);
|
|
112873
112907
|
|
|
112874
|
-
const [error, result] = tryCatch$
|
|
112908
|
+
const [error, result] = tryCatch$6(customRequire, pluginPath);
|
|
112875
112909
|
|
|
112876
112910
|
/* c8 ignore start */
|
|
112877
112911
|
if (error?.code === 'ERR_REQUIRE_ESM')
|
|
112878
|
-
assign$
|
|
112912
|
+
assign$6(error, {
|
|
112879
112913
|
message: `☝️ Looks like '${name}' is ESM, use 'await putoutAsync()' instead`,
|
|
112880
112914
|
name,
|
|
112881
112915
|
});
|
|
@@ -112923,12 +112957,12 @@ function getModulePath(name) {
|
|
|
112923
112957
|
const customRequire = createCustomRequire();
|
|
112924
112958
|
const putoutRequire = createPutoutRequire();
|
|
112925
112959
|
|
|
112926
|
-
[, path] = tryCatch$
|
|
112960
|
+
[, path] = tryCatch$6(putoutRequire.resolve, name);
|
|
112927
112961
|
|
|
112928
112962
|
if (path)
|
|
112929
112963
|
return [path, putoutRequire];
|
|
112930
112964
|
|
|
112931
|
-
[, path] = tryCatch$
|
|
112965
|
+
[, path] = tryCatch$6(customRequire.resolve, name);
|
|
112932
112966
|
|
|
112933
112967
|
return [path, customRequire];
|
|
112934
112968
|
}
|
|
@@ -112962,7 +112996,7 @@ const {nanomemoize} = require$$0$1;
|
|
|
112962
112996
|
const tryToCatch = tryToCatch$1;
|
|
112963
112997
|
const {simpleImport} = simpleImport$1;
|
|
112964
112998
|
|
|
112965
|
-
const {assign: assign$
|
|
112999
|
+
const {assign: assign$5} = Object;
|
|
112966
113000
|
const stub$2 = () => () => {};
|
|
112967
113001
|
|
|
112968
113002
|
asyncLoader.createAsyncLoader = (type) => nanomemoize(async (name, load) => {
|
|
@@ -112991,14 +113025,14 @@ async function cleverLoad(names, load = simpleImport) {
|
|
|
112991
113025
|
if (e.code === 'ERR_MODULE_NOT_FOUND')
|
|
112992
113026
|
continue;
|
|
112993
113027
|
|
|
112994
|
-
assign$
|
|
113028
|
+
assign$5(e, {
|
|
112995
113029
|
message: `${name}: ${e.message}`,
|
|
112996
113030
|
});
|
|
112997
113031
|
|
|
112998
113032
|
throw e;
|
|
112999
113033
|
}
|
|
113000
113034
|
|
|
113001
|
-
assign$
|
|
113035
|
+
assign$5(e, {
|
|
113002
113036
|
message: e.message.replace(/\simported.*/, ''),
|
|
113003
113037
|
});
|
|
113004
113038
|
|
|
@@ -113008,7 +113042,7 @@ async function cleverLoad(names, load = simpleImport) {
|
|
|
113008
113042
|
var parsePluginNames$2 = {};
|
|
113009
113043
|
|
|
113010
113044
|
const isStr$4 = (a) => typeof a === 'string';
|
|
113011
|
-
const {isArray: isArray$
|
|
113045
|
+
const {isArray: isArray$e} = Array;
|
|
113012
113046
|
const {entries: entries$9} = Object;
|
|
113013
113047
|
|
|
113014
113048
|
parsePluginNames$2.parsePluginNames = (plugins) => {
|
|
@@ -113020,7 +113054,7 @@ parsePluginNames$2.parsePluginNames = (plugins) => {
|
|
|
113020
113054
|
continue;
|
|
113021
113055
|
}
|
|
113022
113056
|
|
|
113023
|
-
if (isArray$
|
|
113057
|
+
if (isArray$e(plugin)) {
|
|
113024
113058
|
const [pluginName, fn] = plugin;
|
|
113025
113059
|
result.push([pluginName, fn]);
|
|
113026
113060
|
continue;
|
|
@@ -113033,7 +113067,7 @@ parsePluginNames$2.parsePluginNames = (plugins) => {
|
|
|
113033
113067
|
};
|
|
113034
113068
|
|
|
113035
113069
|
const isStr$3 = (a) => typeof a === 'string';
|
|
113036
|
-
const {isArray: isArray$
|
|
113070
|
+
const {isArray: isArray$d} = Array;
|
|
113037
113071
|
|
|
113038
113072
|
const isOn = (a) => a === 'on';
|
|
113039
113073
|
const isOff = (a) => a === 'off';
|
|
@@ -113047,7 +113081,7 @@ var parseProcessorNames$1 = (plugins) => {
|
|
|
113047
113081
|
continue;
|
|
113048
113082
|
}
|
|
113049
113083
|
|
|
113050
|
-
if (isArray$
|
|
113084
|
+
if (isArray$d(plugin)) {
|
|
113051
113085
|
const [pluginName, fn] = plugin;
|
|
113052
113086
|
|
|
113053
113087
|
if (isOff(fn))
|
|
@@ -113092,7 +113126,7 @@ var loadPluginsAsync$1 = {};
|
|
|
113092
113126
|
|
|
113093
113127
|
var parseRules$3 = {};
|
|
113094
113128
|
|
|
113095
|
-
const {isArray: isArray$
|
|
113129
|
+
const {isArray: isArray$c} = Array;
|
|
113096
113130
|
const isBool$2 = (a) => typeof a === 'boolean';
|
|
113097
113131
|
const isStr$2 = (a) => typeof a === 'string';
|
|
113098
113132
|
const isObj$1 = (a) => typeof a === 'object';
|
|
@@ -113146,7 +113180,7 @@ parseRules$3.parseRules = (rules) => {
|
|
|
113146
113180
|
continue;
|
|
113147
113181
|
}
|
|
113148
113182
|
|
|
113149
|
-
const looksLikeArray = isArray$
|
|
113183
|
+
const looksLikeArray = isArray$c(value);
|
|
113150
113184
|
const looksLikeNormalArray = looksLikeArray && value.length;
|
|
113151
113185
|
|
|
113152
113186
|
if (looksLikeNormalArray) {
|
|
@@ -113348,8 +113382,8 @@ var filterEnabledPlugins$2 = {};
|
|
|
113348
113382
|
|
|
113349
113383
|
const {isEnabled: isEnabled$2, mergeRules} = rules;
|
|
113350
113384
|
|
|
113351
|
-
const {isArray: isArray$
|
|
113352
|
-
const maybeTuple = (a) => isArray$
|
|
113385
|
+
const {isArray: isArray$b} = Array;
|
|
113386
|
+
const maybeTuple = (a) => isArray$b(a) ? a : ['on', a];
|
|
113353
113387
|
|
|
113354
113388
|
// Would be great to have ability to filter
|
|
113355
113389
|
// disabled plugins and prevent them from loading
|
|
@@ -113391,7 +113425,7 @@ function isExectRuleEnabled(name, status, rules) {
|
|
|
113391
113425
|
|
|
113392
113426
|
var check$9 = {};
|
|
113393
113427
|
|
|
113394
|
-
const isString$
|
|
113428
|
+
const isString$8 = (a) => typeof a === 'string';
|
|
113395
113429
|
|
|
113396
113430
|
check$9.check = (options) => {
|
|
113397
113431
|
if (!options || typeof options !== 'object')
|
|
@@ -113399,11 +113433,11 @@ check$9.check = (options) => {
|
|
|
113399
113433
|
};
|
|
113400
113434
|
|
|
113401
113435
|
check$9.checkRule = (rule) => {
|
|
113402
|
-
if (!isString$
|
|
113436
|
+
if (!isString$8(rule))
|
|
113403
113437
|
throw Error(`☝️ Looks like plugin name type is not 'string', but: '${typeof rule}'`);
|
|
113404
113438
|
};
|
|
113405
113439
|
|
|
113406
|
-
const {basename: basename$
|
|
113440
|
+
const {basename: basename$4} = require$$0$2;
|
|
113407
113441
|
|
|
113408
113442
|
const {
|
|
113409
113443
|
parseRules: parseRules$1,
|
|
@@ -113498,7 +113532,7 @@ function extendRules$1(rule, plugin) {
|
|
|
113498
113532
|
|
|
113499
113533
|
function parseRuleName(rule) {
|
|
113500
113534
|
if (rule.startsWith('import:')) {
|
|
113501
|
-
const shortName = basename$
|
|
113535
|
+
const shortName = basename$4(rule.replace('import:', ''));
|
|
113502
113536
|
|
|
113503
113537
|
return shortName.replace('plugin-', '');
|
|
113504
113538
|
}
|
|
@@ -113522,7 +113556,7 @@ const {
|
|
|
113522
113556
|
|
|
113523
113557
|
const {filterEnabledPlugins} = filterEnabledPlugins$2;
|
|
113524
113558
|
const {check: check$7, checkRule} = check$9;
|
|
113525
|
-
const {isArray: isArray$
|
|
113559
|
+
const {isArray: isArray$a} = Array;
|
|
113526
113560
|
|
|
113527
113561
|
lib$1.loadPluginsAsync = loadPluginsAsync;
|
|
113528
113562
|
lib$1.loadProcessorsAsync = async (options, load) => {
|
|
@@ -113590,7 +113624,7 @@ function parseRule(rule) {
|
|
|
113590
113624
|
.replace('@putout/plugin-', '');
|
|
113591
113625
|
}
|
|
113592
113626
|
|
|
113593
|
-
const maybeFromTuple = (a) => isArray$
|
|
113627
|
+
const maybeFromTuple = (a) => isArray$a(a) ? a[1] : a;
|
|
113594
113628
|
|
|
113595
113629
|
function loadPlugins({items, loadedRules}) {
|
|
113596
113630
|
const plugins = [];
|
|
@@ -114361,7 +114395,7 @@ var common = setup;
|
|
|
114361
114395
|
var browserExports = browser.exports;
|
|
114362
114396
|
browserExports.default;
|
|
114363
114397
|
|
|
114364
|
-
const tryCatch$
|
|
114398
|
+
const tryCatch$5 = tryCatch$8;
|
|
114365
114399
|
const debug$4 = browserExports('putout:runner:fix');
|
|
114366
114400
|
const {enabled} = debug$4;
|
|
114367
114401
|
const {stringify: stringify$5} = JSON;
|
|
@@ -114385,7 +114419,7 @@ const chooseFixArgs = ({path, pathOptions, options}) => {
|
|
|
114385
114419
|
};
|
|
114386
114420
|
|
|
114387
114421
|
const tryToFix = (fix, {path, pathOptions, position, options}) => {
|
|
114388
|
-
const [e] = tryCatch$
|
|
114422
|
+
const [e] = tryCatch$5(fix, ...chooseFixArgs({
|
|
114389
114423
|
path,
|
|
114390
114424
|
pathOptions,
|
|
114391
114425
|
options,
|
|
@@ -114460,14 +114494,14 @@ function validatePath(path) {
|
|
|
114460
114494
|
throw Error(`☝️ Looks like 'push' called without a 'path' argument.`);
|
|
114461
114495
|
}
|
|
114462
114496
|
|
|
114463
|
-
const {isArray: isArray$
|
|
114464
|
-
const maybeArray$
|
|
114497
|
+
const {isArray: isArray$9} = Array;
|
|
114498
|
+
const maybeArray$8 = (a) => isArray$9(a) ? a : [a];
|
|
114465
114499
|
|
|
114466
114500
|
var maybeArray_1 = (a) => {
|
|
114467
114501
|
if (!a)
|
|
114468
114502
|
return [];
|
|
114469
114503
|
|
|
114470
|
-
return maybeArray$
|
|
114504
|
+
return maybeArray$8(a);
|
|
114471
114505
|
};
|
|
114472
114506
|
|
|
114473
114507
|
var validate$2 = {};
|
|
@@ -114485,7 +114519,7 @@ var store = {};
|
|
|
114485
114519
|
const {
|
|
114486
114520
|
values,
|
|
114487
114521
|
entries: entries$7,
|
|
114488
|
-
assign: assign$
|
|
114522
|
+
assign: assign$4,
|
|
114489
114523
|
} = Object;
|
|
114490
114524
|
|
|
114491
114525
|
const toArray = (a) => Array.from(a);
|
|
@@ -114511,7 +114545,7 @@ store.upStore = createStore({
|
|
|
114511
114545
|
},
|
|
114512
114546
|
set(map, name, data) {
|
|
114513
114547
|
map[name] = map[name] || {};
|
|
114514
|
-
assign$
|
|
114548
|
+
assign$4(map[name], data);
|
|
114515
114549
|
},
|
|
114516
114550
|
});
|
|
114517
114551
|
|
|
@@ -114576,7 +114610,7 @@ const {generate: generate$2} = parser$6;
|
|
|
114576
114610
|
|
|
114577
114611
|
const runFix$2 = runFix$3;
|
|
114578
114612
|
const {getPosition: getPosition$1} = getPosition$2;
|
|
114579
|
-
const maybeArray$
|
|
114613
|
+
const maybeArray$7 = maybeArray_1;
|
|
114580
114614
|
const {validate: validate$1} = validate$2;
|
|
114581
114615
|
|
|
114582
114616
|
const {
|
|
@@ -114590,18 +114624,18 @@ const {
|
|
|
114590
114624
|
const shouldSkip = (a) => !a.parent;
|
|
114591
114625
|
const {merge: merge$2} = traverse$9.visitors;
|
|
114592
114626
|
|
|
114593
|
-
const {assign: assign$
|
|
114627
|
+
const {assign: assign$3} = Object;
|
|
114594
114628
|
|
|
114595
114629
|
const parse$3 = (name, plugin, options) => {
|
|
114596
114630
|
const list = [];
|
|
114597
114631
|
|
|
114598
114632
|
if (plugin[name]) {
|
|
114599
114633
|
validate$1(name, plugin[name]);
|
|
114600
|
-
list.push(...maybeArray$
|
|
114634
|
+
list.push(...maybeArray$7(plugin[name]()));
|
|
114601
114635
|
}
|
|
114602
114636
|
|
|
114603
114637
|
if (options[name])
|
|
114604
|
-
list.push(...maybeArray$
|
|
114638
|
+
list.push(...maybeArray$7(options[name]));
|
|
114605
114639
|
|
|
114606
114640
|
return list;
|
|
114607
114641
|
};
|
|
@@ -114643,7 +114677,7 @@ var mergeVisitors$1 = (pluginsToMerge, {fix, shebang, template}) => {
|
|
|
114643
114677
|
if (!visitor)
|
|
114644
114678
|
throw Error(`☝️ Visitors cannot be empty in "${rule}"`);
|
|
114645
114679
|
|
|
114646
|
-
assign$
|
|
114680
|
+
assign$3(options, {
|
|
114647
114681
|
include: parse$3('include', plugin, options),
|
|
114648
114682
|
exclude: parse$3('exclude', plugin, options),
|
|
114649
114683
|
});
|
|
@@ -114717,7 +114751,7 @@ function getStore(plugin, {fix, rule, shebang, msg, options}) {
|
|
|
114717
114751
|
|
|
114718
114752
|
mergeVisitors$1.default;
|
|
114719
114753
|
|
|
114720
|
-
const {traverse: babelTraverse$1, types: types$
|
|
114754
|
+
const {traverse: babelTraverse$1, types: types$h} = bundle;
|
|
114721
114755
|
|
|
114722
114756
|
const {generate: generate$1} = parser$6;
|
|
114723
114757
|
const {merge: merge$1} = babelTraverse$1.visitors;
|
|
@@ -114736,7 +114770,7 @@ var superFind$1 = function superFind({rule, find, ast, options, template}) {
|
|
|
114736
114770
|
template,
|
|
114737
114771
|
}),
|
|
114738
114772
|
generate: generate$1,
|
|
114739
|
-
types: types$
|
|
114773
|
+
types: types$h,
|
|
114740
114774
|
push,
|
|
114741
114775
|
options,
|
|
114742
114776
|
});
|
|
@@ -114760,7 +114794,7 @@ function traverse$8({rule, options, template}) {
|
|
|
114760
114794
|
}
|
|
114761
114795
|
|
|
114762
114796
|
const log$5 = browserExports('putout:runner:include');
|
|
114763
|
-
const maybeArray$
|
|
114797
|
+
const maybeArray$6 = maybeArray_1;
|
|
114764
114798
|
const {validate} = validate$2;
|
|
114765
114799
|
|
|
114766
114800
|
const stub$1 = () => [];
|
|
@@ -114787,7 +114821,7 @@ var include$2 = ({rule, plugin, msg, options}) => {
|
|
|
114787
114821
|
...options,
|
|
114788
114822
|
exclude: [
|
|
114789
114823
|
...exclude(),
|
|
114790
|
-
...maybeArray$
|
|
114824
|
+
...maybeArray$6(options.exclude),
|
|
114791
114825
|
],
|
|
114792
114826
|
},
|
|
114793
114827
|
plugin: {
|
|
@@ -114916,7 +114950,7 @@ function check$5(selector) {
|
|
|
114916
114950
|
var is$2 = {};
|
|
114917
114951
|
|
|
114918
114952
|
const {template: template$8} = parser$6;
|
|
114919
|
-
const {types: types$
|
|
114953
|
+
const {types: types$g} = bundle;
|
|
114920
114954
|
const {
|
|
114921
114955
|
isBlockStatement: isBlockStatement$1,
|
|
114922
114956
|
isBooleanLiteral,
|
|
@@ -114932,7 +114966,7 @@ const {
|
|
|
114932
114966
|
isJSXAttribute,
|
|
114933
114967
|
isTSTypeReference: isTSTypeReference$1,
|
|
114934
114968
|
isTSTypeParameterDeclaration,
|
|
114935
|
-
} = types$
|
|
114969
|
+
} = types$g;
|
|
114936
114970
|
|
|
114937
114971
|
const isStr$1 = (a) => typeof a === 'string';
|
|
114938
114972
|
|
|
@@ -115042,7 +115076,7 @@ const isBool$1 = (a, b) => {
|
|
|
115042
115076
|
};
|
|
115043
115077
|
|
|
115044
115078
|
const isEqualType$1 = (a, b) => a.type === b.type;
|
|
115045
|
-
const {isArray: isArray$
|
|
115079
|
+
const {isArray: isArray$8} = Array;
|
|
115046
115080
|
|
|
115047
115081
|
is$2.isId = isId$1;
|
|
115048
115082
|
is$2.isBool = isBool$1;
|
|
@@ -115065,7 +115099,7 @@ is$2.isAnyLiteral = (a, b) => {
|
|
|
115065
115099
|
};
|
|
115066
115100
|
|
|
115067
115101
|
is$2.isArgs = (a) => {
|
|
115068
|
-
const b = !isArray$
|
|
115102
|
+
const b = !isArray$8(a) ? a : a[0];
|
|
115069
115103
|
|
|
115070
115104
|
return isIdentifier$3(b, {
|
|
115071
115105
|
name: ARGS,
|
|
@@ -115095,12 +115129,12 @@ is$2.isEqualTypeParams = (a, b) => {
|
|
|
115095
115129
|
};
|
|
115096
115130
|
|
|
115097
115131
|
is$2.isLinkedArgs = (a) => {
|
|
115098
|
-
const b = !isArray$
|
|
115132
|
+
const b = !isArray$8(a) ? a : a[0];
|
|
115099
115133
|
return isIdentifier$3(b) && LINKED_ARGS.test(b.name);
|
|
115100
115134
|
};
|
|
115101
115135
|
|
|
115102
115136
|
is$2.isJSXChildren = (a) => {
|
|
115103
|
-
const b = !isArray$
|
|
115137
|
+
const b = !isArray$8(a) ? a : a[0];
|
|
115104
115138
|
|
|
115105
115139
|
return isJSXText$1(b, {
|
|
115106
115140
|
value: JSX_CHILDREN,
|
|
@@ -115108,7 +115142,7 @@ is$2.isJSXChildren = (a) => {
|
|
|
115108
115142
|
};
|
|
115109
115143
|
|
|
115110
115144
|
is$2.isJSXAttributes = (a) => {
|
|
115111
|
-
const b = !isArray$
|
|
115145
|
+
const b = !isArray$8(a) ? a : a[0];
|
|
115112
115146
|
|
|
115113
115147
|
if (!isJSXAttribute(b))
|
|
115114
115148
|
return false;
|
|
@@ -115140,27 +115174,27 @@ is$2.isLinkedRegExp = (a, b) => {
|
|
|
115140
115174
|
};
|
|
115141
115175
|
|
|
115142
115176
|
is$2.isPath = (path) => Boolean(path.node);
|
|
115143
|
-
is$2.isArray = isArray$
|
|
115177
|
+
is$2.isArray = isArray$8;
|
|
115144
115178
|
|
|
115145
115179
|
is$2.isObject = (a) => {
|
|
115146
115180
|
if (!a)
|
|
115147
115181
|
return false;
|
|
115148
115182
|
|
|
115149
|
-
if (isArray$
|
|
115183
|
+
if (isArray$8(a))
|
|
115150
115184
|
return false;
|
|
115151
115185
|
|
|
115152
115186
|
return typeof a === 'object';
|
|
115153
115187
|
};
|
|
115154
115188
|
|
|
115155
115189
|
is$2.isArrays = (a, b) => {
|
|
115156
|
-
if (!isArray$
|
|
115190
|
+
if (!isArray$8(a) || !isArray$8(b))
|
|
115157
115191
|
return false;
|
|
115158
115192
|
|
|
115159
115193
|
return a.length === b.length;
|
|
115160
115194
|
};
|
|
115161
115195
|
|
|
115162
115196
|
is$2.isImports = (a) => {
|
|
115163
|
-
const b = !isArray$
|
|
115197
|
+
const b = !isArray$8(a) ? a : a[0];
|
|
115164
115198
|
|
|
115165
115199
|
if (!isImportDefaultSpecifier(b))
|
|
115166
115200
|
return false;
|
|
@@ -115171,7 +115205,7 @@ is$2.isImports = (a) => {
|
|
|
115171
115205
|
};
|
|
115172
115206
|
|
|
115173
115207
|
is$2.isExports = (a) => {
|
|
115174
|
-
const b = !isArray$
|
|
115208
|
+
const b = !isArray$8(a) ? a : a[0];
|
|
115175
115209
|
|
|
115176
115210
|
if (!isExportSpecifier(b))
|
|
115177
115211
|
return false;
|
|
@@ -115275,7 +115309,7 @@ is$2.isInsideTypeReference = (path) => path.isIdentifier() && path.parentPath?.i
|
|
|
115275
115309
|
|
|
115276
115310
|
const jessy = jessy$1;
|
|
115277
115311
|
const nessy = nessy$1;
|
|
115278
|
-
const {traverse: traverse$7, types: types$
|
|
115312
|
+
const {traverse: traverse$7, types: types$f} = bundle;
|
|
115279
115313
|
const {template: template$7} = parser$6;
|
|
115280
115314
|
|
|
115281
115315
|
const {replaceWith: replaceWith$3, extract} = operate;
|
|
@@ -115299,13 +115333,13 @@ const {
|
|
|
115299
115333
|
isStringLiteral: isStringLiteral$3,
|
|
115300
115334
|
isTemplateLiteral: isTemplateLiteral$1,
|
|
115301
115335
|
TemplateElement,
|
|
115302
|
-
} = types$
|
|
115336
|
+
} = types$f;
|
|
115303
115337
|
|
|
115304
115338
|
const {extractExpression: extractExpression$1} = template$7;
|
|
115305
115339
|
|
|
115306
115340
|
const {entries: entries$6} = Object;
|
|
115307
115341
|
const isNumber = (a) => typeof a === 'number';
|
|
115308
|
-
const isString$
|
|
115342
|
+
const isString$7 = (a) => typeof a === 'string';
|
|
115309
115343
|
|
|
115310
115344
|
const parseNode$1 = (a) => a.node || a;
|
|
115311
115345
|
const {stringify: stringify$3} = JSON;
|
|
@@ -115313,7 +115347,7 @@ const {stringify: stringify$3} = JSON;
|
|
|
115313
115347
|
const BODY_AND_CLASS_REG = /\.body\.0(\.key)?$/;
|
|
115314
115348
|
|
|
115315
115349
|
vars.getTemplateValues = (node, str) => {
|
|
115316
|
-
if (!isString$
|
|
115350
|
+
if (!isString$7(str))
|
|
115317
115351
|
throw Error(`☝️ Looks like argument 'template' of 'getTemplateValues(node, template)': is not a string, but '${stringify$3(str)}'`);
|
|
115318
115352
|
|
|
115319
115353
|
node = parseNode$1(node);
|
|
@@ -115452,7 +115486,7 @@ var log$4 = {exports: {}};
|
|
|
115452
115486
|
|
|
115453
115487
|
const debug$3 = browserExports('putout:compare');
|
|
115454
115488
|
|
|
115455
|
-
const {isArray: isArray$
|
|
115489
|
+
const {isArray: isArray$7} = Array;
|
|
115456
115490
|
const isObject$2 = (a) => a && typeof a === 'object';
|
|
115457
115491
|
|
|
115458
115492
|
log$4.exports = (a, b) => {
|
|
@@ -115467,7 +115501,7 @@ log$4.exports = (a, b) => {
|
|
|
115467
115501
|
|
|
115468
115502
|
log$4.exports._parseValue = parseValue;
|
|
115469
115503
|
function parseValue(a) {
|
|
115470
|
-
if (isArray$
|
|
115504
|
+
if (isArray$7(a) && a[0]) {
|
|
115471
115505
|
const [{
|
|
115472
115506
|
type,
|
|
115473
115507
|
name,
|
|
@@ -115492,14 +115526,14 @@ function parseValue(a) {
|
|
|
115492
115526
|
|
|
115493
115527
|
var logExports = log$4.exports;
|
|
115494
115528
|
|
|
115495
|
-
const {types: types$
|
|
115529
|
+
const {types: types$e} = bundle;
|
|
115496
115530
|
const {
|
|
115497
115531
|
isIdentifier: isIdentifier$1,
|
|
115498
115532
|
isLiteral,
|
|
115499
115533
|
isStringLiteral: isStringLiteral$2,
|
|
115500
115534
|
isTemplateElement: isTemplateElement$1,
|
|
115501
115535
|
isTSTypeReference,
|
|
115502
|
-
} = types$
|
|
115536
|
+
} = types$e;
|
|
115503
115537
|
|
|
115504
115538
|
const parseName = (node) => {
|
|
115505
115539
|
node = node[0] || node;
|
|
@@ -115568,13 +115602,13 @@ const {
|
|
|
115568
115602
|
isLinkedRegExp: isLinkedRegExp$1,
|
|
115569
115603
|
} = is$2;
|
|
115570
115604
|
|
|
115571
|
-
const {types: types$
|
|
115605
|
+
const {types: types$d} = bundle;
|
|
115572
115606
|
const {
|
|
115573
115607
|
isClassBody,
|
|
115574
115608
|
isBlock,
|
|
115575
115609
|
isJSXText,
|
|
115576
115610
|
isTemplateElement,
|
|
115577
|
-
} = types$
|
|
115611
|
+
} = types$d;
|
|
115578
115612
|
|
|
115579
115613
|
const isEmptyBlock = (a) => isBlock(a) && !a.body.length;
|
|
115580
115614
|
const isPrimitive = (a) => typeof a !== 'object' || a === null;
|
|
@@ -115683,7 +115717,7 @@ function compareJSXTexts(node, template) {
|
|
|
115683
115717
|
|
|
115684
115718
|
var topLevelComparators = {};
|
|
115685
115719
|
|
|
115686
|
-
const {types: types$
|
|
115720
|
+
const {types: types$c} = bundle;
|
|
115687
115721
|
const {
|
|
115688
115722
|
isEqualBody,
|
|
115689
115723
|
isEqualAnyObject,
|
|
@@ -115697,7 +115731,7 @@ const {
|
|
|
115697
115731
|
const {
|
|
115698
115732
|
isIdentifier,
|
|
115699
115733
|
isStringLiteral: isStringLiteral$1,
|
|
115700
|
-
} = types$
|
|
115734
|
+
} = types$c;
|
|
115701
115735
|
|
|
115702
115736
|
const comparators = [
|
|
115703
115737
|
isEqualAnyObject,
|
|
@@ -115755,13 +115789,13 @@ const {
|
|
|
115755
115789
|
const {extractExpression} = template$6;
|
|
115756
115790
|
|
|
115757
115791
|
const {keys: keys$2} = Object;
|
|
115758
|
-
const {isArray: isArray$
|
|
115759
|
-
const noop$
|
|
115760
|
-
const isEmptyArray = (a) => isArray$
|
|
115792
|
+
const {isArray: isArray$6} = Array;
|
|
115793
|
+
const noop$4 = () => {};
|
|
115794
|
+
const isEmptyArray = (a) => isArray$6(a) && !a.length;
|
|
115761
115795
|
|
|
115762
115796
|
const compareType = (type) => (path) => path.type === type;
|
|
115763
115797
|
const superPush = (array) => (a, b) => array.push([a, b]);
|
|
115764
|
-
const maybeArray$
|
|
115798
|
+
const maybeArray$5 = (a) => isArray$6(a) ? a : [a];
|
|
115765
115799
|
|
|
115766
115800
|
const findParent = (path, type) => {
|
|
115767
115801
|
const newPathNode = path.findParent(compareType(type));
|
|
@@ -115791,7 +115825,7 @@ compare$5.getValues = getValues$1;
|
|
|
115791
115825
|
compare$5.setValues = setValues$1;
|
|
115792
115826
|
compare$5.getTemplateValues = getTemplateValues$1;
|
|
115793
115827
|
|
|
115794
|
-
function compare$4(path, template, options = {}, equal = noop$
|
|
115828
|
+
function compare$4(path, template, options = {}, equal = noop$4) {
|
|
115795
115829
|
const {findUp = true} = options;
|
|
115796
115830
|
|
|
115797
115831
|
if (!path && !template)
|
|
@@ -115825,7 +115859,7 @@ function compare$4(path, template, options = {}, equal = noop$5) {
|
|
|
115825
115859
|
}
|
|
115826
115860
|
|
|
115827
115861
|
compare$5.compareAny = (path, templateNodes, options) => {
|
|
115828
|
-
templateNodes = maybeArray$
|
|
115862
|
+
templateNodes = maybeArray$5(templateNodes);
|
|
115829
115863
|
|
|
115830
115864
|
for (const template of templateNodes) {
|
|
115831
115865
|
if (compare$4(path, template, options))
|
|
@@ -115836,7 +115870,7 @@ compare$5.compareAny = (path, templateNodes, options) => {
|
|
|
115836
115870
|
};
|
|
115837
115871
|
|
|
115838
115872
|
compare$5.compareAll = (path, templateNodes, options) => {
|
|
115839
|
-
templateNodes = maybeArray$
|
|
115873
|
+
templateNodes = maybeArray$5(templateNodes);
|
|
115840
115874
|
|
|
115841
115875
|
for (const template of templateNodes) {
|
|
115842
115876
|
if (!compare$4(path, template, options))
|
|
@@ -115917,7 +115951,7 @@ function check$3(fn) {
|
|
|
115917
115951
|
}
|
|
115918
115952
|
|
|
115919
115953
|
const {entries: entries$5} = Object;
|
|
115920
|
-
const {isArray: isArray$
|
|
115954
|
+
const {isArray: isArray$5} = Array;
|
|
115921
115955
|
|
|
115922
115956
|
var findPath$1 = (parentPath) => {
|
|
115923
115957
|
let current = {
|
|
@@ -115936,7 +115970,7 @@ function findKey(path, parent) {
|
|
|
115936
115970
|
const {node} = path;
|
|
115937
115971
|
|
|
115938
115972
|
for (const [key, value] of entries$5(parent)) {
|
|
115939
|
-
if (isArray$
|
|
115973
|
+
if (isArray$5(value)) {
|
|
115940
115974
|
const index = value.indexOf(node);
|
|
115941
115975
|
|
|
115942
115976
|
if (index >= 0)
|
|
@@ -115952,14 +115986,14 @@ function findKey(path, parent) {
|
|
|
115952
115986
|
|
|
115953
115987
|
const wraptile = wraptile$1;
|
|
115954
115988
|
const findPath = findPath$1;
|
|
115955
|
-
const {types: types$
|
|
115956
|
-
const {isProgram: isProgram$
|
|
115989
|
+
const {types: types$b} = bundle;
|
|
115990
|
+
const {isProgram: isProgram$4} = types$b;
|
|
115957
115991
|
const name = '__putout_runner_replace';
|
|
115958
115992
|
const hasWatermark = (watermark) => (path) => path.node?.[name]?.has(watermark);
|
|
115959
115993
|
|
|
115960
115994
|
watermark$1.exports = (from, to, path) => {
|
|
115961
115995
|
const {watermark, highWatermark} = create(from, to, path);
|
|
115962
|
-
const program = path.findParent(isProgram$
|
|
115996
|
+
const program = path.findParent(isProgram$4) || path;
|
|
115963
115997
|
const options = {
|
|
115964
115998
|
watermark,
|
|
115965
115999
|
highWatermark,
|
|
@@ -115968,7 +116002,7 @@ watermark$1.exports = (from, to, path) => {
|
|
|
115968
116002
|
};
|
|
115969
116003
|
|
|
115970
116004
|
return {
|
|
115971
|
-
init: wraptile(init$
|
|
116005
|
+
init: wraptile(init$3, options),
|
|
115972
116006
|
has: wraptile(has, options),
|
|
115973
116007
|
add: wraptile(add, options),
|
|
115974
116008
|
};
|
|
@@ -115987,8 +116021,8 @@ function create(from, to, path) {
|
|
|
115987
116021
|
};
|
|
115988
116022
|
}
|
|
115989
116023
|
|
|
115990
|
-
watermark$1.exports.init = init$
|
|
115991
|
-
function init$
|
|
116024
|
+
watermark$1.exports.init = init$3;
|
|
116025
|
+
function init$3({path, program}) {
|
|
115992
116026
|
if (path.node)
|
|
115993
116027
|
path.node[name] = path.node[name] || new Set();
|
|
115994
116028
|
|
|
@@ -115997,7 +116031,7 @@ function init$4({path, program}) {
|
|
|
115997
116031
|
|
|
115998
116032
|
watermark$1.exports.add = add;
|
|
115999
116033
|
function add({path, program, watermark, highWatermark}) {
|
|
116000
|
-
init$
|
|
116034
|
+
init$3({
|
|
116001
116035
|
path,
|
|
116002
116036
|
program,
|
|
116003
116037
|
});
|
|
@@ -116018,7 +116052,7 @@ var watermarkExports = watermark$1.exports;
|
|
|
116018
116052
|
|
|
116019
116053
|
const {template: template$5, print: print$2} = parser$6;
|
|
116020
116054
|
const {remove, replaceWith: replaceWith$2} = operate;
|
|
116021
|
-
const {types: types$
|
|
116055
|
+
const {types: types$a} = bundle;
|
|
116022
116056
|
|
|
116023
116057
|
const {
|
|
116024
116058
|
compare: compare$3,
|
|
@@ -116028,14 +116062,14 @@ const {
|
|
|
116028
116062
|
} = compare$5;
|
|
116029
116063
|
|
|
116030
116064
|
const debug$2 = browserExports('putout:runner:replace');
|
|
116031
|
-
const maybeArray$
|
|
116065
|
+
const maybeArray$4 = maybeArray_1;
|
|
116032
116066
|
|
|
116033
116067
|
const watermark = watermarkExports;
|
|
116034
116068
|
const {
|
|
116035
116069
|
isExpression,
|
|
116036
116070
|
isStatement,
|
|
116037
116071
|
isExpressionStatement,
|
|
116038
|
-
} = types$
|
|
116072
|
+
} = types$a;
|
|
116039
116073
|
|
|
116040
116074
|
const PRINT_OPTIONS = {
|
|
116041
116075
|
printer: ['putout', {
|
|
@@ -116048,7 +116082,7 @@ const PRINT_OPTIONS = {
|
|
|
116048
116082
|
}],
|
|
116049
116083
|
};
|
|
116050
116084
|
|
|
116051
|
-
const isString$
|
|
116085
|
+
const isString$6 = (a) => typeof a === 'string';
|
|
116052
116086
|
|
|
116053
116087
|
const log$2 = (from, path) => {
|
|
116054
116088
|
debug$2.enabled && debug$2(`${from} -> ${path}\n`);
|
|
@@ -116085,7 +116119,7 @@ replace$1.exports = ({rule, plugin, msg, options}) => {
|
|
|
116085
116119
|
...options,
|
|
116086
116120
|
exclude: [
|
|
116087
116121
|
...exclude(),
|
|
116088
|
-
...maybeArray$
|
|
116122
|
+
...maybeArray$4(options.exclude),
|
|
116089
116123
|
],
|
|
116090
116124
|
},
|
|
116091
116125
|
plugin: {
|
|
@@ -116197,7 +116231,7 @@ function parseTo(to, values, path) {
|
|
|
116197
116231
|
return toStr;
|
|
116198
116232
|
}
|
|
116199
116233
|
|
|
116200
|
-
if (!isString$
|
|
116234
|
+
if (!isString$6(toStr))
|
|
116201
116235
|
throw Error(`☝️ Looks like you passed 'replace' value with a wrong type. Allowed: 'string', 'node' and 'path'. Received: '${typeof toStr}' with value '${toStr}'.`);
|
|
116202
116236
|
|
|
116203
116237
|
return template$5.ast.fresh(toStr);
|
|
@@ -116280,14 +116314,14 @@ const {
|
|
|
116280
116314
|
setModuleType,
|
|
116281
116315
|
} = record;
|
|
116282
116316
|
|
|
116283
|
-
const {types: types$
|
|
116317
|
+
const {types: types$9} = bundle;
|
|
116284
116318
|
const {
|
|
116285
116319
|
isImportDeclaration,
|
|
116286
116320
|
isVariableDeclaration,
|
|
116287
|
-
} = types$
|
|
116321
|
+
} = types$9;
|
|
116288
116322
|
|
|
116289
116323
|
const {keys} = Object;
|
|
116290
|
-
const isString$
|
|
116324
|
+
const isString$5 = (a) => typeof a === 'string';
|
|
116291
116325
|
|
|
116292
116326
|
const getLastVarPath = (bodyPath) => bodyPath.filter(isVariableDeclaration).pop();
|
|
116293
116327
|
const isLast = (insertionPath, bodyPath) => bodyPath.at(-1) === insertionPath;
|
|
@@ -116385,7 +116419,7 @@ function isUseStrict(path) {
|
|
|
116385
116419
|
}
|
|
116386
116420
|
|
|
116387
116421
|
const parseCode = (type, current) => {
|
|
116388
|
-
if (isString$
|
|
116422
|
+
if (isString$5(current))
|
|
116389
116423
|
return current;
|
|
116390
116424
|
|
|
116391
116425
|
return current[type];
|
|
@@ -116483,406 +116517,11 @@ function validateDeclare(declare) {
|
|
|
116483
116517
|
throw Error(`☝️ Looks like 'declare' property value is not a 'function', but '${typeof declare}' with value '${stringify$1(declare)}'.`);
|
|
116484
116518
|
}
|
|
116485
116519
|
|
|
116486
|
-
var filesystem$3 = {};
|
|
116487
|
-
|
|
116488
|
-
var maybeFs$3 = {};
|
|
116489
|
-
|
|
116490
|
-
const fullstore$4 = fullstore$6;
|
|
116491
|
-
const driverStore$3 = fullstore$4();
|
|
116492
|
-
|
|
116493
|
-
const {assign: assign$3} = Object;
|
|
116494
|
-
const noop$4 = () => {};
|
|
116495
|
-
const returns$3 = (a) => () => a;
|
|
116496
|
-
|
|
116497
|
-
const defaultFS$3 = {
|
|
116498
|
-
renameFile: noop$4,
|
|
116499
|
-
removeFile: noop$4,
|
|
116500
|
-
createDirectory: noop$4,
|
|
116501
|
-
readFileContent: returns$3(''),
|
|
116502
|
-
writeFileContent: noop$4,
|
|
116503
|
-
copyFile: noop$4,
|
|
116504
|
-
};
|
|
116505
|
-
|
|
116506
|
-
const maybeFS$7 = assign$3({}, defaultFS$3);
|
|
116507
|
-
|
|
116508
|
-
maybeFs$3.renameFile = (oldName, newName) => {
|
|
116509
|
-
maybeFS$7.renameFile(oldName, newName);
|
|
116510
|
-
};
|
|
116511
|
-
|
|
116512
|
-
maybeFs$3.removeFile = (name) => {
|
|
116513
|
-
maybeFS$7.removeFile(name);
|
|
116514
|
-
};
|
|
116515
|
-
|
|
116516
|
-
maybeFs$3.copyFile = (from, to) => {
|
|
116517
|
-
maybeFS$7.copyFile(from, to);
|
|
116518
|
-
};
|
|
116519
|
-
|
|
116520
|
-
maybeFs$3.createDirectory = (name) => {
|
|
116521
|
-
maybeFS$7.createDirectory(name);
|
|
116522
|
-
};
|
|
116523
|
-
|
|
116524
|
-
maybeFs$3.readFileContent = (name) => {
|
|
116525
|
-
return maybeFS$7.readFileContent(name);
|
|
116526
|
-
};
|
|
116527
|
-
|
|
116528
|
-
maybeFs$3.writeFileContent = (name, content) => {
|
|
116529
|
-
maybeFS$7.writeFileContent(name, content);
|
|
116530
|
-
};
|
|
116531
|
-
|
|
116532
|
-
maybeFs$3.init = init$3;
|
|
116533
|
-
|
|
116534
|
-
function init$3(fsDriver) {
|
|
116535
|
-
assign$3(maybeFS$7, fsDriver);
|
|
116536
|
-
}
|
|
116537
|
-
|
|
116538
|
-
maybeFs$3.pause = () => {
|
|
116539
|
-
driverStore$3(maybeFS$7);
|
|
116540
|
-
deinit$3();
|
|
116541
|
-
};
|
|
116542
|
-
|
|
116543
|
-
maybeFs$3.start = () => {
|
|
116544
|
-
init$3(driverStore$3());
|
|
116545
|
-
};
|
|
116546
|
-
|
|
116547
|
-
maybeFs$3.deinit = deinit$3;
|
|
116548
|
-
|
|
116549
|
-
function deinit$3() {
|
|
116550
|
-
assign$3(maybeFS$7, defaultFS$3);
|
|
116551
|
-
}
|
|
116552
|
-
|
|
116553
|
-
const {join: join$5, basename: basename$4} = require$$0$2;
|
|
116554
|
-
const tryCatch$5 = tryCatch$9;
|
|
116555
|
-
const {types: types$9} = bundle;
|
|
116556
|
-
|
|
116557
|
-
const {
|
|
116558
|
-
setLiteralValue: setLiteralValue$3,
|
|
116559
|
-
getProperty: getProperty$5,
|
|
116560
|
-
traverseProperties: traverseProperties$4,
|
|
116561
|
-
} = operate;
|
|
116562
|
-
|
|
116563
|
-
const maybeFS$6 = maybeFs$3;
|
|
116564
|
-
const isString$5 = (a) => typeof a === 'string';
|
|
116565
|
-
const {isArray: isArray$5} = Array;
|
|
116566
|
-
const maybeArray$4 = (a) => isArray$5(a) ? a : [a];
|
|
116567
|
-
|
|
116568
|
-
const toBase64$3 = (content) => {
|
|
116569
|
-
const [e, result] = tryCatch$5(btoa, content);
|
|
116570
|
-
|
|
116571
|
-
if (e)
|
|
116572
|
-
return btoa(encodeURI(content));
|
|
116573
|
-
|
|
116574
|
-
return result;
|
|
116575
|
-
};
|
|
116576
|
-
|
|
116577
|
-
const fromBase64$3 = (content) => {
|
|
116578
|
-
const [e, decoded] = tryCatch$5(atob, content);
|
|
116579
|
-
|
|
116580
|
-
if (!e)
|
|
116581
|
-
return decodeURI(decoded);
|
|
116582
|
-
|
|
116583
|
-
return content;
|
|
116584
|
-
};
|
|
116585
|
-
|
|
116586
|
-
const {
|
|
116587
|
-
ObjectExpression: ObjectExpression$4,
|
|
116588
|
-
ArrayExpression: ArrayExpression$5,
|
|
116589
|
-
StringLiteral: StringLiteral$6,
|
|
116590
|
-
ObjectProperty: ObjectProperty$5,
|
|
116591
|
-
isProgram: isProgram$4,
|
|
116592
|
-
} = types$9;
|
|
116593
|
-
|
|
116594
|
-
const getRegExp$3 = (wildcard) => {
|
|
116595
|
-
const escaped = wildcard
|
|
116596
|
-
.replace(/\./g, '\\.')
|
|
116597
|
-
.replace(/\*/g, '.*')
|
|
116598
|
-
.replace('?', '.?');
|
|
116599
|
-
|
|
116600
|
-
return RegExp(`^${escaped}$`);
|
|
116601
|
-
};
|
|
116602
|
-
|
|
116603
|
-
filesystem$3.getParentDirectory = (filePath) => {
|
|
116604
|
-
const {parentPath} = filePath.parentPath.parentPath;
|
|
116605
|
-
|
|
116606
|
-
if (isProgram$4(parentPath))
|
|
116607
|
-
return null;
|
|
116608
|
-
|
|
116609
|
-
return parentPath;
|
|
116610
|
-
};
|
|
116611
|
-
|
|
116612
|
-
filesystem$3.findFile = findFile$8;
|
|
116613
|
-
|
|
116614
|
-
function findFile$8(node, name) {
|
|
116615
|
-
checkName$3(name);
|
|
116616
|
-
|
|
116617
|
-
const filePaths = [];
|
|
116618
|
-
const names = maybeArray$4(name);
|
|
116619
|
-
|
|
116620
|
-
for (const filenamePath of traverseProperties$4(node, 'filename')) {
|
|
116621
|
-
const {value} = filenamePath.node.value;
|
|
116622
|
-
const base = basename$4(value);
|
|
116623
|
-
|
|
116624
|
-
for (const name of names) {
|
|
116625
|
-
if (value === name || getRegExp$3(name).test(base))
|
|
116626
|
-
filePaths.push(filenamePath.parentPath);
|
|
116627
|
-
}
|
|
116628
|
-
}
|
|
116629
|
-
|
|
116630
|
-
return filePaths;
|
|
116631
|
-
}
|
|
116632
|
-
|
|
116633
|
-
function checkName$3(name) {
|
|
116634
|
-
if (!isString$5(name) && !isArray$5(name))
|
|
116635
|
-
throw Error(`☝️ Looks like you forget to pass the 'name' of a file to 'findFile(filePath: Path|FilePath, name: string | string[]): FilePath'`);
|
|
116636
|
-
}
|
|
116637
|
-
|
|
116638
|
-
function getFilenamePath$3(filePath) {
|
|
116639
|
-
const filenamePath = getProperty$5(filePath, 'filename');
|
|
116640
|
-
return filenamePath.get('value');
|
|
116641
|
-
}
|
|
116642
|
-
|
|
116643
|
-
function getFilename$7(filePath) {
|
|
116644
|
-
const {value} = getFilenamePath$3(filePath).node;
|
|
116645
|
-
return value;
|
|
116646
|
-
}
|
|
116647
|
-
|
|
116648
|
-
filesystem$3.getFileType = getFileType$5;
|
|
116649
|
-
|
|
116650
|
-
function getFileType$5(filePath) {
|
|
116651
|
-
const typePath = getProperty$5(filePath, 'type');
|
|
116652
|
-
return typePath.node.value.value;
|
|
116653
|
-
}
|
|
116654
|
-
|
|
116655
|
-
filesystem$3.getFileContent = getFileContent$3;
|
|
116656
|
-
|
|
116657
|
-
function getFileContent$3(filePath) {
|
|
116658
|
-
const content = getProperty$5(filePath, 'content');
|
|
116659
|
-
|
|
116660
|
-
return [
|
|
116661
|
-
Boolean(content),
|
|
116662
|
-
content?.node.value.value,
|
|
116663
|
-
];
|
|
116664
|
-
}
|
|
116665
|
-
|
|
116666
|
-
filesystem$3.getFilename = getFilename$7;
|
|
116667
|
-
|
|
116668
|
-
filesystem$3.renameFile = (filePath, name) => {
|
|
116669
|
-
const oldName = getFilename$7(filePath);
|
|
116670
|
-
const valuePath = getFilenamePath$3(filePath);
|
|
116671
|
-
const baseName = oldName
|
|
116672
|
-
.split('/')
|
|
116673
|
-
.pop();
|
|
116674
|
-
|
|
116675
|
-
const newName = name
|
|
116676
|
-
.split('/')
|
|
116677
|
-
.pop();
|
|
116678
|
-
|
|
116679
|
-
const newFilename = oldName.replace(baseName, newName);
|
|
116680
|
-
|
|
116681
|
-
setLiteralValue$3(valuePath, newFilename);
|
|
116682
|
-
maybeFS$6.renameFile(oldName, newFilename);
|
|
116683
|
-
};
|
|
116684
|
-
|
|
116685
|
-
filesystem$3.removeFile = (filePath) => {
|
|
116686
|
-
const filename = getFilename$7(filePath);
|
|
116687
|
-
|
|
116688
|
-
filePath.remove();
|
|
116689
|
-
maybeFS$6.removeFile(filename);
|
|
116690
|
-
};
|
|
116691
|
-
|
|
116692
|
-
filesystem$3.moveFile = (filePath, dirPath) => {
|
|
116693
|
-
if (filePath === dirPath)
|
|
116694
|
-
return;
|
|
116695
|
-
|
|
116696
|
-
const dirname = getFilename$7(dirPath);
|
|
116697
|
-
const filename = getFilename$7(filePath);
|
|
116698
|
-
const dirPathFiles = getProperty$5(dirPath, 'files');
|
|
116699
|
-
const filenamePath = getProperty$5(filePath, 'filename');
|
|
116700
|
-
|
|
116701
|
-
const basename = filename
|
|
116702
|
-
.split('/')
|
|
116703
|
-
.pop();
|
|
116704
|
-
|
|
116705
|
-
const newFilename = join$5(dirname, basename);
|
|
116706
|
-
|
|
116707
|
-
maybeRemoveFile$3(dirPath, newFilename);
|
|
116708
|
-
|
|
116709
|
-
setLiteralValue$3(filenamePath.get('value'), newFilename);
|
|
116710
|
-
dirPathFiles.node.value.elements.push(filePath.node);
|
|
116711
|
-
|
|
116712
|
-
filePath.remove();
|
|
116713
|
-
maybeFS$6.renameFile(filename, newFilename);
|
|
116714
|
-
};
|
|
116715
|
-
|
|
116716
|
-
filesystem$3.copyFile = (filePath, dirPath) => {
|
|
116717
|
-
const dirname = getFilename$7(dirPath);
|
|
116718
|
-
const filename = getFilename$7(filePath);
|
|
116719
|
-
|
|
116720
|
-
const basename = filename
|
|
116721
|
-
.split('/')
|
|
116722
|
-
.pop();
|
|
116723
|
-
|
|
116724
|
-
const newFilename = join$5(dirname, basename);
|
|
116725
|
-
const [hasContent, content] = getFileContent$3(filePath);
|
|
116726
|
-
|
|
116727
|
-
const copiedFile = ObjectExpression$4([
|
|
116728
|
-
createTypeProperty$3('file'),
|
|
116729
|
-
createFilenameProperty$3(newFilename),
|
|
116730
|
-
hasContent && createContentProperty$3(content),
|
|
116731
|
-
].filter(Boolean));
|
|
116732
|
-
|
|
116733
|
-
maybeRemoveFile$3(dirPath, newFilename);
|
|
116734
|
-
|
|
116735
|
-
const dirPathFiles = getFiles$4(dirPath);
|
|
116736
|
-
dirPathFiles.node.value.elements.push(copiedFile);
|
|
116737
|
-
|
|
116738
|
-
maybeFS$6.copyFile(filename, newFilename);
|
|
116739
|
-
};
|
|
116740
|
-
|
|
116741
|
-
function maybeRemoveFile$3(dirPath, filename) {
|
|
116742
|
-
const type = getFileType$5(dirPath);
|
|
116743
|
-
|
|
116744
|
-
if (type !== 'directory') {
|
|
116745
|
-
const filename = getFilename$7(dirPath);
|
|
116746
|
-
throw Error(`☝️ Looks like '${filename}' is not a directory, but: '${type}'. Rename to '${filename}/'`);
|
|
116747
|
-
}
|
|
116748
|
-
|
|
116749
|
-
const dirPathFiles = getProperty$5(dirPath, 'files');
|
|
116750
|
-
const name = join$5(getFilename$7(dirPath), basename$4(filename));
|
|
116751
|
-
const [fileToOverwrite] = findFile$8(dirPathFiles, name);
|
|
116752
|
-
|
|
116753
|
-
if (!fileToOverwrite)
|
|
116754
|
-
return;
|
|
116755
|
-
|
|
116756
|
-
fileToOverwrite.remove();
|
|
116757
|
-
}
|
|
116758
|
-
|
|
116759
|
-
const createTypeProperty$3 = (type) => ObjectProperty$5(StringLiteral$6('type'), StringLiteral$6(type));
|
|
116760
|
-
|
|
116761
|
-
filesystem$3.createTypeProperty = createTypeProperty$3;
|
|
116762
|
-
|
|
116763
|
-
const createFilesProperty$3 = (files) => ObjectProperty$5(StringLiteral$6('files'), ArrayExpression$5(files));
|
|
116764
|
-
|
|
116765
|
-
filesystem$3.createFilesProperty = createFilesProperty$3;
|
|
116766
|
-
|
|
116767
|
-
const createFilenameProperty$3 = (filename) => ObjectProperty$5(StringLiteral$6('filename'), StringLiteral$6(filename));
|
|
116768
|
-
|
|
116769
|
-
filesystem$3.createFilenameProperty = createFilenameProperty$3;
|
|
116770
|
-
|
|
116771
|
-
const createContentProperty$3 = (content) => ObjectProperty$5(StringLiteral$6('content'), StringLiteral$6(content));
|
|
116772
|
-
|
|
116773
|
-
filesystem$3.createContentProperty = createContentProperty$3;
|
|
116774
|
-
|
|
116775
|
-
filesystem$3.createFile = (dirPath, name, content) => {
|
|
116776
|
-
maybeRemoveFile$3(dirPath, name);
|
|
116777
|
-
|
|
116778
|
-
const dirPathFiles = getFiles$4(dirPath);
|
|
116779
|
-
const parentFilename = getFilename$7(dirPath);
|
|
116780
|
-
const filename = join$5(parentFilename, name);
|
|
116781
|
-
|
|
116782
|
-
const typeProperty = createTypeProperty$3('file');
|
|
116783
|
-
const filenameProperty = createFilenameProperty$3(filename);
|
|
116784
|
-
|
|
116785
|
-
const properties = [
|
|
116786
|
-
typeProperty,
|
|
116787
|
-
filenameProperty,
|
|
116788
|
-
content && createContentProperty$3(content),
|
|
116789
|
-
].filter(Boolean);
|
|
116790
|
-
|
|
116791
|
-
dirPathFiles.node.value.elements.push(ObjectExpression$4(properties));
|
|
116792
|
-
|
|
116793
|
-
const filePath = dirPathFiles
|
|
116794
|
-
.get('value.elements')
|
|
116795
|
-
.at(-1);
|
|
116796
|
-
|
|
116797
|
-
if (isString$5(content))
|
|
116798
|
-
writeFileContent$4(filePath, content);
|
|
116799
|
-
|
|
116800
|
-
return filePath;
|
|
116801
|
-
};
|
|
116802
|
-
|
|
116803
|
-
function getFiles$4(dirPath) {
|
|
116804
|
-
return getProperty$5(dirPath, 'files');
|
|
116805
|
-
}
|
|
116806
|
-
|
|
116807
|
-
filesystem$3.createDirectory = (dirPath, name) => {
|
|
116808
|
-
const dirPathFiles = getFiles$4(dirPath);
|
|
116809
|
-
const parentFilename = getFilename$7(dirPath);
|
|
116810
|
-
const filename = join$5(parentFilename, name);
|
|
116811
|
-
|
|
116812
|
-
const typeProperty = createTypeProperty$3('directory');
|
|
116813
|
-
const filesProperty = createFilesProperty$3([]);
|
|
116814
|
-
const filenameProperty = createFilenameProperty$3(filename);
|
|
116815
|
-
|
|
116816
|
-
dirPathFiles.node.value.elements.push(ObjectExpression$4([
|
|
116817
|
-
typeProperty,
|
|
116818
|
-
filenameProperty,
|
|
116819
|
-
filesProperty,
|
|
116820
|
-
]));
|
|
116821
|
-
|
|
116822
|
-
maybeFS$6.createDirectory(filename);
|
|
116823
|
-
|
|
116824
|
-
return dirPathFiles
|
|
116825
|
-
.get('value.elements')
|
|
116826
|
-
.at(-1);
|
|
116827
|
-
};
|
|
116828
|
-
|
|
116829
|
-
filesystem$3.readFileContent = (filePath) => {
|
|
116830
|
-
const fileType = getFileType$5(filePath);
|
|
116831
|
-
|
|
116832
|
-
if (fileType === 'directory')
|
|
116833
|
-
return '';
|
|
116834
|
-
|
|
116835
|
-
const [hasContent, content] = getFileContent$3(filePath);
|
|
116836
|
-
|
|
116837
|
-
if (hasContent)
|
|
116838
|
-
return fromBase64$3(content);
|
|
116839
|
-
|
|
116840
|
-
const filename = getFilename$7(filePath);
|
|
116841
|
-
const fileContent = maybeFS$6.readFileContent(filename);
|
|
116842
|
-
|
|
116843
|
-
const property = createContentProperty$3(toBase64$3(fileContent));
|
|
116844
|
-
|
|
116845
|
-
filePath.node.properties.push(property);
|
|
116846
|
-
|
|
116847
|
-
return fileContent;
|
|
116848
|
-
};
|
|
116849
|
-
|
|
116850
|
-
filesystem$3.writeFileContent = writeFileContent$4;
|
|
116851
|
-
|
|
116852
|
-
function writeFileContent$4(filePath, content) {
|
|
116853
|
-
const fileType = getFileType$5(filePath);
|
|
116854
|
-
|
|
116855
|
-
if (fileType === 'directory')
|
|
116856
|
-
return;
|
|
116857
|
-
|
|
116858
|
-
const filename = getFilename$7(filePath);
|
|
116859
|
-
|
|
116860
|
-
maybeFS$6.writeFileContent(filename, content);
|
|
116861
|
-
|
|
116862
|
-
const contentPath = getProperty$5(filePath, 'content');
|
|
116863
|
-
|
|
116864
|
-
if (contentPath) {
|
|
116865
|
-
setLiteralValue$3(contentPath.node.value, toBase64$3(content));
|
|
116866
|
-
return;
|
|
116867
|
-
}
|
|
116868
|
-
|
|
116869
|
-
const property = createContentProperty$3(toBase64$3(content));
|
|
116870
|
-
filePath.node.properties.push(property);
|
|
116871
|
-
}
|
|
116872
|
-
|
|
116873
|
-
filesystem$3.init = maybeFS$6.init;
|
|
116874
|
-
filesystem$3.deinit = maybeFS$6.deinit;
|
|
116875
|
-
|
|
116876
|
-
filesystem$3.pause = maybeFS$6.pause;
|
|
116877
|
-
filesystem$3.start = maybeFS$6.start;
|
|
116878
|
-
|
|
116879
|
-
var convertSimpleFilesystemToFilesystem = {};
|
|
116880
|
-
|
|
116881
116520
|
var filesystem$2 = {};
|
|
116882
116521
|
|
|
116883
116522
|
var maybeFs$2 = {};
|
|
116884
116523
|
|
|
116885
|
-
const fullstore$3 = fullstore$
|
|
116524
|
+
const fullstore$3 = fullstore$5;
|
|
116886
116525
|
const driverStore$2 = fullstore$3();
|
|
116887
116526
|
|
|
116888
116527
|
const {assign: assign$2} = Object;
|
|
@@ -116946,7 +116585,7 @@ function deinit$2() {
|
|
|
116946
116585
|
}
|
|
116947
116586
|
|
|
116948
116587
|
const {join: join$4, basename: basename$3} = require$$0$2;
|
|
116949
|
-
const tryCatch$4 = tryCatch$
|
|
116588
|
+
const tryCatch$4 = tryCatch$8;
|
|
116950
116589
|
const {types: types$8} = bundle;
|
|
116951
116590
|
|
|
116952
116591
|
const {
|
|
@@ -117271,27 +116910,422 @@ filesystem$2.deinit = maybeFS$4.deinit;
|
|
|
117271
116910
|
filesystem$2.pause = maybeFS$4.pause;
|
|
117272
116911
|
filesystem$2.start = maybeFS$4.start;
|
|
117273
116912
|
|
|
116913
|
+
var convertSimpleFilesystemToFilesystem = {};
|
|
116914
|
+
|
|
116915
|
+
var filesystem$1 = {};
|
|
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;
|
|
117274
116984
|
const {types: types$7} = bundle;
|
|
117275
|
-
|
|
116985
|
+
|
|
117276
116986
|
const {
|
|
117277
|
-
|
|
117278
|
-
|
|
117279
|
-
|
|
117280
|
-
|
|
117281
|
-
} = filesystem$2;
|
|
116987
|
+
setLiteralValue: setLiteralValue$1,
|
|
116988
|
+
getProperty: getProperty$3,
|
|
116989
|
+
traverseProperties: traverseProperties$2,
|
|
116990
|
+
} = operate;
|
|
117282
116991
|
|
|
117283
|
-
const
|
|
117284
|
-
const
|
|
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
|
+
};
|
|
117285
117014
|
|
|
117286
117015
|
const {
|
|
117287
117016
|
ObjectExpression: ObjectExpression$2,
|
|
117288
117017
|
ArrayExpression: ArrayExpression$3,
|
|
117289
117018
|
StringLiteral: StringLiteral$4,
|
|
117290
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;
|
|
117310
|
+
const {
|
|
117311
|
+
createDirectory,
|
|
117312
|
+
getFileType: getFileType$2,
|
|
117313
|
+
getFilename: getFilename$4,
|
|
117314
|
+
findFile: findFile$5,
|
|
117315
|
+
} = filesystem$1;
|
|
117316
|
+
|
|
117317
|
+
const {__filesystem_name: __filesystem_name$2} = json;
|
|
117318
|
+
const {replaceWith: replaceWith$1, getProperty: getProperty$2} = operate;
|
|
117319
|
+
|
|
117320
|
+
const {
|
|
117321
|
+
ObjectExpression: ObjectExpression$1,
|
|
117322
|
+
ArrayExpression: ArrayExpression$2,
|
|
117323
|
+
StringLiteral: StringLiteral$3,
|
|
117324
|
+
ObjectProperty: ObjectProperty$2,
|
|
117291
117325
|
isArrayExpression,
|
|
117292
117326
|
isStringLiteral,
|
|
117293
117327
|
isTemplateLiteral,
|
|
117294
|
-
} = types$
|
|
117328
|
+
} = types$6;
|
|
117295
117329
|
|
|
117296
117330
|
convertSimpleFilesystemToFilesystem.report = () => `Convert Simple Filesystem to Filesystem`;
|
|
117297
117331
|
|
|
@@ -117299,22 +117333,22 @@ const isDirectory = (a) => a.endsWith('/');
|
|
|
117299
117333
|
const getType = (a) => {
|
|
117300
117334
|
const type = isDirectory(a) ? 'directory' : 'file';
|
|
117301
117335
|
|
|
117302
|
-
return ObjectProperty$
|
|
117336
|
+
return ObjectProperty$2(StringLiteral$3('type'), StringLiteral$3(type));
|
|
117303
117337
|
};
|
|
117304
117338
|
|
|
117305
117339
|
const createFilename = (filename) => {
|
|
117306
|
-
return ObjectProperty$
|
|
117340
|
+
return ObjectProperty$2(StringLiteral$3('filename'), StringLiteral$3(filename));
|
|
117307
117341
|
};
|
|
117308
117342
|
|
|
117309
|
-
const getFiles$
|
|
117343
|
+
const getFiles$1 = (a) => {
|
|
117310
117344
|
if (isDirectory(a))
|
|
117311
|
-
return ObjectProperty$
|
|
117345
|
+
return ObjectProperty$2(StringLiteral$3('files'), ArrayExpression$2([]));
|
|
117312
117346
|
|
|
117313
117347
|
return null;
|
|
117314
117348
|
};
|
|
117315
117349
|
|
|
117316
117350
|
const getContent = (a) => {
|
|
117317
|
-
return ObjectProperty$
|
|
117351
|
+
return ObjectProperty$2(StringLiteral$3('content'), StringLiteral$3(a));
|
|
117318
117352
|
};
|
|
117319
117353
|
|
|
117320
117354
|
function parseContent(node, path) {
|
|
@@ -117328,7 +117362,7 @@ function parseContent(node, path) {
|
|
|
117328
117362
|
}
|
|
117329
117363
|
|
|
117330
117364
|
convertSimpleFilesystemToFilesystem.fix = (path) => {
|
|
117331
|
-
const array = ArrayExpression$
|
|
117365
|
+
const array = ArrayExpression$2([]);
|
|
117332
117366
|
|
|
117333
117367
|
for (const element of path.get('elements')) {
|
|
117334
117368
|
if (isArrayExpression(element)) {
|
|
@@ -117337,7 +117371,7 @@ convertSimpleFilesystemToFilesystem.fix = (path) => {
|
|
|
117337
117371
|
|
|
117338
117372
|
const content = parseContent(nodeContent, element);
|
|
117339
117373
|
|
|
117340
|
-
array.elements.push(ObjectExpression$
|
|
117374
|
+
array.elements.push(ObjectExpression$1([
|
|
117341
117375
|
getType(value),
|
|
117342
117376
|
createFilename(value),
|
|
117343
117377
|
getContent(content),
|
|
@@ -117348,10 +117382,10 @@ convertSimpleFilesystemToFilesystem.fix = (path) => {
|
|
|
117348
117382
|
if (isStringLiteral(element)) {
|
|
117349
117383
|
const {value} = element.node;
|
|
117350
117384
|
|
|
117351
|
-
array.elements.push(ObjectExpression$
|
|
117385
|
+
array.elements.push(ObjectExpression$1([
|
|
117352
117386
|
getType(value),
|
|
117353
117387
|
createFilename(noTrailingSlash(value)),
|
|
117354
|
-
getFiles$
|
|
117388
|
+
getFiles$1(value),
|
|
117355
117389
|
].filter(Boolean)));
|
|
117356
117390
|
continue;
|
|
117357
117391
|
}
|
|
@@ -117377,19 +117411,19 @@ const noTrailingSlash = (a) => {
|
|
|
117377
117411
|
};
|
|
117378
117412
|
|
|
117379
117413
|
function buildTree(path, list) {
|
|
117380
|
-
const [root, ...files] = findFile$
|
|
117414
|
+
const [root, ...files] = findFile$5(list, '*');
|
|
117381
117415
|
|
|
117382
117416
|
for (const filePath of files) {
|
|
117383
|
-
const filename = getFilename$
|
|
117417
|
+
const filename = getFilename$4(filePath);
|
|
117384
117418
|
|
|
117385
117419
|
check$2(filename);
|
|
117386
117420
|
|
|
117387
|
-
const type = getFileType$
|
|
117421
|
+
const type = getFileType$2(filePath);
|
|
117388
117422
|
const dir = dirname(filename);
|
|
117389
|
-
const name = basename$
|
|
117390
|
-
const [dirPath] = findFile$
|
|
117423
|
+
const name = basename$1(filename);
|
|
117424
|
+
const [dirPath] = findFile$5(root, dir);
|
|
117391
117425
|
|
|
117392
|
-
if (!dirPath || getFileType$
|
|
117426
|
+
if (!dirPath || getFileType$2(dirPath) !== 'directory')
|
|
117393
117427
|
throw Error(`☝️ Looks like directory '${dir}/' is missing`);
|
|
117394
117428
|
|
|
117395
117429
|
if (type === 'directory') {
|
|
@@ -117397,7 +117431,7 @@ function buildTree(path, list) {
|
|
|
117397
117431
|
continue;
|
|
117398
117432
|
}
|
|
117399
117433
|
|
|
117400
|
-
const filesProperty = getProperty$
|
|
117434
|
+
const filesProperty = getProperty$2(dirPath, 'files');
|
|
117401
117435
|
filesProperty.node.value.elements.push(filePath.node);
|
|
117402
117436
|
}
|
|
117403
117437
|
|
|
@@ -117411,22 +117445,22 @@ function check$2(filename) {
|
|
|
117411
117445
|
|
|
117412
117446
|
var convertFilesystemToSimpleFilesystem = {};
|
|
117413
117447
|
|
|
117414
|
-
const {types: types$
|
|
117415
|
-
const {replaceWith, getProperty: getProperty$
|
|
117448
|
+
const {types: types$5} = bundle;
|
|
117449
|
+
const {replaceWith, getProperty: getProperty$1} = operate;
|
|
117416
117450
|
const {__filesystem_name: __filesystem_name$1} = json;
|
|
117417
117451
|
|
|
117418
117452
|
const {
|
|
117419
|
-
findFile: findFile$
|
|
117420
|
-
getFilename: getFilename$
|
|
117421
|
-
getFileType: getFileType$
|
|
117422
|
-
} = filesystem$
|
|
117453
|
+
findFile: findFile$4,
|
|
117454
|
+
getFilename: getFilename$3,
|
|
117455
|
+
getFileType: getFileType$1,
|
|
117456
|
+
} = filesystem$1;
|
|
117423
117457
|
|
|
117424
117458
|
const {
|
|
117425
|
-
StringLiteral: StringLiteral$
|
|
117426
|
-
ArrayExpression: ArrayExpression$
|
|
117427
|
-
} = types$
|
|
117459
|
+
StringLiteral: StringLiteral$2,
|
|
117460
|
+
ArrayExpression: ArrayExpression$1,
|
|
117461
|
+
} = types$5;
|
|
117428
117462
|
|
|
117429
|
-
const {isArray: isArray$
|
|
117463
|
+
const {isArray: isArray$2} = Array;
|
|
117430
117464
|
const maybeAddSlash = (a) => a === '/' ? a : `${a}/`;
|
|
117431
117465
|
|
|
117432
117466
|
convertFilesystemToSimpleFilesystem.report = () => `Convert Filesystem to Simple Filesystem`;
|
|
@@ -117435,9 +117469,9 @@ convertFilesystemToSimpleFilesystem.fix = (root, {files}) => {
|
|
|
117435
117469
|
const names = [];
|
|
117436
117470
|
|
|
117437
117471
|
for (const file of files) {
|
|
117438
|
-
const filename = getFilename$
|
|
117439
|
-
const type = getFileType$
|
|
117440
|
-
const contentPath = getProperty$
|
|
117472
|
+
const filename = getFilename$3(file);
|
|
117473
|
+
const type = getFileType$1(file);
|
|
117474
|
+
const contentPath = getProperty$1(file, 'content');
|
|
117441
117475
|
const content = contentPath?.node?.value;
|
|
117442
117476
|
|
|
117443
117477
|
if (content) {
|
|
@@ -117456,24 +117490,24 @@ convertFilesystemToSimpleFilesystem.fix = (root, {files}) => {
|
|
|
117456
117490
|
const list = [];
|
|
117457
117491
|
|
|
117458
117492
|
for (const name of names) {
|
|
117459
|
-
if (isArray$
|
|
117460
|
-
list.push(ArrayExpression$
|
|
117461
|
-
StringLiteral$
|
|
117462
|
-
StringLiteral$
|
|
117493
|
+
if (isArray$2(name)) {
|
|
117494
|
+
list.push(ArrayExpression$1([
|
|
117495
|
+
StringLiteral$2(name[0]),
|
|
117496
|
+
StringLiteral$2(name[1]),
|
|
117463
117497
|
]));
|
|
117464
117498
|
continue;
|
|
117465
117499
|
}
|
|
117466
117500
|
|
|
117467
|
-
list.push(StringLiteral$
|
|
117501
|
+
list.push(StringLiteral$2(name));
|
|
117468
117502
|
}
|
|
117469
117503
|
|
|
117470
|
-
replaceWith(root, ArrayExpression$
|
|
117504
|
+
replaceWith(root, ArrayExpression$1(list));
|
|
117471
117505
|
};
|
|
117472
117506
|
|
|
117473
117507
|
convertFilesystemToSimpleFilesystem.traverse = ({push}) => ({
|
|
117474
117508
|
[`${__filesystem_name$1}(__object)`]: (path) => {
|
|
117475
117509
|
const root = path.get('arguments.0');
|
|
117476
|
-
const files = findFile$
|
|
117510
|
+
const files = findFile$4(root, '*');
|
|
117477
117511
|
|
|
117478
117512
|
push(root, {
|
|
117479
117513
|
files,
|
|
@@ -117481,15 +117515,15 @@ convertFilesystemToSimpleFilesystem.traverse = ({push}) => ({
|
|
|
117481
117515
|
},
|
|
117482
117516
|
});
|
|
117483
117517
|
|
|
117484
|
-
const fullstore$
|
|
117518
|
+
const fullstore$1 = fullstore$5;
|
|
117485
117519
|
const {compare: compare$1} = compare$5;
|
|
117486
117520
|
const {__filesystem_name} = json;
|
|
117487
117521
|
|
|
117488
117522
|
const {
|
|
117489
|
-
findFile: findFile$
|
|
117523
|
+
findFile: findFile$3,
|
|
117490
117524
|
pause,
|
|
117491
117525
|
start,
|
|
117492
|
-
} = filesystem$
|
|
117526
|
+
} = filesystem$2;
|
|
117493
117527
|
|
|
117494
117528
|
const log$1 = browserExports('putout:runner:scanner');
|
|
117495
117529
|
|
|
@@ -117541,7 +117575,7 @@ const createFileProgress = ({rule, progress}) => ({i, n}) => {
|
|
|
117541
117575
|
};
|
|
117542
117576
|
|
|
117543
117577
|
const createTrackFile = (fileProgress) => function*(...a) {
|
|
117544
|
-
const files = findFile$
|
|
117578
|
+
const files = findFile$3(...a);
|
|
117545
117579
|
const n = files.length;
|
|
117546
117580
|
|
|
117547
117581
|
for (const [i, file] of files.entries()) {
|
|
@@ -117559,7 +117593,7 @@ const getTraverse = ({scan, rule, progress}) => ({push, options}) => ({
|
|
|
117559
117593
|
progress.start(rule);
|
|
117560
117594
|
|
|
117561
117595
|
const rootPath = path.get('arguments.0');
|
|
117562
|
-
const isSimple = fullstore$
|
|
117596
|
+
const isSimple = fullstore$1(false);
|
|
117563
117597
|
|
|
117564
117598
|
const fileProgress = createFileProgress({
|
|
117565
117599
|
rule,
|
|
@@ -117643,7 +117677,7 @@ function parseVisitor(visitors) {
|
|
|
117643
117677
|
|
|
117644
117678
|
var template$3 = {exports: {}};
|
|
117645
117679
|
|
|
117646
|
-
const tryCatch$
|
|
117680
|
+
const tryCatch$2 = tryCatch$8;
|
|
117647
117681
|
|
|
117648
117682
|
const {
|
|
117649
117683
|
compareAny: compareAny$1,
|
|
@@ -117652,7 +117686,7 @@ const {
|
|
|
117652
117686
|
isTemplate: isTemplate$1,
|
|
117653
117687
|
} = compare$5;
|
|
117654
117688
|
|
|
117655
|
-
const maybeArray$
|
|
117689
|
+
const maybeArray$1 = maybeArray_1;
|
|
117656
117690
|
const debug$1 = browserExports('putout:runner:template');
|
|
117657
117691
|
|
|
117658
117692
|
const {entries: entries$3} = Object;
|
|
@@ -117686,8 +117720,8 @@ const exclude = ({rule, tmpl, fn, nodesExclude}) => {
|
|
|
117686
117720
|
|
|
117687
117721
|
template$3.exports = ({rule, visitor, options}) => {
|
|
117688
117722
|
const parsed = [];
|
|
117689
|
-
const nodesExclude = maybeArray$
|
|
117690
|
-
const nodesInclude = maybeArray$
|
|
117723
|
+
const nodesExclude = maybeArray$1(options.exclude);
|
|
117724
|
+
const nodesInclude = maybeArray$1(options.include);
|
|
117691
117725
|
|
|
117692
117726
|
for (const [tmpl, fn] of entries$3(visitor)) {
|
|
117693
117727
|
if (!tmpl)
|
|
@@ -117738,7 +117772,7 @@ function wrapWithCheck({rule, nodesInclude, nodesExclude, fn}) {
|
|
|
117738
117772
|
if (!isFn(fn))
|
|
117739
117773
|
throw Error(`☝️ Looks like provided visitor is not a function: ${stringify(fn)}. More on using Traverser: https://git.io/JqcMn`);
|
|
117740
117774
|
|
|
117741
|
-
const [e] = tryCatch$
|
|
117775
|
+
const [e] = tryCatch$2(fn, path);
|
|
117742
117776
|
|
|
117743
117777
|
if (e) {
|
|
117744
117778
|
e.rule = rule;
|
|
@@ -118531,7 +118565,7 @@ function cutBrackets(a) {
|
|
|
118531
118565
|
return a.replace(/\s\(\d:\d+\)/, '');
|
|
118532
118566
|
}
|
|
118533
118567
|
|
|
118534
|
-
const tryCatch$
|
|
118568
|
+
const tryCatch$1 = tryCatch$8;
|
|
118535
118569
|
const {defaultOptions: defaultOptions$1} = defaultOptions$4;
|
|
118536
118570
|
const {cutShebang: cutShebang$1} = shebang;
|
|
118537
118571
|
const parseError$1 = parseError$2;
|
|
@@ -118564,7 +118598,7 @@ transform$5.transform = (ast, source, opts) => {
|
|
|
118564
118598
|
|
|
118565
118599
|
const [, shebang] = cutShebang$1(source);
|
|
118566
118600
|
|
|
118567
|
-
const [validationError] = tryCatch$
|
|
118601
|
+
const [validationError] = tryCatch$1(validateRules, {
|
|
118568
118602
|
rules,
|
|
118569
118603
|
pluginNames,
|
|
118570
118604
|
});
|
|
@@ -118606,7 +118640,7 @@ transform$5.transformAsync = async (ast, source, opts) => {
|
|
|
118606
118640
|
|
|
118607
118641
|
const [, shebang] = cutShebang$1(source);
|
|
118608
118642
|
|
|
118609
|
-
const [validationError] = tryCatch$
|
|
118643
|
+
const [validationError] = tryCatch$1(validateRules, {
|
|
118610
118644
|
rules,
|
|
118611
118645
|
pluginNames,
|
|
118612
118646
|
});
|
|
@@ -118650,8 +118684,8 @@ findPlaces$2.findPlacesAsync = async (ast, source, opts) => {
|
|
|
118650
118684
|
});
|
|
118651
118685
|
};
|
|
118652
118686
|
|
|
118653
|
-
const {isArray: isArray$
|
|
118654
|
-
const noop$
|
|
118687
|
+
const {isArray: isArray$1} = Array;
|
|
118688
|
+
const noop$1 = () => {};
|
|
118655
118689
|
|
|
118656
118690
|
var report$3 = () => {
|
|
118657
118691
|
let filesCount = 0;
|
|
@@ -118665,11 +118699,11 @@ var report$3 = () => {
|
|
|
118665
118699
|
places,
|
|
118666
118700
|
index = 0,
|
|
118667
118701
|
count = 1,
|
|
118668
|
-
trace = noop$
|
|
118702
|
+
trace = noop$1,
|
|
118669
118703
|
formatterOptions = {},
|
|
118670
118704
|
} = options;
|
|
118671
118705
|
|
|
118672
|
-
if (!isArray$
|
|
118706
|
+
if (!isArray$1(places))
|
|
118673
118707
|
throw Error(`☝️ Looks like for 'places: Places[]' you passed the wrong type: '${typeof places}'`);
|
|
118674
118708
|
|
|
118675
118709
|
if (places.length)
|
|
@@ -118707,7 +118741,7 @@ report$3.default;
|
|
|
118707
118741
|
|
|
118708
118742
|
var traverse$5 = {};
|
|
118709
118743
|
|
|
118710
|
-
const {types: types$
|
|
118744
|
+
const {types: types$4, traverse: babelTraverse} = bundle;
|
|
118711
118745
|
|
|
118712
118746
|
const {
|
|
118713
118747
|
compare,
|
|
@@ -118716,7 +118750,7 @@ const {
|
|
|
118716
118750
|
getTemplateValues,
|
|
118717
118751
|
} = compare$5;
|
|
118718
118752
|
|
|
118719
|
-
const {isFile, isProgram: isProgram$
|
|
118753
|
+
const {isFile, isProgram: isProgram$1} = types$4;
|
|
118720
118754
|
const {merge} = babelTraverse.visitors;
|
|
118721
118755
|
const {entries: entries$2} = Object;
|
|
118722
118756
|
|
|
@@ -118727,7 +118761,7 @@ const createTraverse = (path) => {
|
|
|
118727
118761
|
if (isPath(path))
|
|
118728
118762
|
return path.traverse.bind(path);
|
|
118729
118763
|
|
|
118730
|
-
const noScope = !isFile(path) && !isProgram$
|
|
118764
|
+
const noScope = !isFile(path) && !isProgram$1(path);
|
|
118731
118765
|
|
|
118732
118766
|
return (visitors) => {
|
|
118733
118767
|
babelTraverse(path, {
|
|
@@ -125904,16 +125938,16 @@ var addArgs = {};
|
|
|
125904
125938
|
|
|
125905
125939
|
const {compareAny} = compare$5;
|
|
125906
125940
|
const {template: template$1} = parser$6;
|
|
125907
|
-
const {types: types$
|
|
125941
|
+
const {types: types$3} = bundle;
|
|
125908
125942
|
const {
|
|
125909
125943
|
ObjectPattern,
|
|
125910
|
-
ObjectProperty: ObjectProperty$
|
|
125944
|
+
ObjectProperty: ObjectProperty$1,
|
|
125911
125945
|
isBlockStatement,
|
|
125912
125946
|
isFunction,
|
|
125913
125947
|
isLabeledStatement,
|
|
125914
125948
|
isObjectPattern,
|
|
125915
125949
|
isCallExpression,
|
|
125916
|
-
} = types$
|
|
125950
|
+
} = types$3;
|
|
125917
125951
|
|
|
125918
125952
|
const {entries: entries$1} = Object;
|
|
125919
125953
|
|
|
@@ -126015,12 +126049,12 @@ const traverse$1 = (args) => ({push, options}) => {
|
|
|
126015
126049
|
function createProperty(node) {
|
|
126016
126050
|
if (!isLabeledStatement(node)) {
|
|
126017
126051
|
const {expression} = node;
|
|
126018
|
-
return ObjectProperty$
|
|
126052
|
+
return ObjectProperty$1(expression, expression, !COMPUTED, SHORTHAND);
|
|
126019
126053
|
}
|
|
126020
126054
|
|
|
126021
126055
|
const {label, body} = node;
|
|
126022
126056
|
|
|
126023
|
-
return ObjectProperty$
|
|
126057
|
+
return ObjectProperty$1(label, body.expression, !COMPUTED, SHORTHAND);
|
|
126024
126058
|
}
|
|
126025
126059
|
|
|
126026
126060
|
function getObjectPattern(params) {
|
|
@@ -126035,6 +126069,399 @@ function getObjectPattern(params) {
|
|
|
126035
126069
|
];
|
|
126036
126070
|
}
|
|
126037
126071
|
|
|
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
|
+
|
|
126038
126465
|
var matchFiles = {};
|
|
126039
126466
|
|
|
126040
126467
|
// A simple implementation of make-array
|
|
@@ -126377,11 +126804,11 @@ const makeRegex = (pattern, ignoreCase) => {
|
|
|
126377
126804
|
: new RegExp(source)
|
|
126378
126805
|
};
|
|
126379
126806
|
|
|
126380
|
-
const isString$
|
|
126807
|
+
const isString$1 = subject => typeof subject === 'string';
|
|
126381
126808
|
|
|
126382
126809
|
// > A blank line matches no files, so it can serve as a separator for readability.
|
|
126383
126810
|
const checkPattern = pattern => pattern
|
|
126384
|
-
&& isString$
|
|
126811
|
+
&& isString$1(pattern)
|
|
126385
126812
|
&& !REGEX_TEST_BLANK_LINE.test(pattern)
|
|
126386
126813
|
&& !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern)
|
|
126387
126814
|
|
|
@@ -126437,7 +126864,7 @@ const throwError = (message, Ctor) => {
|
|
|
126437
126864
|
};
|
|
126438
126865
|
|
|
126439
126866
|
const checkPath = (path, originalPath, doThrow) => {
|
|
126440
|
-
if (!isString$
|
|
126867
|
+
if (!isString$1(path)) {
|
|
126441
126868
|
return doThrow(
|
|
126442
126869
|
`path must be a string, but got \`${originalPath}\``,
|
|
126443
126870
|
TypeError
|
|
@@ -126505,7 +126932,7 @@ class Ignore {
|
|
|
126505
126932
|
this._added = false;
|
|
126506
126933
|
|
|
126507
126934
|
makeArray(
|
|
126508
|
-
isString$
|
|
126935
|
+
isString$1(pattern)
|
|
126509
126936
|
? splitPattern(pattern)
|
|
126510
126937
|
: pattern
|
|
126511
126938
|
).forEach(this._addPattern, this);
|
|
@@ -126707,399 +127134,6 @@ function mergeIgnores(ignores) {
|
|
|
126707
127134
|
|
|
126708
127135
|
ignores$2.default;
|
|
126709
127136
|
|
|
126710
|
-
var filesystem$1 = {};
|
|
126711
|
-
|
|
126712
|
-
var maybeFs$1 = {};
|
|
126713
|
-
|
|
126714
|
-
const fullstore$1 = fullstore$6;
|
|
126715
|
-
const driverStore$1 = fullstore$1();
|
|
126716
|
-
|
|
126717
|
-
const {assign: assign$1} = Object;
|
|
126718
|
-
const noop$1 = () => {};
|
|
126719
|
-
const returns$1 = (a) => () => a;
|
|
126720
|
-
|
|
126721
|
-
const defaultFS$1 = {
|
|
126722
|
-
renameFile: noop$1,
|
|
126723
|
-
removeFile: noop$1,
|
|
126724
|
-
createDirectory: noop$1,
|
|
126725
|
-
readFileContent: returns$1(''),
|
|
126726
|
-
writeFileContent: noop$1,
|
|
126727
|
-
copyFile: noop$1,
|
|
126728
|
-
};
|
|
126729
|
-
|
|
126730
|
-
const maybeFS$3 = assign$1({}, defaultFS$1);
|
|
126731
|
-
|
|
126732
|
-
maybeFs$1.renameFile = (oldName, newName) => {
|
|
126733
|
-
maybeFS$3.renameFile(oldName, newName);
|
|
126734
|
-
};
|
|
126735
|
-
|
|
126736
|
-
maybeFs$1.removeFile = (name) => {
|
|
126737
|
-
maybeFS$3.removeFile(name);
|
|
126738
|
-
};
|
|
126739
|
-
|
|
126740
|
-
maybeFs$1.copyFile = (from, to) => {
|
|
126741
|
-
maybeFS$3.copyFile(from, to);
|
|
126742
|
-
};
|
|
126743
|
-
|
|
126744
|
-
maybeFs$1.createDirectory = (name) => {
|
|
126745
|
-
maybeFS$3.createDirectory(name);
|
|
126746
|
-
};
|
|
126747
|
-
|
|
126748
|
-
maybeFs$1.readFileContent = (name) => {
|
|
126749
|
-
return maybeFS$3.readFileContent(name);
|
|
126750
|
-
};
|
|
126751
|
-
|
|
126752
|
-
maybeFs$1.writeFileContent = (name, content) => {
|
|
126753
|
-
maybeFS$3.writeFileContent(name, content);
|
|
126754
|
-
};
|
|
126755
|
-
|
|
126756
|
-
maybeFs$1.init = init$1;
|
|
126757
|
-
|
|
126758
|
-
function init$1(fsDriver) {
|
|
126759
|
-
assign$1(maybeFS$3, fsDriver);
|
|
126760
|
-
}
|
|
126761
|
-
|
|
126762
|
-
maybeFs$1.pause = () => {
|
|
126763
|
-
driverStore$1(maybeFS$3);
|
|
126764
|
-
deinit$1();
|
|
126765
|
-
};
|
|
126766
|
-
|
|
126767
|
-
maybeFs$1.start = () => {
|
|
126768
|
-
init$1(driverStore$1());
|
|
126769
|
-
};
|
|
126770
|
-
|
|
126771
|
-
maybeFs$1.deinit = deinit$1;
|
|
126772
|
-
|
|
126773
|
-
function deinit$1() {
|
|
126774
|
-
assign$1(maybeFS$3, defaultFS$1);
|
|
126775
|
-
}
|
|
126776
|
-
|
|
126777
|
-
const {join: join$3, basename: basename$1} = require$$0$2;
|
|
126778
|
-
const tryCatch$1 = tryCatch$9;
|
|
126779
|
-
const {types: types$3} = bundle;
|
|
126780
|
-
|
|
126781
|
-
const {
|
|
126782
|
-
setLiteralValue: setLiteralValue$1,
|
|
126783
|
-
getProperty: getProperty$1,
|
|
126784
|
-
traverseProperties: traverseProperties$2,
|
|
126785
|
-
} = operate;
|
|
126786
|
-
|
|
126787
|
-
const maybeFS$2 = maybeFs$1;
|
|
126788
|
-
const isString$2 = (a) => typeof a === 'string';
|
|
126789
|
-
const {isArray: isArray$1} = Array;
|
|
126790
|
-
const maybeArray$1 = (a) => isArray$1(a) ? a : [a];
|
|
126791
|
-
|
|
126792
|
-
const toBase64$1 = (content) => {
|
|
126793
|
-
const [e, result] = tryCatch$1(btoa, content);
|
|
126794
|
-
|
|
126795
|
-
if (e)
|
|
126796
|
-
return btoa(encodeURI(content));
|
|
126797
|
-
|
|
126798
|
-
return result;
|
|
126799
|
-
};
|
|
126800
|
-
|
|
126801
|
-
const fromBase64$1 = (content) => {
|
|
126802
|
-
const [e, decoded] = tryCatch$1(atob, content);
|
|
126803
|
-
|
|
126804
|
-
if (!e)
|
|
126805
|
-
return decodeURI(decoded);
|
|
126806
|
-
|
|
126807
|
-
return content;
|
|
126808
|
-
};
|
|
126809
|
-
|
|
126810
|
-
const {
|
|
126811
|
-
ObjectExpression: ObjectExpression$1,
|
|
126812
|
-
ArrayExpression: ArrayExpression$1,
|
|
126813
|
-
StringLiteral: StringLiteral$2,
|
|
126814
|
-
ObjectProperty: ObjectProperty$1,
|
|
126815
|
-
isProgram: isProgram$1,
|
|
126816
|
-
} = types$3;
|
|
126817
|
-
|
|
126818
|
-
const getRegExp$1 = (wildcard) => {
|
|
126819
|
-
const escaped = wildcard
|
|
126820
|
-
.replace(/\./g, '\\.')
|
|
126821
|
-
.replace(/\*/g, '.*')
|
|
126822
|
-
.replace('?', '.?');
|
|
126823
|
-
|
|
126824
|
-
return RegExp(`^${escaped}$`);
|
|
126825
|
-
};
|
|
126826
|
-
|
|
126827
|
-
filesystem$1.getParentDirectory = (filePath) => {
|
|
126828
|
-
const {parentPath} = filePath.parentPath.parentPath;
|
|
126829
|
-
|
|
126830
|
-
if (isProgram$1(parentPath))
|
|
126831
|
-
return null;
|
|
126832
|
-
|
|
126833
|
-
return parentPath;
|
|
126834
|
-
};
|
|
126835
|
-
|
|
126836
|
-
filesystem$1.findFile = findFile$3;
|
|
126837
|
-
|
|
126838
|
-
function findFile$3(node, name) {
|
|
126839
|
-
checkName$1(name);
|
|
126840
|
-
|
|
126841
|
-
const filePaths = [];
|
|
126842
|
-
const names = maybeArray$1(name);
|
|
126843
|
-
|
|
126844
|
-
for (const filenamePath of traverseProperties$2(node, 'filename')) {
|
|
126845
|
-
const {value} = filenamePath.node.value;
|
|
126846
|
-
const base = basename$1(value);
|
|
126847
|
-
|
|
126848
|
-
for (const name of names) {
|
|
126849
|
-
if (value === name || getRegExp$1(name).test(base))
|
|
126850
|
-
filePaths.push(filenamePath.parentPath);
|
|
126851
|
-
}
|
|
126852
|
-
}
|
|
126853
|
-
|
|
126854
|
-
return filePaths;
|
|
126855
|
-
}
|
|
126856
|
-
|
|
126857
|
-
function checkName$1(name) {
|
|
126858
|
-
if (!isString$2(name) && !isArray$1(name))
|
|
126859
|
-
throw Error(`☝️ Looks like you forget to pass the 'name' of a file to 'findFile(filePath: Path|FilePath, name: string | string[]): FilePath'`);
|
|
126860
|
-
}
|
|
126861
|
-
|
|
126862
|
-
function getFilenamePath$1(filePath) {
|
|
126863
|
-
const filenamePath = getProperty$1(filePath, 'filename');
|
|
126864
|
-
return filenamePath.get('value');
|
|
126865
|
-
}
|
|
126866
|
-
|
|
126867
|
-
function getFilename$3(filePath) {
|
|
126868
|
-
const {value} = getFilenamePath$1(filePath).node;
|
|
126869
|
-
return value;
|
|
126870
|
-
}
|
|
126871
|
-
|
|
126872
|
-
filesystem$1.getFileType = getFileType$1;
|
|
126873
|
-
|
|
126874
|
-
function getFileType$1(filePath) {
|
|
126875
|
-
const typePath = getProperty$1(filePath, 'type');
|
|
126876
|
-
return typePath.node.value.value;
|
|
126877
|
-
}
|
|
126878
|
-
|
|
126879
|
-
filesystem$1.getFileContent = getFileContent$1;
|
|
126880
|
-
|
|
126881
|
-
function getFileContent$1(filePath) {
|
|
126882
|
-
const content = getProperty$1(filePath, 'content');
|
|
126883
|
-
|
|
126884
|
-
return [
|
|
126885
|
-
Boolean(content),
|
|
126886
|
-
content?.node.value.value,
|
|
126887
|
-
];
|
|
126888
|
-
}
|
|
126889
|
-
|
|
126890
|
-
filesystem$1.getFilename = getFilename$3;
|
|
126891
|
-
|
|
126892
|
-
filesystem$1.renameFile = (filePath, name) => {
|
|
126893
|
-
const oldName = getFilename$3(filePath);
|
|
126894
|
-
const valuePath = getFilenamePath$1(filePath);
|
|
126895
|
-
const baseName = oldName
|
|
126896
|
-
.split('/')
|
|
126897
|
-
.pop();
|
|
126898
|
-
|
|
126899
|
-
const newName = name
|
|
126900
|
-
.split('/')
|
|
126901
|
-
.pop();
|
|
126902
|
-
|
|
126903
|
-
const newFilename = oldName.replace(baseName, newName);
|
|
126904
|
-
|
|
126905
|
-
setLiteralValue$1(valuePath, newFilename);
|
|
126906
|
-
maybeFS$2.renameFile(oldName, newFilename);
|
|
126907
|
-
};
|
|
126908
|
-
|
|
126909
|
-
filesystem$1.removeFile = (filePath) => {
|
|
126910
|
-
const filename = getFilename$3(filePath);
|
|
126911
|
-
|
|
126912
|
-
filePath.remove();
|
|
126913
|
-
maybeFS$2.removeFile(filename);
|
|
126914
|
-
};
|
|
126915
|
-
|
|
126916
|
-
filesystem$1.moveFile = (filePath, dirPath) => {
|
|
126917
|
-
if (filePath === dirPath)
|
|
126918
|
-
return;
|
|
126919
|
-
|
|
126920
|
-
const dirname = getFilename$3(dirPath);
|
|
126921
|
-
const filename = getFilename$3(filePath);
|
|
126922
|
-
const dirPathFiles = getProperty$1(dirPath, 'files');
|
|
126923
|
-
const filenamePath = getProperty$1(filePath, 'filename');
|
|
126924
|
-
|
|
126925
|
-
const basename = filename
|
|
126926
|
-
.split('/')
|
|
126927
|
-
.pop();
|
|
126928
|
-
|
|
126929
|
-
const newFilename = join$3(dirname, basename);
|
|
126930
|
-
|
|
126931
|
-
maybeRemoveFile$1(dirPath, newFilename);
|
|
126932
|
-
|
|
126933
|
-
setLiteralValue$1(filenamePath.get('value'), newFilename);
|
|
126934
|
-
dirPathFiles.node.value.elements.push(filePath.node);
|
|
126935
|
-
|
|
126936
|
-
filePath.remove();
|
|
126937
|
-
maybeFS$2.renameFile(filename, newFilename);
|
|
126938
|
-
};
|
|
126939
|
-
|
|
126940
|
-
filesystem$1.copyFile = (filePath, dirPath) => {
|
|
126941
|
-
const dirname = getFilename$3(dirPath);
|
|
126942
|
-
const filename = getFilename$3(filePath);
|
|
126943
|
-
|
|
126944
|
-
const basename = filename
|
|
126945
|
-
.split('/')
|
|
126946
|
-
.pop();
|
|
126947
|
-
|
|
126948
|
-
const newFilename = join$3(dirname, basename);
|
|
126949
|
-
const [hasContent, content] = getFileContent$1(filePath);
|
|
126950
|
-
|
|
126951
|
-
const copiedFile = ObjectExpression$1([
|
|
126952
|
-
createTypeProperty$1('file'),
|
|
126953
|
-
createFilenameProperty$1(newFilename),
|
|
126954
|
-
hasContent && createContentProperty$1(content),
|
|
126955
|
-
].filter(Boolean));
|
|
126956
|
-
|
|
126957
|
-
maybeRemoveFile$1(dirPath, newFilename);
|
|
126958
|
-
|
|
126959
|
-
const dirPathFiles = getFiles$1(dirPath);
|
|
126960
|
-
dirPathFiles.node.value.elements.push(copiedFile);
|
|
126961
|
-
|
|
126962
|
-
maybeFS$2.copyFile(filename, newFilename);
|
|
126963
|
-
};
|
|
126964
|
-
|
|
126965
|
-
function maybeRemoveFile$1(dirPath, filename) {
|
|
126966
|
-
const type = getFileType$1(dirPath);
|
|
126967
|
-
|
|
126968
|
-
if (type !== 'directory') {
|
|
126969
|
-
const filename = getFilename$3(dirPath);
|
|
126970
|
-
throw Error(`☝️ Looks like '${filename}' is not a directory, but: '${type}'. Rename to '${filename}/'`);
|
|
126971
|
-
}
|
|
126972
|
-
|
|
126973
|
-
const dirPathFiles = getProperty$1(dirPath, 'files');
|
|
126974
|
-
const name = join$3(getFilename$3(dirPath), basename$1(filename));
|
|
126975
|
-
const [fileToOverwrite] = findFile$3(dirPathFiles, name);
|
|
126976
|
-
|
|
126977
|
-
if (!fileToOverwrite)
|
|
126978
|
-
return;
|
|
126979
|
-
|
|
126980
|
-
fileToOverwrite.remove();
|
|
126981
|
-
}
|
|
126982
|
-
|
|
126983
|
-
const createTypeProperty$1 = (type) => ObjectProperty$1(StringLiteral$2('type'), StringLiteral$2(type));
|
|
126984
|
-
|
|
126985
|
-
filesystem$1.createTypeProperty = createTypeProperty$1;
|
|
126986
|
-
|
|
126987
|
-
const createFilesProperty$1 = (files) => ObjectProperty$1(StringLiteral$2('files'), ArrayExpression$1(files));
|
|
126988
|
-
|
|
126989
|
-
filesystem$1.createFilesProperty = createFilesProperty$1;
|
|
126990
|
-
|
|
126991
|
-
const createFilenameProperty$1 = (filename) => ObjectProperty$1(StringLiteral$2('filename'), StringLiteral$2(filename));
|
|
126992
|
-
|
|
126993
|
-
filesystem$1.createFilenameProperty = createFilenameProperty$1;
|
|
126994
|
-
|
|
126995
|
-
const createContentProperty$1 = (content) => ObjectProperty$1(StringLiteral$2('content'), StringLiteral$2(content));
|
|
126996
|
-
|
|
126997
|
-
filesystem$1.createContentProperty = createContentProperty$1;
|
|
126998
|
-
|
|
126999
|
-
filesystem$1.createFile = (dirPath, name, content) => {
|
|
127000
|
-
maybeRemoveFile$1(dirPath, name);
|
|
127001
|
-
|
|
127002
|
-
const dirPathFiles = getFiles$1(dirPath);
|
|
127003
|
-
const parentFilename = getFilename$3(dirPath);
|
|
127004
|
-
const filename = join$3(parentFilename, name);
|
|
127005
|
-
|
|
127006
|
-
const typeProperty = createTypeProperty$1('file');
|
|
127007
|
-
const filenameProperty = createFilenameProperty$1(filename);
|
|
127008
|
-
|
|
127009
|
-
const properties = [
|
|
127010
|
-
typeProperty,
|
|
127011
|
-
filenameProperty,
|
|
127012
|
-
content && createContentProperty$1(content),
|
|
127013
|
-
].filter(Boolean);
|
|
127014
|
-
|
|
127015
|
-
dirPathFiles.node.value.elements.push(ObjectExpression$1(properties));
|
|
127016
|
-
|
|
127017
|
-
const filePath = dirPathFiles
|
|
127018
|
-
.get('value.elements')
|
|
127019
|
-
.at(-1);
|
|
127020
|
-
|
|
127021
|
-
if (isString$2(content))
|
|
127022
|
-
writeFileContent$2(filePath, content);
|
|
127023
|
-
|
|
127024
|
-
return filePath;
|
|
127025
|
-
};
|
|
127026
|
-
|
|
127027
|
-
function getFiles$1(dirPath) {
|
|
127028
|
-
return getProperty$1(dirPath, 'files');
|
|
127029
|
-
}
|
|
127030
|
-
|
|
127031
|
-
filesystem$1.createDirectory = (dirPath, name) => {
|
|
127032
|
-
const dirPathFiles = getFiles$1(dirPath);
|
|
127033
|
-
const parentFilename = getFilename$3(dirPath);
|
|
127034
|
-
const filename = join$3(parentFilename, name);
|
|
127035
|
-
|
|
127036
|
-
const typeProperty = createTypeProperty$1('directory');
|
|
127037
|
-
const filesProperty = createFilesProperty$1([]);
|
|
127038
|
-
const filenameProperty = createFilenameProperty$1(filename);
|
|
127039
|
-
|
|
127040
|
-
dirPathFiles.node.value.elements.push(ObjectExpression$1([
|
|
127041
|
-
typeProperty,
|
|
127042
|
-
filenameProperty,
|
|
127043
|
-
filesProperty,
|
|
127044
|
-
]));
|
|
127045
|
-
|
|
127046
|
-
maybeFS$2.createDirectory(filename);
|
|
127047
|
-
|
|
127048
|
-
return dirPathFiles
|
|
127049
|
-
.get('value.elements')
|
|
127050
|
-
.at(-1);
|
|
127051
|
-
};
|
|
127052
|
-
|
|
127053
|
-
filesystem$1.readFileContent = (filePath) => {
|
|
127054
|
-
const fileType = getFileType$1(filePath);
|
|
127055
|
-
|
|
127056
|
-
if (fileType === 'directory')
|
|
127057
|
-
return '';
|
|
127058
|
-
|
|
127059
|
-
const [hasContent, content] = getFileContent$1(filePath);
|
|
127060
|
-
|
|
127061
|
-
if (hasContent)
|
|
127062
|
-
return fromBase64$1(content);
|
|
127063
|
-
|
|
127064
|
-
const filename = getFilename$3(filePath);
|
|
127065
|
-
const fileContent = maybeFS$2.readFileContent(filename);
|
|
127066
|
-
|
|
127067
|
-
const property = createContentProperty$1(toBase64$1(fileContent));
|
|
127068
|
-
|
|
127069
|
-
filePath.node.properties.push(property);
|
|
127070
|
-
|
|
127071
|
-
return fileContent;
|
|
127072
|
-
};
|
|
127073
|
-
|
|
127074
|
-
filesystem$1.writeFileContent = writeFileContent$2;
|
|
127075
|
-
|
|
127076
|
-
function writeFileContent$2(filePath, content) {
|
|
127077
|
-
const fileType = getFileType$1(filePath);
|
|
127078
|
-
|
|
127079
|
-
if (fileType === 'directory')
|
|
127080
|
-
return;
|
|
127081
|
-
|
|
127082
|
-
const filename = getFilename$3(filePath);
|
|
127083
|
-
|
|
127084
|
-
maybeFS$2.writeFileContent(filename, content);
|
|
127085
|
-
|
|
127086
|
-
const contentPath = getProperty$1(filePath, 'content');
|
|
127087
|
-
|
|
127088
|
-
if (contentPath) {
|
|
127089
|
-
setLiteralValue$1(contentPath.node.value, toBase64$1(content));
|
|
127090
|
-
return;
|
|
127091
|
-
}
|
|
127092
|
-
|
|
127093
|
-
const property = createContentProperty$1(toBase64$1(content));
|
|
127094
|
-
filePath.node.properties.push(property);
|
|
127095
|
-
}
|
|
127096
|
-
|
|
127097
|
-
filesystem$1.init = maybeFS$2.init;
|
|
127098
|
-
filesystem$1.deinit = maybeFS$2.deinit;
|
|
127099
|
-
|
|
127100
|
-
filesystem$1.pause = maybeFS$2.pause;
|
|
127101
|
-
filesystem$1.start = maybeFS$2.start;
|
|
127102
|
-
|
|
127103
127137
|
const path = require$$0$2;
|
|
127104
127138
|
|
|
127105
127139
|
const {parse: parse$2, print: print$1} = parser$6;
|
|
@@ -127111,15 +127145,15 @@ const {toJS, fromJS} = json;
|
|
|
127111
127145
|
|
|
127112
127146
|
const {
|
|
127113
127147
|
readFileContent: readFileContent$1,
|
|
127114
|
-
findFile: findFile$
|
|
127115
|
-
writeFileContent
|
|
127116
|
-
getFilename: getFilename$
|
|
127148
|
+
findFile: findFile$1,
|
|
127149
|
+
writeFileContent,
|
|
127150
|
+
getFilename: getFilename$1,
|
|
127117
127151
|
createFile,
|
|
127118
127152
|
removeFile,
|
|
127119
127153
|
getParentDirectory: getParentDirectory$1,
|
|
127120
127154
|
} = filesystem$1;
|
|
127121
127155
|
|
|
127122
|
-
const {join: join$
|
|
127156
|
+
const {join: join$1} = path;
|
|
127123
127157
|
|
|
127124
127158
|
const isObject = (a) => a && typeof a === 'object';
|
|
127125
127159
|
const {entries} = Object;
|
|
@@ -127147,7 +127181,7 @@ function fix$1(inputFile, {dirPath, mainPath, matchInputFilename, outputFilename
|
|
|
127147
127181
|
inputFile,
|
|
127148
127182
|
});
|
|
127149
127183
|
|
|
127150
|
-
writeFileContent
|
|
127184
|
+
writeFileContent(outputFile, matchedJSON);
|
|
127151
127185
|
|
|
127152
127186
|
if (inputFile !== outputFile)
|
|
127153
127187
|
removeFile(inputFile);
|
|
@@ -127155,15 +127189,15 @@ function fix$1(inputFile, {dirPath, mainPath, matchInputFilename, outputFilename
|
|
|
127155
127189
|
|
|
127156
127190
|
const createScan = (files) => (mainPath, {push, progress, options}) => {
|
|
127157
127191
|
const allFiles = [];
|
|
127158
|
-
const cwd = getFilename$
|
|
127192
|
+
const cwd = getFilename$1(mainPath);
|
|
127159
127193
|
|
|
127160
127194
|
for (const [filename, rawOptions] of entries(files)) {
|
|
127161
127195
|
const [matchInputFilename, outputFilename = matchInputFilename] = parseMatcher(filename, options);
|
|
127162
|
-
const inputFiles = findFile$
|
|
127196
|
+
const inputFiles = findFile$1(mainPath, matchInputFilename);
|
|
127163
127197
|
|
|
127164
127198
|
for (const inputFile of inputFiles) {
|
|
127165
127199
|
const dirPath = getParentDirectory$1(inputFile);
|
|
127166
|
-
const inputFilename = getFilename$
|
|
127200
|
+
const inputFilename = getFilename$1(inputFile);
|
|
127167
127201
|
|
|
127168
127202
|
if (ignores$1(cwd, inputFilename, options))
|
|
127169
127203
|
continue;
|
|
@@ -127264,8 +127298,8 @@ function getOutputFile(path, {dirPath, matchInputFilename, outputFilename, input
|
|
|
127264
127298
|
if (matchInputFilename === outputFilename)
|
|
127265
127299
|
return inputFile;
|
|
127266
127300
|
|
|
127267
|
-
const name = join$
|
|
127268
|
-
const [outputFile] = findFile$
|
|
127301
|
+
const name = join$1(getFilename$1(dirPath), outputFilename);
|
|
127302
|
+
const [outputFile] = findFile$1(dirPath, name);
|
|
127269
127303
|
|
|
127270
127304
|
if (outputFile)
|
|
127271
127305
|
return outputFile;
|
|
@@ -127304,399 +127338,6 @@ function parseOptions(inputFilename, rawOptions) {
|
|
|
127304
127338
|
|
|
127305
127339
|
var renameFiles = {};
|
|
127306
127340
|
|
|
127307
|
-
var filesystem = {};
|
|
127308
|
-
|
|
127309
|
-
var maybeFs = {};
|
|
127310
|
-
|
|
127311
|
-
const fullstore = fullstore$6;
|
|
127312
|
-
const driverStore = fullstore();
|
|
127313
|
-
|
|
127314
|
-
const {assign} = Object;
|
|
127315
|
-
const noop = () => {};
|
|
127316
|
-
const returns = (a) => () => a;
|
|
127317
|
-
|
|
127318
|
-
const defaultFS = {
|
|
127319
|
-
renameFile: noop,
|
|
127320
|
-
removeFile: noop,
|
|
127321
|
-
createDirectory: noop,
|
|
127322
|
-
readFileContent: returns(''),
|
|
127323
|
-
writeFileContent: noop,
|
|
127324
|
-
copyFile: noop,
|
|
127325
|
-
};
|
|
127326
|
-
|
|
127327
|
-
const maybeFS$1 = assign({}, defaultFS);
|
|
127328
|
-
|
|
127329
|
-
maybeFs.renameFile = (oldName, newName) => {
|
|
127330
|
-
maybeFS$1.renameFile(oldName, newName);
|
|
127331
|
-
};
|
|
127332
|
-
|
|
127333
|
-
maybeFs.removeFile = (name) => {
|
|
127334
|
-
maybeFS$1.removeFile(name);
|
|
127335
|
-
};
|
|
127336
|
-
|
|
127337
|
-
maybeFs.copyFile = (from, to) => {
|
|
127338
|
-
maybeFS$1.copyFile(from, to);
|
|
127339
|
-
};
|
|
127340
|
-
|
|
127341
|
-
maybeFs.createDirectory = (name) => {
|
|
127342
|
-
maybeFS$1.createDirectory(name);
|
|
127343
|
-
};
|
|
127344
|
-
|
|
127345
|
-
maybeFs.readFileContent = (name) => {
|
|
127346
|
-
return maybeFS$1.readFileContent(name);
|
|
127347
|
-
};
|
|
127348
|
-
|
|
127349
|
-
maybeFs.writeFileContent = (name, content) => {
|
|
127350
|
-
maybeFS$1.writeFileContent(name, content);
|
|
127351
|
-
};
|
|
127352
|
-
|
|
127353
|
-
maybeFs.init = init;
|
|
127354
|
-
|
|
127355
|
-
function init(fsDriver) {
|
|
127356
|
-
assign(maybeFS$1, fsDriver);
|
|
127357
|
-
}
|
|
127358
|
-
|
|
127359
|
-
maybeFs.pause = () => {
|
|
127360
|
-
driverStore(maybeFS$1);
|
|
127361
|
-
deinit();
|
|
127362
|
-
};
|
|
127363
|
-
|
|
127364
|
-
maybeFs.start = () => {
|
|
127365
|
-
init(driverStore());
|
|
127366
|
-
};
|
|
127367
|
-
|
|
127368
|
-
maybeFs.deinit = deinit;
|
|
127369
|
-
|
|
127370
|
-
function deinit() {
|
|
127371
|
-
assign(maybeFS$1, defaultFS);
|
|
127372
|
-
}
|
|
127373
|
-
|
|
127374
|
-
const {join: join$1, basename} = require$$0$2;
|
|
127375
|
-
const tryCatch = tryCatch$9;
|
|
127376
|
-
const {types: types$2} = bundle;
|
|
127377
|
-
|
|
127378
|
-
const {
|
|
127379
|
-
setLiteralValue,
|
|
127380
|
-
getProperty,
|
|
127381
|
-
traverseProperties: traverseProperties$1,
|
|
127382
|
-
} = operate;
|
|
127383
|
-
|
|
127384
|
-
const maybeFS = maybeFs;
|
|
127385
|
-
const isString$1 = (a) => typeof a === 'string';
|
|
127386
|
-
const {isArray} = Array;
|
|
127387
|
-
const maybeArray = (a) => isArray(a) ? a : [a];
|
|
127388
|
-
|
|
127389
|
-
const toBase64 = (content) => {
|
|
127390
|
-
const [e, result] = tryCatch(btoa, content);
|
|
127391
|
-
|
|
127392
|
-
if (e)
|
|
127393
|
-
return btoa(encodeURI(content));
|
|
127394
|
-
|
|
127395
|
-
return result;
|
|
127396
|
-
};
|
|
127397
|
-
|
|
127398
|
-
const fromBase64 = (content) => {
|
|
127399
|
-
const [e, decoded] = tryCatch(atob, content);
|
|
127400
|
-
|
|
127401
|
-
if (!e)
|
|
127402
|
-
return decodeURI(decoded);
|
|
127403
|
-
|
|
127404
|
-
return content;
|
|
127405
|
-
};
|
|
127406
|
-
|
|
127407
|
-
const {
|
|
127408
|
-
ObjectExpression,
|
|
127409
|
-
ArrayExpression,
|
|
127410
|
-
StringLiteral: StringLiteral$1,
|
|
127411
|
-
ObjectProperty,
|
|
127412
|
-
isProgram,
|
|
127413
|
-
} = types$2;
|
|
127414
|
-
|
|
127415
|
-
const getRegExp = (wildcard) => {
|
|
127416
|
-
const escaped = wildcard
|
|
127417
|
-
.replace(/\./g, '\\.')
|
|
127418
|
-
.replace(/\*/g, '.*')
|
|
127419
|
-
.replace('?', '.?');
|
|
127420
|
-
|
|
127421
|
-
return RegExp(`^${escaped}$`);
|
|
127422
|
-
};
|
|
127423
|
-
|
|
127424
|
-
filesystem.getParentDirectory = (filePath) => {
|
|
127425
|
-
const {parentPath} = filePath.parentPath.parentPath;
|
|
127426
|
-
|
|
127427
|
-
if (isProgram(parentPath))
|
|
127428
|
-
return null;
|
|
127429
|
-
|
|
127430
|
-
return parentPath;
|
|
127431
|
-
};
|
|
127432
|
-
|
|
127433
|
-
filesystem.findFile = findFile$1;
|
|
127434
|
-
|
|
127435
|
-
function findFile$1(node, name) {
|
|
127436
|
-
checkName(name);
|
|
127437
|
-
|
|
127438
|
-
const filePaths = [];
|
|
127439
|
-
const names = maybeArray(name);
|
|
127440
|
-
|
|
127441
|
-
for (const filenamePath of traverseProperties$1(node, 'filename')) {
|
|
127442
|
-
const {value} = filenamePath.node.value;
|
|
127443
|
-
const base = basename(value);
|
|
127444
|
-
|
|
127445
|
-
for (const name of names) {
|
|
127446
|
-
if (value === name || getRegExp(name).test(base))
|
|
127447
|
-
filePaths.push(filenamePath.parentPath);
|
|
127448
|
-
}
|
|
127449
|
-
}
|
|
127450
|
-
|
|
127451
|
-
return filePaths;
|
|
127452
|
-
}
|
|
127453
|
-
|
|
127454
|
-
function checkName(name) {
|
|
127455
|
-
if (!isString$1(name) && !isArray(name))
|
|
127456
|
-
throw Error(`☝️ Looks like you forget to pass the 'name' of a file to 'findFile(filePath: Path|FilePath, name: string | string[]): FilePath'`);
|
|
127457
|
-
}
|
|
127458
|
-
|
|
127459
|
-
function getFilenamePath(filePath) {
|
|
127460
|
-
const filenamePath = getProperty(filePath, 'filename');
|
|
127461
|
-
return filenamePath.get('value');
|
|
127462
|
-
}
|
|
127463
|
-
|
|
127464
|
-
function getFilename$1(filePath) {
|
|
127465
|
-
const {value} = getFilenamePath(filePath).node;
|
|
127466
|
-
return value;
|
|
127467
|
-
}
|
|
127468
|
-
|
|
127469
|
-
filesystem.getFileType = getFileType;
|
|
127470
|
-
|
|
127471
|
-
function getFileType(filePath) {
|
|
127472
|
-
const typePath = getProperty(filePath, 'type');
|
|
127473
|
-
return typePath.node.value.value;
|
|
127474
|
-
}
|
|
127475
|
-
|
|
127476
|
-
filesystem.getFileContent = getFileContent;
|
|
127477
|
-
|
|
127478
|
-
function getFileContent(filePath) {
|
|
127479
|
-
const content = getProperty(filePath, 'content');
|
|
127480
|
-
|
|
127481
|
-
return [
|
|
127482
|
-
Boolean(content),
|
|
127483
|
-
content?.node.value.value,
|
|
127484
|
-
];
|
|
127485
|
-
}
|
|
127486
|
-
|
|
127487
|
-
filesystem.getFilename = getFilename$1;
|
|
127488
|
-
|
|
127489
|
-
filesystem.renameFile = (filePath, name) => {
|
|
127490
|
-
const oldName = getFilename$1(filePath);
|
|
127491
|
-
const valuePath = getFilenamePath(filePath);
|
|
127492
|
-
const baseName = oldName
|
|
127493
|
-
.split('/')
|
|
127494
|
-
.pop();
|
|
127495
|
-
|
|
127496
|
-
const newName = name
|
|
127497
|
-
.split('/')
|
|
127498
|
-
.pop();
|
|
127499
|
-
|
|
127500
|
-
const newFilename = oldName.replace(baseName, newName);
|
|
127501
|
-
|
|
127502
|
-
setLiteralValue(valuePath, newFilename);
|
|
127503
|
-
maybeFS.renameFile(oldName, newFilename);
|
|
127504
|
-
};
|
|
127505
|
-
|
|
127506
|
-
filesystem.removeFile = (filePath) => {
|
|
127507
|
-
const filename = getFilename$1(filePath);
|
|
127508
|
-
|
|
127509
|
-
filePath.remove();
|
|
127510
|
-
maybeFS.removeFile(filename);
|
|
127511
|
-
};
|
|
127512
|
-
|
|
127513
|
-
filesystem.moveFile = (filePath, dirPath) => {
|
|
127514
|
-
if (filePath === dirPath)
|
|
127515
|
-
return;
|
|
127516
|
-
|
|
127517
|
-
const dirname = getFilename$1(dirPath);
|
|
127518
|
-
const filename = getFilename$1(filePath);
|
|
127519
|
-
const dirPathFiles = getProperty(dirPath, 'files');
|
|
127520
|
-
const filenamePath = getProperty(filePath, 'filename');
|
|
127521
|
-
|
|
127522
|
-
const basename = filename
|
|
127523
|
-
.split('/')
|
|
127524
|
-
.pop();
|
|
127525
|
-
|
|
127526
|
-
const newFilename = join$1(dirname, basename);
|
|
127527
|
-
|
|
127528
|
-
maybeRemoveFile(dirPath, newFilename);
|
|
127529
|
-
|
|
127530
|
-
setLiteralValue(filenamePath.get('value'), newFilename);
|
|
127531
|
-
dirPathFiles.node.value.elements.push(filePath.node);
|
|
127532
|
-
|
|
127533
|
-
filePath.remove();
|
|
127534
|
-
maybeFS.renameFile(filename, newFilename);
|
|
127535
|
-
};
|
|
127536
|
-
|
|
127537
|
-
filesystem.copyFile = (filePath, dirPath) => {
|
|
127538
|
-
const dirname = getFilename$1(dirPath);
|
|
127539
|
-
const filename = getFilename$1(filePath);
|
|
127540
|
-
|
|
127541
|
-
const basename = filename
|
|
127542
|
-
.split('/')
|
|
127543
|
-
.pop();
|
|
127544
|
-
|
|
127545
|
-
const newFilename = join$1(dirname, basename);
|
|
127546
|
-
const [hasContent, content] = getFileContent(filePath);
|
|
127547
|
-
|
|
127548
|
-
const copiedFile = ObjectExpression([
|
|
127549
|
-
createTypeProperty('file'),
|
|
127550
|
-
createFilenameProperty(newFilename),
|
|
127551
|
-
hasContent && createContentProperty(content),
|
|
127552
|
-
].filter(Boolean));
|
|
127553
|
-
|
|
127554
|
-
maybeRemoveFile(dirPath, newFilename);
|
|
127555
|
-
|
|
127556
|
-
const dirPathFiles = getFiles(dirPath);
|
|
127557
|
-
dirPathFiles.node.value.elements.push(copiedFile);
|
|
127558
|
-
|
|
127559
|
-
maybeFS.copyFile(filename, newFilename);
|
|
127560
|
-
};
|
|
127561
|
-
|
|
127562
|
-
function maybeRemoveFile(dirPath, filename) {
|
|
127563
|
-
const type = getFileType(dirPath);
|
|
127564
|
-
|
|
127565
|
-
if (type !== 'directory') {
|
|
127566
|
-
const filename = getFilename$1(dirPath);
|
|
127567
|
-
throw Error(`☝️ Looks like '${filename}' is not a directory, but: '${type}'. Rename to '${filename}/'`);
|
|
127568
|
-
}
|
|
127569
|
-
|
|
127570
|
-
const dirPathFiles = getProperty(dirPath, 'files');
|
|
127571
|
-
const name = join$1(getFilename$1(dirPath), basename(filename));
|
|
127572
|
-
const [fileToOverwrite] = findFile$1(dirPathFiles, name);
|
|
127573
|
-
|
|
127574
|
-
if (!fileToOverwrite)
|
|
127575
|
-
return;
|
|
127576
|
-
|
|
127577
|
-
fileToOverwrite.remove();
|
|
127578
|
-
}
|
|
127579
|
-
|
|
127580
|
-
const createTypeProperty = (type) => ObjectProperty(StringLiteral$1('type'), StringLiteral$1(type));
|
|
127581
|
-
|
|
127582
|
-
filesystem.createTypeProperty = createTypeProperty;
|
|
127583
|
-
|
|
127584
|
-
const createFilesProperty = (files) => ObjectProperty(StringLiteral$1('files'), ArrayExpression(files));
|
|
127585
|
-
|
|
127586
|
-
filesystem.createFilesProperty = createFilesProperty;
|
|
127587
|
-
|
|
127588
|
-
const createFilenameProperty = (filename) => ObjectProperty(StringLiteral$1('filename'), StringLiteral$1(filename));
|
|
127589
|
-
|
|
127590
|
-
filesystem.createFilenameProperty = createFilenameProperty;
|
|
127591
|
-
|
|
127592
|
-
const createContentProperty = (content) => ObjectProperty(StringLiteral$1('content'), StringLiteral$1(content));
|
|
127593
|
-
|
|
127594
|
-
filesystem.createContentProperty = createContentProperty;
|
|
127595
|
-
|
|
127596
|
-
filesystem.createFile = (dirPath, name, content) => {
|
|
127597
|
-
maybeRemoveFile(dirPath, name);
|
|
127598
|
-
|
|
127599
|
-
const dirPathFiles = getFiles(dirPath);
|
|
127600
|
-
const parentFilename = getFilename$1(dirPath);
|
|
127601
|
-
const filename = join$1(parentFilename, name);
|
|
127602
|
-
|
|
127603
|
-
const typeProperty = createTypeProperty('file');
|
|
127604
|
-
const filenameProperty = createFilenameProperty(filename);
|
|
127605
|
-
|
|
127606
|
-
const properties = [
|
|
127607
|
-
typeProperty,
|
|
127608
|
-
filenameProperty,
|
|
127609
|
-
content && createContentProperty(content),
|
|
127610
|
-
].filter(Boolean);
|
|
127611
|
-
|
|
127612
|
-
dirPathFiles.node.value.elements.push(ObjectExpression(properties));
|
|
127613
|
-
|
|
127614
|
-
const filePath = dirPathFiles
|
|
127615
|
-
.get('value.elements')
|
|
127616
|
-
.at(-1);
|
|
127617
|
-
|
|
127618
|
-
if (isString$1(content))
|
|
127619
|
-
writeFileContent(filePath, content);
|
|
127620
|
-
|
|
127621
|
-
return filePath;
|
|
127622
|
-
};
|
|
127623
|
-
|
|
127624
|
-
function getFiles(dirPath) {
|
|
127625
|
-
return getProperty(dirPath, 'files');
|
|
127626
|
-
}
|
|
127627
|
-
|
|
127628
|
-
filesystem.createDirectory = (dirPath, name) => {
|
|
127629
|
-
const dirPathFiles = getFiles(dirPath);
|
|
127630
|
-
const parentFilename = getFilename$1(dirPath);
|
|
127631
|
-
const filename = join$1(parentFilename, name);
|
|
127632
|
-
|
|
127633
|
-
const typeProperty = createTypeProperty('directory');
|
|
127634
|
-
const filesProperty = createFilesProperty([]);
|
|
127635
|
-
const filenameProperty = createFilenameProperty(filename);
|
|
127636
|
-
|
|
127637
|
-
dirPathFiles.node.value.elements.push(ObjectExpression([
|
|
127638
|
-
typeProperty,
|
|
127639
|
-
filenameProperty,
|
|
127640
|
-
filesProperty,
|
|
127641
|
-
]));
|
|
127642
|
-
|
|
127643
|
-
maybeFS.createDirectory(filename);
|
|
127644
|
-
|
|
127645
|
-
return dirPathFiles
|
|
127646
|
-
.get('value.elements')
|
|
127647
|
-
.at(-1);
|
|
127648
|
-
};
|
|
127649
|
-
|
|
127650
|
-
filesystem.readFileContent = (filePath) => {
|
|
127651
|
-
const fileType = getFileType(filePath);
|
|
127652
|
-
|
|
127653
|
-
if (fileType === 'directory')
|
|
127654
|
-
return '';
|
|
127655
|
-
|
|
127656
|
-
const [hasContent, content] = getFileContent(filePath);
|
|
127657
|
-
|
|
127658
|
-
if (hasContent)
|
|
127659
|
-
return fromBase64(content);
|
|
127660
|
-
|
|
127661
|
-
const filename = getFilename$1(filePath);
|
|
127662
|
-
const fileContent = maybeFS.readFileContent(filename);
|
|
127663
|
-
|
|
127664
|
-
const property = createContentProperty(toBase64(fileContent));
|
|
127665
|
-
|
|
127666
|
-
filePath.node.properties.push(property);
|
|
127667
|
-
|
|
127668
|
-
return fileContent;
|
|
127669
|
-
};
|
|
127670
|
-
|
|
127671
|
-
filesystem.writeFileContent = writeFileContent;
|
|
127672
|
-
|
|
127673
|
-
function writeFileContent(filePath, content) {
|
|
127674
|
-
const fileType = getFileType(filePath);
|
|
127675
|
-
|
|
127676
|
-
if (fileType === 'directory')
|
|
127677
|
-
return;
|
|
127678
|
-
|
|
127679
|
-
const filename = getFilename$1(filePath);
|
|
127680
|
-
|
|
127681
|
-
maybeFS.writeFileContent(filename, content);
|
|
127682
|
-
|
|
127683
|
-
const contentPath = getProperty(filePath, 'content');
|
|
127684
|
-
|
|
127685
|
-
if (contentPath) {
|
|
127686
|
-
setLiteralValue(contentPath.node.value, toBase64(content));
|
|
127687
|
-
return;
|
|
127688
|
-
}
|
|
127689
|
-
|
|
127690
|
-
const property = createContentProperty(toBase64(content));
|
|
127691
|
-
filePath.node.properties.push(property);
|
|
127692
|
-
}
|
|
127693
|
-
|
|
127694
|
-
filesystem.init = maybeFS.init;
|
|
127695
|
-
filesystem.deinit = maybeFS.deinit;
|
|
127696
|
-
|
|
127697
|
-
filesystem.pause = maybeFS.pause;
|
|
127698
|
-
filesystem.start = maybeFS.start;
|
|
127699
|
-
|
|
127700
127341
|
const {join} = require$$0$2;
|
|
127701
127342
|
|
|
127702
127343
|
const {
|
|
@@ -127705,7 +127346,7 @@ const {
|
|
|
127705
127346
|
readFileContent,
|
|
127706
127347
|
findFile,
|
|
127707
127348
|
renameFile,
|
|
127708
|
-
} = filesystem;
|
|
127349
|
+
} = filesystem$1;
|
|
127709
127350
|
|
|
127710
127351
|
const {parse: parse$1} = JSON;
|
|
127711
127352
|
|
|
@@ -128033,7 +127674,7 @@ var operator = putout$1.exports.operator = {
|
|
|
128033
127674
|
...declare$2,
|
|
128034
127675
|
...regexp,
|
|
128035
127676
|
...addArgs,
|
|
128036
|
-
...filesystem
|
|
127677
|
+
...filesystem,
|
|
128037
127678
|
...matchFiles,
|
|
128038
127679
|
...renameFiles,
|
|
128039
127680
|
...ignore,
|