@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.
@@ -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 parsePath = (path) => isPath(path) ? path.node : path;
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(path, visitor) {
143670
- path = parsePath(path);
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 babelTraverse(path, {
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
- babelTraverse(path, {
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(node, visitors);
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
- var hasRequiredLib$3;
71158
-
71159
- function requireLib$3 () {
71160
- if (hasRequiredLib$3) return lib$9;
71161
- hasRequiredLib$3 = 1;
71162
-
71163
- Object.defineProperty(lib$9, "__esModule", {
71164
- value: true
71165
- });
71166
- lib$9.readCodePoint = readCodePoint;
71167
- lib$9.readInt = readInt;
71168
- lib$9.readStringContents = readStringContents;
71169
- var _isDigit = function isDigit(code) {
71170
- return code >= 48 && code <= 57;
71171
- };
71172
- const forbiddenNumericSeparatorSiblings = {
71173
- decBinOct: new Set([46, 66, 69, 79, 95, 98, 101, 111]),
71174
- hex: new Set([46, 88, 95, 120])
71175
- };
71176
- const isAllowedNumericSeparatorSibling = {
71177
- bin: ch => ch === 48 || ch === 49,
71178
- oct: ch => ch >= 48 && ch <= 55,
71179
- dec: ch => ch >= 48 && ch <= 57,
71180
- hex: ch => ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102
71181
- };
71182
- function readStringContents(type, input, pos, lineStart, curLine, errors) {
71183
- const initialPos = pos;
71184
- const initialLineStart = lineStart;
71185
- const initialCurLine = curLine;
71186
- let out = "";
71187
- let firstInvalidLoc = null;
71188
- let chunkStart = pos;
71189
- const {
71190
- length
71191
- } = input;
71192
- for (;;) {
71193
- if (pos >= length) {
71194
- errors.unterminated(initialPos, initialLineStart, initialCurLine);
71195
- out += input.slice(chunkStart, pos);
71196
- break;
71197
- }
71198
- const ch = input.charCodeAt(pos);
71199
- if (isStringEnd(type, ch, input, pos)) {
71200
- out += input.slice(chunkStart, pos);
71201
- break;
71202
- }
71203
- if (ch === 92) {
71204
- out += input.slice(chunkStart, pos);
71205
- const res = readEscapedChar(input, pos, lineStart, curLine, type === "template", errors);
71206
- if (res.ch === null && !firstInvalidLoc) {
71207
- firstInvalidLoc = {
71208
- pos,
71209
- lineStart,
71210
- curLine
71211
- };
71212
- } else {
71213
- out += res.ch;
71214
- }
71215
- ({
71216
- pos,
71217
- lineStart,
71218
- curLine
71219
- } = res);
71220
- chunkStart = pos;
71221
- } else if (ch === 8232 || ch === 8233) {
71222
- ++pos;
71223
- ++curLine;
71224
- lineStart = pos;
71225
- } else if (ch === 10 || ch === 13) {
71226
- if (type === "template") {
71227
- out += input.slice(chunkStart, pos) + "\n";
71228
- ++pos;
71229
- if (ch === 13 && input.charCodeAt(pos) === 10) {
71230
- ++pos;
71231
- }
71232
- ++curLine;
71233
- chunkStart = lineStart = pos;
71234
- } else {
71235
- errors.unterminated(initialPos, initialLineStart, initialCurLine);
71236
- }
71237
- } else {
71238
- ++pos;
71239
- }
71240
- }
71241
- return {
71242
- pos,
71243
- str: out,
71244
- firstInvalidLoc,
71245
- lineStart,
71246
- curLine,
71247
- containsInvalid: !!firstInvalidLoc
71248
- };
71249
- }
71250
- function isStringEnd(type, ch, input, pos) {
71251
- if (type === "template") {
71252
- return ch === 96 || ch === 36 && input.charCodeAt(pos + 1) === 123;
71253
- }
71254
- return ch === (type === "double" ? 34 : 39);
71255
- }
71256
- function readEscapedChar(input, pos, lineStart, curLine, inTemplate, errors) {
71257
- const throwOnInvalid = !inTemplate;
71258
- pos++;
71259
- const res = ch => ({
71260
- pos,
71261
- ch,
71262
- lineStart,
71263
- curLine
71264
- });
71265
- const ch = input.charCodeAt(pos++);
71266
- switch (ch) {
71267
- case 110:
71268
- return res("\n");
71269
- case 114:
71270
- return res("\r");
71271
- case 120:
71272
- {
71273
- let code;
71274
- ({
71275
- code,
71276
- pos
71277
- } = readHexChar(input, pos, lineStart, curLine, 2, false, throwOnInvalid, errors));
71278
- return res(code === null ? null : String.fromCharCode(code));
71279
- }
71280
- case 117:
71281
- {
71282
- let code;
71283
- ({
71284
- code,
71285
- pos
71286
- } = readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors));
71287
- return res(code === null ? null : String.fromCodePoint(code));
71288
- }
71289
- case 116:
71290
- return res("\t");
71291
- case 98:
71292
- return res("\b");
71293
- case 118:
71294
- return res("\u000b");
71295
- case 102:
71296
- return res("\f");
71297
- case 13:
71298
- if (input.charCodeAt(pos) === 10) {
71299
- ++pos;
71300
- }
71301
- case 10:
71302
- lineStart = pos;
71303
- ++curLine;
71304
- case 8232:
71305
- case 8233:
71306
- return res("");
71307
- case 56:
71308
- case 57:
71309
- if (inTemplate) {
71310
- return res(null);
71311
- } else {
71312
- errors.strictNumericEscape(pos - 1, lineStart, curLine);
71313
- }
71314
- default:
71315
- if (ch >= 48 && ch <= 55) {
71316
- const startPos = pos - 1;
71317
- const match = input.slice(startPos, pos + 2).match(/^[0-7]+/);
71318
- let octalStr = match[0];
71319
- let octal = parseInt(octalStr, 8);
71320
- if (octal > 255) {
71321
- octalStr = octalStr.slice(0, -1);
71322
- octal = parseInt(octalStr, 8);
71323
- }
71324
- pos += octalStr.length - 1;
71325
- const next = input.charCodeAt(pos);
71326
- if (octalStr !== "0" || next === 56 || next === 57) {
71327
- if (inTemplate) {
71328
- return res(null);
71329
- } else {
71330
- errors.strictNumericEscape(startPos, lineStart, curLine);
71331
- }
71332
- }
71333
- return res(String.fromCharCode(octal));
71334
- }
71335
- return res(String.fromCharCode(ch));
71336
- }
71337
- }
71338
- function readHexChar(input, pos, lineStart, curLine, len, forceLen, throwOnInvalid, errors) {
71339
- const initialPos = pos;
71340
- let n;
71341
- ({
71342
- n,
71343
- pos
71344
- } = readInt(input, pos, lineStart, curLine, 16, len, forceLen, false, errors, !throwOnInvalid));
71345
- if (n === null) {
71346
- if (throwOnInvalid) {
71347
- errors.invalidEscapeSequence(initialPos, lineStart, curLine);
71348
- } else {
71349
- pos = initialPos - 1;
71350
- }
71351
- }
71352
- return {
71353
- code: n,
71354
- pos
71355
- };
71356
- }
71357
- function readInt(input, pos, lineStart, curLine, radix, len, forceLen, allowNumSeparator, errors, bailOnError) {
71358
- const start = pos;
71359
- const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct;
71360
- const isAllowedSibling = radix === 16 ? isAllowedNumericSeparatorSibling.hex : radix === 10 ? isAllowedNumericSeparatorSibling.dec : radix === 8 ? isAllowedNumericSeparatorSibling.oct : isAllowedNumericSeparatorSibling.bin;
71361
- let invalid = false;
71362
- let total = 0;
71363
- for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) {
71364
- const code = input.charCodeAt(pos);
71365
- let val;
71366
- if (code === 95 && allowNumSeparator !== "bail") {
71367
- const prev = input.charCodeAt(pos - 1);
71368
- const next = input.charCodeAt(pos + 1);
71369
- if (!allowNumSeparator) {
71370
- if (bailOnError) return {
71371
- n: null,
71372
- pos
71373
- };
71374
- errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine);
71375
- } else if (Number.isNaN(next) || !isAllowedSibling(next) || forbiddenSiblings.has(prev) || forbiddenSiblings.has(next)) {
71376
- if (bailOnError) return {
71377
- n: null,
71378
- pos
71379
- };
71380
- errors.unexpectedNumericSeparator(pos, lineStart, curLine);
71381
- }
71382
- ++pos;
71383
- continue;
71384
- }
71385
- if (code >= 97) {
71386
- val = code - 97 + 10;
71387
- } else if (code >= 65) {
71388
- val = code - 65 + 10;
71389
- } else if (_isDigit(code)) {
71390
- val = code - 48;
71391
- } else {
71392
- val = Infinity;
71393
- }
71394
- if (val >= radix) {
71395
- if (val <= 9 && bailOnError) {
71396
- return {
71397
- n: null,
71398
- pos
71399
- };
71400
- } else if (val <= 9 && errors.invalidDigit(pos, lineStart, curLine, radix)) {
71401
- val = 0;
71402
- } else if (forceLen) {
71403
- val = 0;
71404
- invalid = true;
71405
- } else {
71406
- break;
71407
- }
71408
- }
71409
- ++pos;
71410
- total = total * radix + val;
71411
- }
71412
- if (pos === start || len != null && pos - start !== len || invalid) {
71413
- return {
71414
- n: null,
71415
- pos
71416
- };
71417
- }
71418
- return {
71419
- n: total,
71420
- pos
71421
- };
71422
- }
71423
- function readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors) {
71424
- const ch = input.charCodeAt(pos);
71425
- let code;
71426
- if (ch === 123) {
71427
- ++pos;
71428
- ({
71429
- code,
71430
- pos
71431
- } = readHexChar(input, pos, lineStart, curLine, input.indexOf("}", pos) - pos, true, throwOnInvalid, errors));
71432
- ++pos;
71433
- if (code !== null && code > 0x10ffff) {
71434
- if (throwOnInvalid) {
71435
- errors.invalidCodePoint(pos, lineStart, curLine);
71436
- } else {
71437
- return {
71438
- code: null,
71439
- pos
71440
- };
71441
- }
71442
- }
71443
- } else {
71444
- ({
71445
- code,
71446
- pos
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 = requireLib$3();
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 parsePath = (path) => isPath(path) ? path.node : path;
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(path, visitor) {
143664
- path = parsePath(path);
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 babelTraverse(path, {
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
- babelTraverse(path, {
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(node, visitors);
143724
+ traverse$5(path, visitors);
143731
143725
 
143732
143726
  return found;
143733
143727
  };
@@ -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 parsePath = (path) => isPath(path) ? path.node : path;
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(path, visitor) {
143664
- path = parsePath(path);
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 babelTraverse(path, {
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
- babelTraverse(path, {
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(node, visitors);
143734
+ traverse$5(path, visitors);
143731
143735
 
143732
143736
  return found;
143733
143737
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/bundle",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout bundle suitable for Deno or Browsers",