@putout/bundle 2.1.0 → 2.1.2
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-iife.js +20 -16
- package/bundle/putout.js +311 -317
- package/bundle/putout.min.js +20 -16
- package/package.json +1 -1
package/bundle/putout-iife.js
CHANGED
|
@@ -143663,13 +143663,26 @@ Please specify the "importAttributesKeyword" generator option, whose value can b
|
|
|
143663
143663
|
traverse$6.traverse = traverse$5;
|
|
143664
143664
|
|
|
143665
143665
|
const isPath = (path) => Boolean(path.node);
|
|
143666
|
-
const
|
|
143666
|
+
const createTraverse = (path) => {
|
|
143667
|
+
if (isPath(path)) {
|
|
143668
|
+
return path.traverse.bind(path);
|
|
143669
|
+
}
|
|
143670
|
+
|
|
143671
|
+
const noScope = !isFile(path) && !isProgram(path);
|
|
143672
|
+
|
|
143673
|
+
return (visitors) => {
|
|
143674
|
+
babelTraverse(path, {
|
|
143675
|
+
noScope,
|
|
143676
|
+
...visitors,
|
|
143677
|
+
});
|
|
143678
|
+
};
|
|
143679
|
+
};
|
|
143680
|
+
|
|
143667
143681
|
const getTemplate = ([a]) => a;
|
|
143668
143682
|
|
|
143669
|
-
function traverse$5(
|
|
143670
|
-
|
|
143683
|
+
function traverse$5(basePath, visitor) {
|
|
143684
|
+
const traverse = createTraverse(basePath);
|
|
143671
143685
|
const items = [];
|
|
143672
|
-
const noScope = !isFile(path) && !isProgram(path);
|
|
143673
143686
|
const parsedVisitors = entries$1(visitor);
|
|
143674
143687
|
|
|
143675
143688
|
const withTemplates = parsedVisitors
|
|
@@ -143677,10 +143690,7 @@ Please specify the "importAttributesKeyword" generator option, whose value can b
|
|
|
143677
143690
|
.find(isTemplate);
|
|
143678
143691
|
|
|
143679
143692
|
if (!withTemplates)
|
|
143680
|
-
return
|
|
143681
|
-
noScope,
|
|
143682
|
-
...visitor,
|
|
143683
|
-
});
|
|
143693
|
+
return traverse(visitor);
|
|
143684
143694
|
|
|
143685
143695
|
for (const [tmpl, fn] of parsedVisitors) {
|
|
143686
143696
|
if (!isTemplate(tmpl)) {
|
|
@@ -143691,7 +143701,6 @@ Please specify the "importAttributesKeyword" generator option, whose value can b
|
|
|
143691
143701
|
}
|
|
143692
143702
|
|
|
143693
143703
|
const [node, type] = parseTemplate(tmpl);
|
|
143694
|
-
|
|
143695
143704
|
const visit = getVisit({
|
|
143696
143705
|
fn,
|
|
143697
143706
|
node,
|
|
@@ -143703,10 +143712,7 @@ Please specify the "importAttributesKeyword" generator option, whose value can b
|
|
|
143703
143712
|
});
|
|
143704
143713
|
}
|
|
143705
143714
|
|
|
143706
|
-
|
|
143707
|
-
noScope,
|
|
143708
|
-
...merge(items),
|
|
143709
|
-
});
|
|
143715
|
+
traverse(merge(items));
|
|
143710
143716
|
}
|
|
143711
143717
|
|
|
143712
143718
|
const getVisit = ({fn, node, tmpl}) => (path) => {
|
|
@@ -143720,8 +143726,6 @@ Please specify the "importAttributesKeyword" generator option, whose value can b
|
|
|
143720
143726
|
traverse$6.contains = (path, items) => {
|
|
143721
143727
|
let found = false;
|
|
143722
143728
|
|
|
143723
|
-
const {node = path} = path;
|
|
143724
|
-
|
|
143725
143729
|
const visit = (path) => {
|
|
143726
143730
|
found = true;
|
|
143727
143731
|
path.stop();
|
|
@@ -143733,7 +143737,7 @@ Please specify the "importAttributesKeyword" generator option, whose value can b
|
|
|
143733
143737
|
visitors[item] = visit;
|
|
143734
143738
|
}
|
|
143735
143739
|
|
|
143736
|
-
traverse$5(
|
|
143740
|
+
traverse$5(path, visitors);
|
|
143737
143741
|
|
|
143738
143742
|
return found;
|
|
143739
143743
|
};
|
package/bundle/putout.js
CHANGED
|
@@ -71154,306 +71154,296 @@ function isValidIdentifier(name, reserved = true) {
|
|
|
71154
71154
|
|
|
71155
71155
|
var lib$9 = {};
|
|
71156
71156
|
|
|
71157
|
-
|
|
71158
|
-
|
|
71159
|
-
|
|
71160
|
-
|
|
71161
|
-
|
|
71162
|
-
|
|
71163
|
-
|
|
71164
|
-
|
|
71165
|
-
|
|
71166
|
-
|
|
71167
|
-
|
|
71168
|
-
|
|
71169
|
-
|
|
71170
|
-
|
|
71171
|
-
|
|
71172
|
-
|
|
71173
|
-
|
|
71174
|
-
|
|
71175
|
-
|
|
71176
|
-
|
|
71177
|
-
|
|
71178
|
-
|
|
71179
|
-
|
|
71180
|
-
|
|
71181
|
-
|
|
71182
|
-
|
|
71183
|
-
|
|
71184
|
-
|
|
71185
|
-
|
|
71186
|
-
|
|
71187
|
-
|
|
71188
|
-
|
|
71189
|
-
|
|
71190
|
-
|
|
71191
|
-
|
|
71192
|
-
|
|
71193
|
-
|
|
71194
|
-
|
|
71195
|
-
|
|
71196
|
-
|
|
71197
|
-
|
|
71198
|
-
|
|
71199
|
-
|
|
71200
|
-
|
|
71201
|
-
|
|
71202
|
-
|
|
71203
|
-
|
|
71204
|
-
|
|
71205
|
-
|
|
71206
|
-
|
|
71207
|
-
|
|
71208
|
-
|
|
71209
|
-
|
|
71210
|
-
|
|
71211
|
-
|
|
71212
|
-
|
|
71213
|
-
|
|
71214
|
-
|
|
71215
|
-
|
|
71216
|
-
|
|
71217
|
-
|
|
71218
|
-
|
|
71219
|
-
|
|
71220
|
-
|
|
71221
|
-
|
|
71222
|
-
|
|
71223
|
-
|
|
71224
|
-
|
|
71225
|
-
|
|
71226
|
-
|
|
71227
|
-
|
|
71228
|
-
|
|
71229
|
-
|
|
71230
|
-
|
|
71231
|
-
|
|
71232
|
-
|
|
71233
|
-
|
|
71234
|
-
|
|
71235
|
-
|
|
71236
|
-
|
|
71237
|
-
|
|
71238
|
-
|
|
71239
|
-
|
|
71240
|
-
|
|
71241
|
-
|
|
71242
|
-
|
|
71243
|
-
|
|
71244
|
-
|
|
71245
|
-
|
|
71246
|
-
|
|
71247
|
-
|
|
71248
|
-
|
|
71249
|
-
|
|
71250
|
-
|
|
71251
|
-
|
|
71252
|
-
|
|
71253
|
-
|
|
71254
|
-
|
|
71255
|
-
|
|
71256
|
-
|
|
71257
|
-
|
|
71258
|
-
|
|
71259
|
-
|
|
71260
|
-
|
|
71261
|
-
|
|
71262
|
-
|
|
71263
|
-
|
|
71264
|
-
|
|
71265
|
-
|
|
71266
|
-
|
|
71267
|
-
|
|
71268
|
-
|
|
71269
|
-
|
|
71270
|
-
|
|
71271
|
-
|
|
71272
|
-
|
|
71273
|
-
|
|
71274
|
-
|
|
71275
|
-
|
|
71276
|
-
|
|
71277
|
-
|
|
71278
|
-
|
|
71279
|
-
|
|
71280
|
-
|
|
71281
|
-
|
|
71282
|
-
|
|
71283
|
-
|
|
71284
|
-
|
|
71285
|
-
|
|
71286
|
-
|
|
71287
|
-
|
|
71288
|
-
|
|
71289
|
-
|
|
71290
|
-
|
|
71291
|
-
|
|
71292
|
-
|
|
71293
|
-
|
|
71294
|
-
|
|
71295
|
-
|
|
71296
|
-
|
|
71297
|
-
|
|
71298
|
-
|
|
71299
|
-
|
|
71300
|
-
|
|
71301
|
-
|
|
71302
|
-
|
|
71303
|
-
|
|
71304
|
-
|
|
71305
|
-
|
|
71306
|
-
|
|
71307
|
-
|
|
71308
|
-
|
|
71309
|
-
|
|
71310
|
-
|
|
71311
|
-
|
|
71312
|
-
|
|
71313
|
-
|
|
71314
|
-
|
|
71315
|
-
|
|
71316
|
-
|
|
71317
|
-
|
|
71318
|
-
|
|
71319
|
-
|
|
71320
|
-
|
|
71321
|
-
|
|
71322
|
-
|
|
71323
|
-
|
|
71324
|
-
|
|
71325
|
-
|
|
71326
|
-
|
|
71327
|
-
|
|
71328
|
-
|
|
71329
|
-
|
|
71330
|
-
|
|
71331
|
-
|
|
71332
|
-
|
|
71333
|
-
|
|
71334
|
-
|
|
71335
|
-
|
|
71336
|
-
|
|
71337
|
-
|
|
71338
|
-
|
|
71339
|
-
|
|
71340
|
-
|
|
71341
|
-
|
|
71342
|
-
|
|
71343
|
-
|
|
71344
|
-
|
|
71345
|
-
|
|
71346
|
-
|
|
71347
|
-
|
|
71348
|
-
|
|
71349
|
-
|
|
71350
|
-
|
|
71351
|
-
|
|
71352
|
-
|
|
71353
|
-
|
|
71354
|
-
|
|
71355
|
-
|
|
71356
|
-
|
|
71357
|
-
|
|
71358
|
-
|
|
71359
|
-
|
|
71360
|
-
|
|
71361
|
-
|
|
71362
|
-
|
|
71363
|
-
|
|
71364
|
-
|
|
71365
|
-
|
|
71366
|
-
|
|
71367
|
-
|
|
71368
|
-
|
|
71369
|
-
|
|
71370
|
-
|
|
71371
|
-
|
|
71372
|
-
|
|
71373
|
-
|
|
71374
|
-
|
|
71375
|
-
|
|
71376
|
-
|
|
71377
|
-
|
|
71378
|
-
|
|
71379
|
-
|
|
71380
|
-
|
|
71381
|
-
|
|
71382
|
-
|
|
71383
|
-
|
|
71384
|
-
|
|
71385
|
-
|
|
71386
|
-
|
|
71387
|
-
|
|
71388
|
-
|
|
71389
|
-
|
|
71390
|
-
|
|
71391
|
-
|
|
71392
|
-
|
|
71393
|
-
|
|
71394
|
-
|
|
71395
|
-
|
|
71396
|
-
|
|
71397
|
-
|
|
71398
|
-
|
|
71399
|
-
|
|
71400
|
-
|
|
71401
|
-
|
|
71402
|
-
|
|
71403
|
-
|
|
71404
|
-
|
|
71405
|
-
|
|
71406
|
-
|
|
71407
|
-
|
|
71408
|
-
|
|
71409
|
-
|
|
71410
|
-
|
|
71411
|
-
|
|
71412
|
-
|
|
71413
|
-
|
|
71414
|
-
|
|
71415
|
-
|
|
71416
|
-
|
|
71417
|
-
|
|
71418
|
-
|
|
71419
|
-
|
|
71420
|
-
|
|
71421
|
-
|
|
71422
|
-
|
|
71423
|
-
|
|
71424
|
-
|
|
71425
|
-
|
|
71426
|
-
|
|
71427
|
-
|
|
71428
|
-
|
|
71429
|
-
|
|
71430
|
-
|
|
71431
|
-
|
|
71432
|
-
|
|
71433
|
-
|
|
71434
|
-
|
|
71435
|
-
|
|
71436
|
-
|
|
71437
|
-
|
|
71438
|
-
|
|
71439
|
-
|
|
71440
|
-
|
|
71441
|
-
|
|
71442
|
-
|
|
71443
|
-
|
|
71444
|
-
|
|
71445
|
-
|
|
71446
|
-
|
|
71447
|
-
} = readHexChar(input, pos, lineStart, curLine, 4, false, throwOnInvalid, errors));
|
|
71448
|
-
}
|
|
71449
|
-
return {
|
|
71450
|
-
code,
|
|
71451
|
-
pos
|
|
71452
|
-
};
|
|
71453
|
-
}
|
|
71454
|
-
|
|
71455
|
-
|
|
71456
|
-
return lib$9;
|
|
71157
|
+
Object.defineProperty(lib$9, "__esModule", {
|
|
71158
|
+
value: true
|
|
71159
|
+
});
|
|
71160
|
+
lib$9.readCodePoint = readCodePoint$1;
|
|
71161
|
+
lib$9.readInt = readInt$1;
|
|
71162
|
+
lib$9.readStringContents = readStringContents$1;
|
|
71163
|
+
var _isDigit$1 = function isDigit(code) {
|
|
71164
|
+
return code >= 48 && code <= 57;
|
|
71165
|
+
};
|
|
71166
|
+
const forbiddenNumericSeparatorSiblings$1 = {
|
|
71167
|
+
decBinOct: new Set([46, 66, 69, 79, 95, 98, 101, 111]),
|
|
71168
|
+
hex: new Set([46, 88, 95, 120])
|
|
71169
|
+
};
|
|
71170
|
+
const isAllowedNumericSeparatorSibling$1 = {
|
|
71171
|
+
bin: ch => ch === 48 || ch === 49,
|
|
71172
|
+
oct: ch => ch >= 48 && ch <= 55,
|
|
71173
|
+
dec: ch => ch >= 48 && ch <= 57,
|
|
71174
|
+
hex: ch => ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102
|
|
71175
|
+
};
|
|
71176
|
+
function readStringContents$1(type, input, pos, lineStart, curLine, errors) {
|
|
71177
|
+
const initialPos = pos;
|
|
71178
|
+
const initialLineStart = lineStart;
|
|
71179
|
+
const initialCurLine = curLine;
|
|
71180
|
+
let out = "";
|
|
71181
|
+
let firstInvalidLoc = null;
|
|
71182
|
+
let chunkStart = pos;
|
|
71183
|
+
const {
|
|
71184
|
+
length
|
|
71185
|
+
} = input;
|
|
71186
|
+
for (;;) {
|
|
71187
|
+
if (pos >= length) {
|
|
71188
|
+
errors.unterminated(initialPos, initialLineStart, initialCurLine);
|
|
71189
|
+
out += input.slice(chunkStart, pos);
|
|
71190
|
+
break;
|
|
71191
|
+
}
|
|
71192
|
+
const ch = input.charCodeAt(pos);
|
|
71193
|
+
if (isStringEnd$1(type, ch, input, pos)) {
|
|
71194
|
+
out += input.slice(chunkStart, pos);
|
|
71195
|
+
break;
|
|
71196
|
+
}
|
|
71197
|
+
if (ch === 92) {
|
|
71198
|
+
out += input.slice(chunkStart, pos);
|
|
71199
|
+
const res = readEscapedChar$1(input, pos, lineStart, curLine, type === "template", errors);
|
|
71200
|
+
if (res.ch === null && !firstInvalidLoc) {
|
|
71201
|
+
firstInvalidLoc = {
|
|
71202
|
+
pos,
|
|
71203
|
+
lineStart,
|
|
71204
|
+
curLine
|
|
71205
|
+
};
|
|
71206
|
+
} else {
|
|
71207
|
+
out += res.ch;
|
|
71208
|
+
}
|
|
71209
|
+
({
|
|
71210
|
+
pos,
|
|
71211
|
+
lineStart,
|
|
71212
|
+
curLine
|
|
71213
|
+
} = res);
|
|
71214
|
+
chunkStart = pos;
|
|
71215
|
+
} else if (ch === 8232 || ch === 8233) {
|
|
71216
|
+
++pos;
|
|
71217
|
+
++curLine;
|
|
71218
|
+
lineStart = pos;
|
|
71219
|
+
} else if (ch === 10 || ch === 13) {
|
|
71220
|
+
if (type === "template") {
|
|
71221
|
+
out += input.slice(chunkStart, pos) + "\n";
|
|
71222
|
+
++pos;
|
|
71223
|
+
if (ch === 13 && input.charCodeAt(pos) === 10) {
|
|
71224
|
+
++pos;
|
|
71225
|
+
}
|
|
71226
|
+
++curLine;
|
|
71227
|
+
chunkStart = lineStart = pos;
|
|
71228
|
+
} else {
|
|
71229
|
+
errors.unterminated(initialPos, initialLineStart, initialCurLine);
|
|
71230
|
+
}
|
|
71231
|
+
} else {
|
|
71232
|
+
++pos;
|
|
71233
|
+
}
|
|
71234
|
+
}
|
|
71235
|
+
return {
|
|
71236
|
+
pos,
|
|
71237
|
+
str: out,
|
|
71238
|
+
firstInvalidLoc,
|
|
71239
|
+
lineStart,
|
|
71240
|
+
curLine,
|
|
71241
|
+
containsInvalid: !!firstInvalidLoc
|
|
71242
|
+
};
|
|
71243
|
+
}
|
|
71244
|
+
function isStringEnd$1(type, ch, input, pos) {
|
|
71245
|
+
if (type === "template") {
|
|
71246
|
+
return ch === 96 || ch === 36 && input.charCodeAt(pos + 1) === 123;
|
|
71247
|
+
}
|
|
71248
|
+
return ch === (type === "double" ? 34 : 39);
|
|
71249
|
+
}
|
|
71250
|
+
function readEscapedChar$1(input, pos, lineStart, curLine, inTemplate, errors) {
|
|
71251
|
+
const throwOnInvalid = !inTemplate;
|
|
71252
|
+
pos++;
|
|
71253
|
+
const res = ch => ({
|
|
71254
|
+
pos,
|
|
71255
|
+
ch,
|
|
71256
|
+
lineStart,
|
|
71257
|
+
curLine
|
|
71258
|
+
});
|
|
71259
|
+
const ch = input.charCodeAt(pos++);
|
|
71260
|
+
switch (ch) {
|
|
71261
|
+
case 110:
|
|
71262
|
+
return res("\n");
|
|
71263
|
+
case 114:
|
|
71264
|
+
return res("\r");
|
|
71265
|
+
case 120:
|
|
71266
|
+
{
|
|
71267
|
+
let code;
|
|
71268
|
+
({
|
|
71269
|
+
code,
|
|
71270
|
+
pos
|
|
71271
|
+
} = readHexChar$1(input, pos, lineStart, curLine, 2, false, throwOnInvalid, errors));
|
|
71272
|
+
return res(code === null ? null : String.fromCharCode(code));
|
|
71273
|
+
}
|
|
71274
|
+
case 117:
|
|
71275
|
+
{
|
|
71276
|
+
let code;
|
|
71277
|
+
({
|
|
71278
|
+
code,
|
|
71279
|
+
pos
|
|
71280
|
+
} = readCodePoint$1(input, pos, lineStart, curLine, throwOnInvalid, errors));
|
|
71281
|
+
return res(code === null ? null : String.fromCodePoint(code));
|
|
71282
|
+
}
|
|
71283
|
+
case 116:
|
|
71284
|
+
return res("\t");
|
|
71285
|
+
case 98:
|
|
71286
|
+
return res("\b");
|
|
71287
|
+
case 118:
|
|
71288
|
+
return res("\u000b");
|
|
71289
|
+
case 102:
|
|
71290
|
+
return res("\f");
|
|
71291
|
+
case 13:
|
|
71292
|
+
if (input.charCodeAt(pos) === 10) {
|
|
71293
|
+
++pos;
|
|
71294
|
+
}
|
|
71295
|
+
case 10:
|
|
71296
|
+
lineStart = pos;
|
|
71297
|
+
++curLine;
|
|
71298
|
+
case 8232:
|
|
71299
|
+
case 8233:
|
|
71300
|
+
return res("");
|
|
71301
|
+
case 56:
|
|
71302
|
+
case 57:
|
|
71303
|
+
if (inTemplate) {
|
|
71304
|
+
return res(null);
|
|
71305
|
+
} else {
|
|
71306
|
+
errors.strictNumericEscape(pos - 1, lineStart, curLine);
|
|
71307
|
+
}
|
|
71308
|
+
default:
|
|
71309
|
+
if (ch >= 48 && ch <= 55) {
|
|
71310
|
+
const startPos = pos - 1;
|
|
71311
|
+
const match = input.slice(startPos, pos + 2).match(/^[0-7]+/);
|
|
71312
|
+
let octalStr = match[0];
|
|
71313
|
+
let octal = parseInt(octalStr, 8);
|
|
71314
|
+
if (octal > 255) {
|
|
71315
|
+
octalStr = octalStr.slice(0, -1);
|
|
71316
|
+
octal = parseInt(octalStr, 8);
|
|
71317
|
+
}
|
|
71318
|
+
pos += octalStr.length - 1;
|
|
71319
|
+
const next = input.charCodeAt(pos);
|
|
71320
|
+
if (octalStr !== "0" || next === 56 || next === 57) {
|
|
71321
|
+
if (inTemplate) {
|
|
71322
|
+
return res(null);
|
|
71323
|
+
} else {
|
|
71324
|
+
errors.strictNumericEscape(startPos, lineStart, curLine);
|
|
71325
|
+
}
|
|
71326
|
+
}
|
|
71327
|
+
return res(String.fromCharCode(octal));
|
|
71328
|
+
}
|
|
71329
|
+
return res(String.fromCharCode(ch));
|
|
71330
|
+
}
|
|
71331
|
+
}
|
|
71332
|
+
function readHexChar$1(input, pos, lineStart, curLine, len, forceLen, throwOnInvalid, errors) {
|
|
71333
|
+
const initialPos = pos;
|
|
71334
|
+
let n;
|
|
71335
|
+
({
|
|
71336
|
+
n,
|
|
71337
|
+
pos
|
|
71338
|
+
} = readInt$1(input, pos, lineStart, curLine, 16, len, forceLen, false, errors, !throwOnInvalid));
|
|
71339
|
+
if (n === null) {
|
|
71340
|
+
if (throwOnInvalid) {
|
|
71341
|
+
errors.invalidEscapeSequence(initialPos, lineStart, curLine);
|
|
71342
|
+
} else {
|
|
71343
|
+
pos = initialPos - 1;
|
|
71344
|
+
}
|
|
71345
|
+
}
|
|
71346
|
+
return {
|
|
71347
|
+
code: n,
|
|
71348
|
+
pos
|
|
71349
|
+
};
|
|
71350
|
+
}
|
|
71351
|
+
function readInt$1(input, pos, lineStart, curLine, radix, len, forceLen, allowNumSeparator, errors, bailOnError) {
|
|
71352
|
+
const start = pos;
|
|
71353
|
+
const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings$1.hex : forbiddenNumericSeparatorSiblings$1.decBinOct;
|
|
71354
|
+
const isAllowedSibling = radix === 16 ? isAllowedNumericSeparatorSibling$1.hex : radix === 10 ? isAllowedNumericSeparatorSibling$1.dec : radix === 8 ? isAllowedNumericSeparatorSibling$1.oct : isAllowedNumericSeparatorSibling$1.bin;
|
|
71355
|
+
let invalid = false;
|
|
71356
|
+
let total = 0;
|
|
71357
|
+
for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) {
|
|
71358
|
+
const code = input.charCodeAt(pos);
|
|
71359
|
+
let val;
|
|
71360
|
+
if (code === 95 && allowNumSeparator !== "bail") {
|
|
71361
|
+
const prev = input.charCodeAt(pos - 1);
|
|
71362
|
+
const next = input.charCodeAt(pos + 1);
|
|
71363
|
+
if (!allowNumSeparator) {
|
|
71364
|
+
if (bailOnError) return {
|
|
71365
|
+
n: null,
|
|
71366
|
+
pos
|
|
71367
|
+
};
|
|
71368
|
+
errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine);
|
|
71369
|
+
} else if (Number.isNaN(next) || !isAllowedSibling(next) || forbiddenSiblings.has(prev) || forbiddenSiblings.has(next)) {
|
|
71370
|
+
if (bailOnError) return {
|
|
71371
|
+
n: null,
|
|
71372
|
+
pos
|
|
71373
|
+
};
|
|
71374
|
+
errors.unexpectedNumericSeparator(pos, lineStart, curLine);
|
|
71375
|
+
}
|
|
71376
|
+
++pos;
|
|
71377
|
+
continue;
|
|
71378
|
+
}
|
|
71379
|
+
if (code >= 97) {
|
|
71380
|
+
val = code - 97 + 10;
|
|
71381
|
+
} else if (code >= 65) {
|
|
71382
|
+
val = code - 65 + 10;
|
|
71383
|
+
} else if (_isDigit$1(code)) {
|
|
71384
|
+
val = code - 48;
|
|
71385
|
+
} else {
|
|
71386
|
+
val = Infinity;
|
|
71387
|
+
}
|
|
71388
|
+
if (val >= radix) {
|
|
71389
|
+
if (val <= 9 && bailOnError) {
|
|
71390
|
+
return {
|
|
71391
|
+
n: null,
|
|
71392
|
+
pos
|
|
71393
|
+
};
|
|
71394
|
+
} else if (val <= 9 && errors.invalidDigit(pos, lineStart, curLine, radix)) {
|
|
71395
|
+
val = 0;
|
|
71396
|
+
} else if (forceLen) {
|
|
71397
|
+
val = 0;
|
|
71398
|
+
invalid = true;
|
|
71399
|
+
} else {
|
|
71400
|
+
break;
|
|
71401
|
+
}
|
|
71402
|
+
}
|
|
71403
|
+
++pos;
|
|
71404
|
+
total = total * radix + val;
|
|
71405
|
+
}
|
|
71406
|
+
if (pos === start || len != null && pos - start !== len || invalid) {
|
|
71407
|
+
return {
|
|
71408
|
+
n: null,
|
|
71409
|
+
pos
|
|
71410
|
+
};
|
|
71411
|
+
}
|
|
71412
|
+
return {
|
|
71413
|
+
n: total,
|
|
71414
|
+
pos
|
|
71415
|
+
};
|
|
71416
|
+
}
|
|
71417
|
+
function readCodePoint$1(input, pos, lineStart, curLine, throwOnInvalid, errors) {
|
|
71418
|
+
const ch = input.charCodeAt(pos);
|
|
71419
|
+
let code;
|
|
71420
|
+
if (ch === 123) {
|
|
71421
|
+
++pos;
|
|
71422
|
+
({
|
|
71423
|
+
code,
|
|
71424
|
+
pos
|
|
71425
|
+
} = readHexChar$1(input, pos, lineStart, curLine, input.indexOf("}", pos) - pos, true, throwOnInvalid, errors));
|
|
71426
|
+
++pos;
|
|
71427
|
+
if (code !== null && code > 0x10ffff) {
|
|
71428
|
+
if (throwOnInvalid) {
|
|
71429
|
+
errors.invalidCodePoint(pos, lineStart, curLine);
|
|
71430
|
+
} else {
|
|
71431
|
+
return {
|
|
71432
|
+
code: null,
|
|
71433
|
+
pos
|
|
71434
|
+
};
|
|
71435
|
+
}
|
|
71436
|
+
}
|
|
71437
|
+
} else {
|
|
71438
|
+
({
|
|
71439
|
+
code,
|
|
71440
|
+
pos
|
|
71441
|
+
} = readHexChar$1(input, pos, lineStart, curLine, 4, false, throwOnInvalid, errors));
|
|
71442
|
+
}
|
|
71443
|
+
return {
|
|
71444
|
+
code,
|
|
71445
|
+
pos
|
|
71446
|
+
};
|
|
71457
71447
|
}
|
|
71458
71448
|
|
|
71459
71449
|
var constants = {};
|
|
@@ -71808,7 +71798,7 @@ function requireCore () {
|
|
|
71808
71798
|
var _is = requireIs();
|
|
71809
71799
|
var _isValidIdentifier = isValidIdentifier$1;
|
|
71810
71800
|
var _helperValidatorIdentifier = lib$a;
|
|
71811
|
-
var _helperStringParser =
|
|
71801
|
+
var _helperStringParser = lib$9;
|
|
71812
71802
|
var _constants = constants;
|
|
71813
71803
|
var _utils = requireUtils();
|
|
71814
71804
|
const defineType = (0, _utils.defineAliasedType)("Standardized");
|
|
@@ -143657,13 +143647,26 @@ const {entries: entries$1} = Object;
|
|
|
143657
143647
|
traverse$6.traverse = traverse$5;
|
|
143658
143648
|
|
|
143659
143649
|
const isPath = (path) => Boolean(path.node);
|
|
143660
|
-
const
|
|
143650
|
+
const createTraverse = (path) => {
|
|
143651
|
+
if (isPath(path)) {
|
|
143652
|
+
return path.traverse.bind(path);
|
|
143653
|
+
}
|
|
143654
|
+
|
|
143655
|
+
const noScope = !isFile(path) && !isProgram(path);
|
|
143656
|
+
|
|
143657
|
+
return (visitors) => {
|
|
143658
|
+
babelTraverse(path, {
|
|
143659
|
+
noScope,
|
|
143660
|
+
...visitors,
|
|
143661
|
+
});
|
|
143662
|
+
};
|
|
143663
|
+
};
|
|
143664
|
+
|
|
143661
143665
|
const getTemplate = ([a]) => a;
|
|
143662
143666
|
|
|
143663
|
-
function traverse$5(
|
|
143664
|
-
|
|
143667
|
+
function traverse$5(basePath, visitor) {
|
|
143668
|
+
const traverse = createTraverse(basePath);
|
|
143665
143669
|
const items = [];
|
|
143666
|
-
const noScope = !isFile(path) && !isProgram(path);
|
|
143667
143670
|
const parsedVisitors = entries$1(visitor);
|
|
143668
143671
|
|
|
143669
143672
|
const withTemplates = parsedVisitors
|
|
@@ -143671,10 +143674,7 @@ function traverse$5(path, visitor) {
|
|
|
143671
143674
|
.find(isTemplate);
|
|
143672
143675
|
|
|
143673
143676
|
if (!withTemplates)
|
|
143674
|
-
return
|
|
143675
|
-
noScope,
|
|
143676
|
-
...visitor,
|
|
143677
|
-
});
|
|
143677
|
+
return traverse(visitor);
|
|
143678
143678
|
|
|
143679
143679
|
for (const [tmpl, fn] of parsedVisitors) {
|
|
143680
143680
|
if (!isTemplate(tmpl)) {
|
|
@@ -143685,7 +143685,6 @@ function traverse$5(path, visitor) {
|
|
|
143685
143685
|
}
|
|
143686
143686
|
|
|
143687
143687
|
const [node, type] = parseTemplate(tmpl);
|
|
143688
|
-
|
|
143689
143688
|
const visit = getVisit({
|
|
143690
143689
|
fn,
|
|
143691
143690
|
node,
|
|
@@ -143697,10 +143696,7 @@ function traverse$5(path, visitor) {
|
|
|
143697
143696
|
});
|
|
143698
143697
|
}
|
|
143699
143698
|
|
|
143700
|
-
|
|
143701
|
-
noScope,
|
|
143702
|
-
...merge(items),
|
|
143703
|
-
});
|
|
143699
|
+
traverse(merge(items));
|
|
143704
143700
|
}
|
|
143705
143701
|
|
|
143706
143702
|
const getVisit = ({fn, node, tmpl}) => (path) => {
|
|
@@ -143714,8 +143710,6 @@ const getVisit = ({fn, node, tmpl}) => (path) => {
|
|
|
143714
143710
|
traverse$6.contains = (path, items) => {
|
|
143715
143711
|
let found = false;
|
|
143716
143712
|
|
|
143717
|
-
const {node = path} = path;
|
|
143718
|
-
|
|
143719
143713
|
const visit = (path) => {
|
|
143720
143714
|
found = true;
|
|
143721
143715
|
path.stop();
|
|
@@ -143727,7 +143721,7 @@ traverse$6.contains = (path, items) => {
|
|
|
143727
143721
|
visitors[item] = visit;
|
|
143728
143722
|
}
|
|
143729
143723
|
|
|
143730
|
-
traverse$5(
|
|
143724
|
+
traverse$5(path, visitors);
|
|
143731
143725
|
|
|
143732
143726
|
return found;
|
|
143733
143727
|
};
|
package/bundle/putout.min.js
CHANGED
|
@@ -143657,13 +143657,26 @@ const {entries: entries$1} = Object;
|
|
|
143657
143657
|
traverse$6.traverse = traverse$5;
|
|
143658
143658
|
|
|
143659
143659
|
const isPath = (path) => Boolean(path.node);
|
|
143660
|
-
const
|
|
143660
|
+
const createTraverse = (path) => {
|
|
143661
|
+
if (isPath(path)) {
|
|
143662
|
+
return path.traverse.bind(path);
|
|
143663
|
+
}
|
|
143664
|
+
|
|
143665
|
+
const noScope = !isFile(path) && !isProgram(path);
|
|
143666
|
+
|
|
143667
|
+
return (visitors) => {
|
|
143668
|
+
babelTraverse(path, {
|
|
143669
|
+
noScope,
|
|
143670
|
+
...visitors,
|
|
143671
|
+
});
|
|
143672
|
+
};
|
|
143673
|
+
};
|
|
143674
|
+
|
|
143661
143675
|
const getTemplate = ([a]) => a;
|
|
143662
143676
|
|
|
143663
|
-
function traverse$5(
|
|
143664
|
-
|
|
143677
|
+
function traverse$5(basePath, visitor) {
|
|
143678
|
+
const traverse = createTraverse(basePath);
|
|
143665
143679
|
const items = [];
|
|
143666
|
-
const noScope = !isFile(path) && !isProgram(path);
|
|
143667
143680
|
const parsedVisitors = entries$1(visitor);
|
|
143668
143681
|
|
|
143669
143682
|
const withTemplates = parsedVisitors
|
|
@@ -143671,10 +143684,7 @@ function traverse$5(path, visitor) {
|
|
|
143671
143684
|
.find(isTemplate);
|
|
143672
143685
|
|
|
143673
143686
|
if (!withTemplates)
|
|
143674
|
-
return
|
|
143675
|
-
noScope,
|
|
143676
|
-
...visitor,
|
|
143677
|
-
});
|
|
143687
|
+
return traverse(visitor);
|
|
143678
143688
|
|
|
143679
143689
|
for (const [tmpl, fn] of parsedVisitors) {
|
|
143680
143690
|
if (!isTemplate(tmpl)) {
|
|
@@ -143685,7 +143695,6 @@ function traverse$5(path, visitor) {
|
|
|
143685
143695
|
}
|
|
143686
143696
|
|
|
143687
143697
|
const [node, type] = parseTemplate(tmpl);
|
|
143688
|
-
|
|
143689
143698
|
const visit = getVisit({
|
|
143690
143699
|
fn,
|
|
143691
143700
|
node,
|
|
@@ -143697,10 +143706,7 @@ function traverse$5(path, visitor) {
|
|
|
143697
143706
|
});
|
|
143698
143707
|
}
|
|
143699
143708
|
|
|
143700
|
-
|
|
143701
|
-
noScope,
|
|
143702
|
-
...merge(items),
|
|
143703
|
-
});
|
|
143709
|
+
traverse(merge(items));
|
|
143704
143710
|
}
|
|
143705
143711
|
|
|
143706
143712
|
const getVisit = ({fn, node, tmpl}) => (path) => {
|
|
@@ -143714,8 +143720,6 @@ const getVisit = ({fn, node, tmpl}) => (path) => {
|
|
|
143714
143720
|
traverse$6.contains = (path, items) => {
|
|
143715
143721
|
let found = false;
|
|
143716
143722
|
|
|
143717
|
-
const {node = path} = path;
|
|
143718
|
-
|
|
143719
143723
|
const visit = (path) => {
|
|
143720
143724
|
found = true;
|
|
143721
143725
|
path.stop();
|
|
@@ -143727,7 +143731,7 @@ traverse$6.contains = (path, items) => {
|
|
|
143727
143731
|
visitors[item] = visit;
|
|
143728
143732
|
}
|
|
143729
143733
|
|
|
143730
|
-
traverse$5(
|
|
143734
|
+
traverse$5(path, visitors);
|
|
143731
143735
|
|
|
143732
143736
|
return found;
|
|
143733
143737
|
};
|
package/package.json
CHANGED