@putout/bundle 2.1.0 → 2.1.1

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) => {
package/bundle/putout.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 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) => {
@@ -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) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/bundle",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
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",