@tinacms/app 0.0.28 → 1.0.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.
Files changed (211) hide show
  1. package/appFiles/node_modules/.package-lock.json +23 -23
  2. package/appFiles/node_modules/@babel/generator/lib/generators/base.js.map +1 -1
  3. package/appFiles/node_modules/@babel/generator/lib/generators/classes.js +1 -1
  4. package/appFiles/node_modules/@babel/generator/lib/generators/classes.js.map +1 -1
  5. package/appFiles/node_modules/@babel/generator/lib/generators/expressions.js +9 -15
  6. package/appFiles/node_modules/@babel/generator/lib/generators/expressions.js.map +1 -1
  7. package/appFiles/node_modules/@babel/generator/lib/generators/methods.js +12 -25
  8. package/appFiles/node_modules/@babel/generator/lib/generators/methods.js.map +1 -1
  9. package/appFiles/node_modules/@babel/generator/lib/generators/modules.js +6 -14
  10. package/appFiles/node_modules/@babel/generator/lib/generators/modules.js.map +1 -1
  11. package/appFiles/node_modules/@babel/generator/lib/generators/statements.js +1 -16
  12. package/appFiles/node_modules/@babel/generator/lib/generators/statements.js.map +1 -1
  13. package/appFiles/node_modules/@babel/generator/lib/index.js +11 -0
  14. package/appFiles/node_modules/@babel/generator/lib/index.js.map +1 -1
  15. package/appFiles/node_modules/@babel/generator/lib/printer.js +112 -86
  16. package/appFiles/node_modules/@babel/generator/lib/printer.js.map +1 -1
  17. package/appFiles/node_modules/@babel/generator/package.json +3 -3
  18. package/appFiles/node_modules/@babel/parser/lib/index.js +165 -99
  19. package/appFiles/node_modules/@babel/parser/lib/index.js.map +1 -1
  20. package/appFiles/node_modules/@babel/parser/package.json +2 -2
  21. package/appFiles/node_modules/@babel/parser/typings/babel-parser.d.ts +92 -80
  22. package/appFiles/node_modules/@babel/runtime/helpers/checkInRHS.js +6 -0
  23. package/appFiles/node_modules/@babel/runtime/helpers/createClass.js +2 -1
  24. package/appFiles/node_modules/@babel/runtime/helpers/defineProperty.js +2 -0
  25. package/appFiles/node_modules/@babel/runtime/helpers/esm/checkInRHS.js +5 -0
  26. package/appFiles/node_modules/@babel/runtime/helpers/esm/createClass.js +2 -1
  27. package/appFiles/node_modules/@babel/runtime/helpers/esm/defineProperty.js +2 -0
  28. package/appFiles/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js +23 -18
  29. package/appFiles/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimitLoose.js +8 -7
  30. package/appFiles/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js +3 -8
  31. package/appFiles/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js +23 -18
  32. package/appFiles/node_modules/@babel/runtime/helpers/iterableToArrayLimitLoose.js +8 -7
  33. package/appFiles/node_modules/@babel/runtime/helpers/regeneratorRuntime.js +3 -8
  34. package/appFiles/node_modules/@babel/runtime/package.json +29 -20
  35. package/appFiles/node_modules/@babel/traverse/lib/path/context.js +3 -2
  36. package/appFiles/node_modules/@babel/traverse/lib/path/context.js.map +1 -1
  37. package/appFiles/node_modules/@babel/traverse/lib/path/conversion.js +8 -4
  38. package/appFiles/node_modules/@babel/traverse/lib/path/conversion.js.map +1 -1
  39. package/appFiles/node_modules/@babel/traverse/lib/path/inference/inferer-reference.js +1 -0
  40. package/appFiles/node_modules/@babel/traverse/lib/path/inference/inferer-reference.js.map +1 -1
  41. package/appFiles/node_modules/@babel/traverse/lib/scope/index.js +1 -1
  42. package/appFiles/node_modules/@babel/traverse/lib/scope/index.js.map +1 -1
  43. package/appFiles/node_modules/@babel/traverse/package.json +4 -4
  44. package/appFiles/node_modules/@babel/types/lib/asserts/assertNode.js +0 -3
  45. package/appFiles/node_modules/@babel/types/lib/asserts/assertNode.js.map +1 -1
  46. package/appFiles/node_modules/@babel/types/lib/asserts/generated/index.js +0 -303
  47. package/appFiles/node_modules/@babel/types/lib/asserts/generated/index.js.map +1 -1
  48. package/appFiles/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js +0 -4
  49. package/appFiles/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map +1 -1
  50. package/appFiles/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js +0 -11
  51. package/appFiles/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js.map +1 -1
  52. package/appFiles/node_modules/@babel/types/lib/builders/generated/index.js +0 -253
  53. package/appFiles/node_modules/@babel/types/lib/builders/generated/index.js.map +1 -1
  54. package/appFiles/node_modules/@babel/types/lib/builders/generated/uppercase.js +0 -1
  55. package/appFiles/node_modules/@babel/types/lib/builders/generated/uppercase.js.map +1 -1
  56. package/appFiles/node_modules/@babel/types/lib/builders/react/buildChildren.js +0 -7
  57. package/appFiles/node_modules/@babel/types/lib/builders/react/buildChildren.js.map +1 -1
  58. package/appFiles/node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js +0 -5
  59. package/appFiles/node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js.map +1 -1
  60. package/appFiles/node_modules/@babel/types/lib/builders/validateNode.js +0 -5
  61. package/appFiles/node_modules/@babel/types/lib/builders/validateNode.js.map +1 -1
  62. package/appFiles/node_modules/@babel/types/lib/clone/clone.js +0 -2
  63. package/appFiles/node_modules/@babel/types/lib/clone/clone.js.map +1 -1
  64. package/appFiles/node_modules/@babel/types/lib/clone/cloneDeep.js +0 -2
  65. package/appFiles/node_modules/@babel/types/lib/clone/cloneDeep.js.map +1 -1
  66. package/appFiles/node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js +0 -2
  67. package/appFiles/node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js.map +1 -1
  68. package/appFiles/node_modules/@babel/types/lib/clone/cloneNode.js +4 -22
  69. package/appFiles/node_modules/@babel/types/lib/clone/cloneNode.js.map +1 -1
  70. package/appFiles/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js +0 -2
  71. package/appFiles/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js.map +1 -1
  72. package/appFiles/node_modules/@babel/types/lib/comments/addComment.js +0 -2
  73. package/appFiles/node_modules/@babel/types/lib/comments/addComment.js.map +1 -1
  74. package/appFiles/node_modules/@babel/types/lib/comments/addComments.js +0 -3
  75. package/appFiles/node_modules/@babel/types/lib/comments/addComments.js.map +1 -1
  76. package/appFiles/node_modules/@babel/types/lib/comments/inheritInnerComments.js +0 -2
  77. package/appFiles/node_modules/@babel/types/lib/comments/inheritInnerComments.js.map +1 -1
  78. package/appFiles/node_modules/@babel/types/lib/comments/inheritLeadingComments.js +0 -2
  79. package/appFiles/node_modules/@babel/types/lib/comments/inheritLeadingComments.js.map +1 -1
  80. package/appFiles/node_modules/@babel/types/lib/comments/inheritTrailingComments.js +0 -2
  81. package/appFiles/node_modules/@babel/types/lib/comments/inheritTrailingComments.js.map +1 -1
  82. package/appFiles/node_modules/@babel/types/lib/comments/inheritsComments.js +0 -4
  83. package/appFiles/node_modules/@babel/types/lib/comments/inheritsComments.js.map +1 -1
  84. package/appFiles/node_modules/@babel/types/lib/comments/removeComments.js +0 -3
  85. package/appFiles/node_modules/@babel/types/lib/comments/removeComments.js.map +1 -1
  86. package/appFiles/node_modules/@babel/types/lib/constants/generated/index.js +0 -1
  87. package/appFiles/node_modules/@babel/types/lib/constants/generated/index.js.map +1 -1
  88. package/appFiles/node_modules/@babel/types/lib/constants/index.js.map +1 -1
  89. package/appFiles/node_modules/@babel/types/lib/converters/ensureBlock.js +0 -2
  90. package/appFiles/node_modules/@babel/types/lib/converters/ensureBlock.js.map +1 -1
  91. package/appFiles/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js +2 -12
  92. package/appFiles/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js.map +1 -1
  93. package/appFiles/node_modules/@babel/types/lib/converters/toBindingIdentifierName.js +0 -2
  94. package/appFiles/node_modules/@babel/types/lib/converters/toBindingIdentifierName.js.map +1 -1
  95. package/appFiles/node_modules/@babel/types/lib/converters/toBlock.js +0 -7
  96. package/appFiles/node_modules/@babel/types/lib/converters/toBlock.js.map +1 -1
  97. package/appFiles/node_modules/@babel/types/lib/converters/toComputedKey.js +2 -4
  98. package/appFiles/node_modules/@babel/types/lib/converters/toComputedKey.js.map +1 -1
  99. package/appFiles/node_modules/@babel/types/lib/converters/toExpression.js +0 -4
  100. package/appFiles/node_modules/@babel/types/lib/converters/toExpression.js.map +1 -1
  101. package/appFiles/node_modules/@babel/types/lib/converters/toIdentifier.js +2 -6
  102. package/appFiles/node_modules/@babel/types/lib/converters/toIdentifier.js.map +1 -1
  103. package/appFiles/node_modules/@babel/types/lib/converters/toKeyAlias.js +0 -7
  104. package/appFiles/node_modules/@babel/types/lib/converters/toKeyAlias.js.map +1 -1
  105. package/appFiles/node_modules/@babel/types/lib/converters/toSequenceExpression.js +0 -3
  106. package/appFiles/node_modules/@babel/types/lib/converters/toSequenceExpression.js.map +1 -1
  107. package/appFiles/node_modules/@babel/types/lib/converters/toStatement.js +1 -7
  108. package/appFiles/node_modules/@babel/types/lib/converters/toStatement.js.map +1 -1
  109. package/appFiles/node_modules/@babel/types/lib/converters/valueToNode.js +2 -18
  110. package/appFiles/node_modules/@babel/types/lib/converters/valueToNode.js.map +1 -1
  111. package/appFiles/node_modules/@babel/types/lib/definitions/core.js +33 -61
  112. package/appFiles/node_modules/@babel/types/lib/definitions/core.js.map +1 -1
  113. package/appFiles/node_modules/@babel/types/lib/definitions/experimental.js +3 -1
  114. package/appFiles/node_modules/@babel/types/lib/definitions/experimental.js.map +1 -1
  115. package/appFiles/node_modules/@babel/types/lib/definitions/flow.js +1 -3
  116. package/appFiles/node_modules/@babel/types/lib/definitions/flow.js.map +1 -1
  117. package/appFiles/node_modules/@babel/types/lib/definitions/index.js +0 -18
  118. package/appFiles/node_modules/@babel/types/lib/definitions/index.js.map +1 -1
  119. package/appFiles/node_modules/@babel/types/lib/definitions/jsx.js +0 -1
  120. package/appFiles/node_modules/@babel/types/lib/definitions/jsx.js.map +1 -1
  121. package/appFiles/node_modules/@babel/types/lib/definitions/misc.js +0 -2
  122. package/appFiles/node_modules/@babel/types/lib/definitions/misc.js.map +1 -1
  123. package/appFiles/node_modules/@babel/types/lib/definitions/placeholders.js +0 -5
  124. package/appFiles/node_modules/@babel/types/lib/definitions/placeholders.js.map +1 -1
  125. package/appFiles/node_modules/@babel/types/lib/definitions/typescript.js +4 -15
  126. package/appFiles/node_modules/@babel/types/lib/definitions/typescript.js.map +1 -1
  127. package/appFiles/node_modules/@babel/types/lib/definitions/utils.js +1 -65
  128. package/appFiles/node_modules/@babel/types/lib/definitions/utils.js.map +1 -1
  129. package/appFiles/node_modules/@babel/types/lib/index.d.ts +64 -65
  130. package/appFiles/node_modules/@babel/types/lib/index.js +1 -75
  131. package/appFiles/node_modules/@babel/types/lib/index.js.map +1 -1
  132. package/appFiles/node_modules/@babel/types/lib/modifications/appendToMemberExpression.js +0 -2
  133. package/appFiles/node_modules/@babel/types/lib/modifications/appendToMemberExpression.js.map +1 -1
  134. package/appFiles/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js +3 -12
  135. package/appFiles/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js.map +1 -1
  136. package/appFiles/node_modules/@babel/types/lib/modifications/inherits.js +0 -4
  137. package/appFiles/node_modules/@babel/types/lib/modifications/inherits.js.map +1 -1
  138. package/appFiles/node_modules/@babel/types/lib/modifications/prependToMemberExpression.js +0 -4
  139. package/appFiles/node_modules/@babel/types/lib/modifications/prependToMemberExpression.js.map +1 -1
  140. package/appFiles/node_modules/@babel/types/lib/modifications/removeProperties.js +3 -8
  141. package/appFiles/node_modules/@babel/types/lib/modifications/removeProperties.js.map +1 -1
  142. package/appFiles/node_modules/@babel/types/lib/modifications/removePropertiesDeep.js +0 -3
  143. package/appFiles/node_modules/@babel/types/lib/modifications/removePropertiesDeep.js.map +1 -1
  144. package/appFiles/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js +1 -10
  145. package/appFiles/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js.map +1 -1
  146. package/appFiles/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js +4 -14
  147. package/appFiles/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js.map +1 -1
  148. package/appFiles/node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js +0 -3
  149. package/appFiles/node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js.map +1 -1
  150. package/appFiles/node_modules/@babel/types/lib/traverse/traverse.js +0 -7
  151. package/appFiles/node_modules/@babel/types/lib/traverse/traverse.js.map +1 -1
  152. package/appFiles/node_modules/@babel/types/lib/traverse/traverseFast.js +2 -5
  153. package/appFiles/node_modules/@babel/types/lib/traverse/traverseFast.js.map +1 -1
  154. package/appFiles/node_modules/@babel/types/lib/utils/inherit.js +0 -1
  155. package/appFiles/node_modules/@babel/types/lib/utils/inherit.js.map +1 -1
  156. package/appFiles/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js +1 -8
  157. package/appFiles/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js.map +1 -1
  158. package/appFiles/node_modules/@babel/types/lib/utils/shallowEqual.js +2 -4
  159. package/appFiles/node_modules/@babel/types/lib/utils/shallowEqual.js.map +1 -1
  160. package/appFiles/node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js +0 -2
  161. package/appFiles/node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js.map +1 -1
  162. package/appFiles/node_modules/@babel/types/lib/validators/generated/index.js +0 -906
  163. package/appFiles/node_modules/@babel/types/lib/validators/generated/index.js.map +1 -1
  164. package/appFiles/node_modules/@babel/types/lib/validators/is.js +0 -8
  165. package/appFiles/node_modules/@babel/types/lib/validators/is.js.map +1 -1
  166. package/appFiles/node_modules/@babel/types/lib/validators/isBinding.js +4 -8
  167. package/appFiles/node_modules/@babel/types/lib/validators/isBinding.js.map +1 -1
  168. package/appFiles/node_modules/@babel/types/lib/validators/isBlockScoped.js +0 -3
  169. package/appFiles/node_modules/@babel/types/lib/validators/isBlockScoped.js.map +1 -1
  170. package/appFiles/node_modules/@babel/types/lib/validators/isImmutable.js +0 -5
  171. package/appFiles/node_modules/@babel/types/lib/validators/isImmutable.js.map +1 -1
  172. package/appFiles/node_modules/@babel/types/lib/validators/isLet.js +2 -4
  173. package/appFiles/node_modules/@babel/types/lib/validators/isLet.js.map +1 -1
  174. package/appFiles/node_modules/@babel/types/lib/validators/isNode.js +0 -2
  175. package/appFiles/node_modules/@babel/types/lib/validators/isNode.js.map +1 -1
  176. package/appFiles/node_modules/@babel/types/lib/validators/isNodesEquivalent.js +2 -16
  177. package/appFiles/node_modules/@babel/types/lib/validators/isNodesEquivalent.js.map +1 -1
  178. package/appFiles/node_modules/@babel/types/lib/validators/isPlaceholderType.js +0 -4
  179. package/appFiles/node_modules/@babel/types/lib/validators/isPlaceholderType.js.map +1 -1
  180. package/appFiles/node_modules/@babel/types/lib/validators/isReferenced.js +0 -13
  181. package/appFiles/node_modules/@babel/types/lib/validators/isReferenced.js.map +1 -1
  182. package/appFiles/node_modules/@babel/types/lib/validators/isScope.js +0 -3
  183. package/appFiles/node_modules/@babel/types/lib/validators/isScope.js.map +1 -1
  184. package/appFiles/node_modules/@babel/types/lib/validators/isSpecifierDefault.js +2 -3
  185. package/appFiles/node_modules/@babel/types/lib/validators/isSpecifierDefault.js.map +1 -1
  186. package/appFiles/node_modules/@babel/types/lib/validators/isType.js +1 -5
  187. package/appFiles/node_modules/@babel/types/lib/validators/isType.js.map +1 -1
  188. package/appFiles/node_modules/@babel/types/lib/validators/isValidES3Identifier.js +0 -2
  189. package/appFiles/node_modules/@babel/types/lib/validators/isValidES3Identifier.js.map +1 -1
  190. package/appFiles/node_modules/@babel/types/lib/validators/isValidIdentifier.js +0 -4
  191. package/appFiles/node_modules/@babel/types/lib/validators/isValidIdentifier.js.map +1 -1
  192. package/appFiles/node_modules/@babel/types/lib/validators/isVar.js +2 -4
  193. package/appFiles/node_modules/@babel/types/lib/validators/isVar.js.map +1 -1
  194. package/appFiles/node_modules/@babel/types/lib/validators/matchesPattern.js +0 -8
  195. package/appFiles/node_modules/@babel/types/lib/validators/matchesPattern.js.map +1 -1
  196. package/appFiles/node_modules/@babel/types/lib/validators/react/isCompatTag.js +0 -1
  197. package/appFiles/node_modules/@babel/types/lib/validators/react/isCompatTag.js.map +1 -1
  198. package/appFiles/node_modules/@babel/types/lib/validators/react/isReactComponent.js +0 -2
  199. package/appFiles/node_modules/@babel/types/lib/validators/react/isReactComponent.js.map +1 -1
  200. package/appFiles/node_modules/@babel/types/lib/validators/validate.js +0 -4
  201. package/appFiles/node_modules/@babel/types/lib/validators/validate.js.map +1 -1
  202. package/appFiles/node_modules/@babel/types/package.json +3 -3
  203. package/appFiles/node_modules/regenerator-runtime/package.json +2 -2
  204. package/appFiles/node_modules/regenerator-runtime/runtime.js +18 -17
  205. package/appFiles/src/App.tsx +0 -12
  206. package/appFiles/src/fields/rich-text/monaco/mdx.js +0 -46
  207. package/appFiles/src/lib/machines/query-machine.ts +130 -2
  208. package/appFiles/src/preview.tsx +9 -15
  209. package/dist/index.js +1 -1
  210. package/package.json +4 -4
  211. package/appFiles/node_modules/@babel/types/lib/index.d.ts.map +0 -1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babel/parser",
3
- "version": "7.20.1",
3
+ "version": "7.20.5",
4
4
  "description": "A JavaScript parser",
5
5
  "author": "The Babel Team (https://babel.dev/team)",
6
6
  "homepage": "https://babel.dev/docs/en/next/babel-parser",
@@ -27,7 +27,7 @@
27
27
  "files": [
28
28
  "bin",
29
29
  "lib",
30
- "typings",
30
+ "typings/babel-parser.d.ts",
31
31
  "index.cjs"
32
32
  ],
33
33
  "engines": {
@@ -1,3 +1,85 @@
1
+ // This file is auto-generated! Do not modify it directly.
2
+ /* eslint-disable import/no-extraneous-dependencies, @typescript-eslint/consistent-type-imports, prettier/prettier */
3
+ import * as _babel_types from '@babel/types';
4
+
5
+ type Plugin =
6
+ | "asyncDoExpressions"
7
+ | "asyncGenerators"
8
+ | "bigInt"
9
+ | "classPrivateMethods"
10
+ | "classPrivateProperties"
11
+ | "classProperties"
12
+ | "classStaticBlock" // Enabled by default
13
+ | "decimal"
14
+ | "decorators-legacy"
15
+ | "decoratorAutoAccessors"
16
+ | "destructuringPrivate"
17
+ | "doExpressions"
18
+ | "dynamicImport"
19
+ | "explicitResourceManagement"
20
+ | "exportDefaultFrom"
21
+ | "exportNamespaceFrom" // deprecated
22
+ | "flow"
23
+ | "flowComments"
24
+ | "functionBind"
25
+ | "functionSent"
26
+ | "importMeta"
27
+ | "jsx"
28
+ | "logicalAssignment"
29
+ | "importAssertions"
30
+ | "importReflection"
31
+ | "moduleBlocks"
32
+ | "moduleStringNames"
33
+ | "nullishCoalescingOperator"
34
+ | "numericSeparator"
35
+ | "objectRestSpread"
36
+ | "optionalCatchBinding"
37
+ | "optionalChaining"
38
+ | "partialApplication"
39
+ | "placeholders"
40
+ | "privateIn" // Enabled by default
41
+ | "regexpUnicodeSets"
42
+ | "throwExpressions"
43
+ | "topLevelAwait"
44
+ | "v8intrinsic"
45
+ | ParserPluginWithOptions[0];
46
+
47
+ type ParserPluginWithOptions =
48
+ | ["decorators", DecoratorsPluginOptions]
49
+ | ["estree", { classFeatures?: boolean }]
50
+ // @deprecated
51
+ | ["moduleAttributes", { version: "may-2020" }]
52
+ | ["pipelineOperator", PipelineOperatorPluginOptions]
53
+ | ["recordAndTuple", RecordAndTuplePluginOptions]
54
+ | ["flow", FlowPluginOptions]
55
+ | ["typescript", TypeScriptPluginOptions];
56
+
57
+ type PluginConfig = Plugin | ParserPluginWithOptions;
58
+
59
+ interface DecoratorsPluginOptions {
60
+ decoratorsBeforeExport?: boolean;
61
+ allowCallParenthesized?: boolean;
62
+ }
63
+
64
+ interface PipelineOperatorPluginOptions {
65
+ proposal: "minimal" | "fsharp" | "hack" | "smart";
66
+ topicToken?: "%" | "#" | "@@" | "^^" | "^";
67
+ }
68
+
69
+ interface RecordAndTuplePluginOptions {
70
+ syntaxType: "bar" | "hash";
71
+ }
72
+
73
+ interface FlowPluginOptions {
74
+ all?: boolean;
75
+ enums?: boolean;
76
+ }
77
+
78
+ interface TypeScriptPluginOptions {
79
+ dts?: boolean;
80
+ disallowAmbiguousJSXLike?: boolean;
81
+ }
82
+
1
83
  // Type definitions for @babel/parser
2
84
  // Project: https://github.com/babel/babel/tree/main/packages/babel-parser
3
85
  // Definitions by: Troy Gerwien <https://github.com/yortus>
@@ -8,20 +90,20 @@
8
90
  /**
9
91
  * Parse the provided code as an entire ECMAScript program.
10
92
  */
11
- export function parse(
93
+ declare function parse(
12
94
  input: string,
13
95
  options?: ParserOptions
14
- ): ParseResult<import("@babel/types").File>;
96
+ ): ParseResult<_babel_types.File>;
15
97
 
16
98
  /**
17
99
  * Parse the provided code as a single expression.
18
100
  */
19
- export function parseExpression(
101
+ declare function parseExpression(
20
102
  input: string,
21
103
  options?: ParserOptions
22
- ): ParseResult<import("@babel/types").Expression>;
104
+ ): ParseResult<_babel_types.Expression>;
23
105
 
24
- export interface ParserOptions {
106
+ interface ParserOptions {
25
107
  /**
26
108
  * By default, import and export declarations can only appear at a program's top level.
27
109
  * Setting this option to true allows them anywhere where a statement is allowed.
@@ -125,87 +207,15 @@ export interface ParserOptions {
125
207
  createParenthesizedExpressions?: boolean;
126
208
  }
127
209
 
128
- export type ParserPlugin =
129
- | "asyncDoExpressions"
130
- | "asyncGenerators"
131
- | "bigInt"
132
- | "classPrivateMethods"
133
- | "classPrivateProperties"
134
- | "classProperties"
135
- | "classStaticBlock" // Enabled by default
136
- | "decimal"
137
- | "decorators"
138
- | "decorators-legacy"
139
- | "decoratorAutoAccessors"
140
- | "destructuringPrivate"
141
- | "doExpressions"
142
- | "dynamicImport"
143
- | "estree"
144
- | "exportDefaultFrom"
145
- | "exportNamespaceFrom" // deprecated
146
- | "flow"
147
- | "flowComments"
148
- | "functionBind"
149
- | "functionSent"
150
- | "importMeta"
151
- | "jsx"
152
- | "logicalAssignment"
153
- | "importAssertions"
154
- | "moduleBlocks"
155
- | "moduleStringNames"
156
- | "nullishCoalescingOperator"
157
- | "numericSeparator"
158
- | "objectRestSpread"
159
- | "optionalCatchBinding"
160
- | "optionalChaining"
161
- | "partialApplication"
162
- | "pipelineOperator"
163
- | "placeholders"
164
- | "privateIn" // Enabled by default
165
- | "recordAndTuple"
166
- | "regexpUnicodeSets"
167
- | "throwExpressions"
168
- | "topLevelAwait"
169
- | "typescript"
170
- | "v8intrinsic"
171
- | ParserPluginWithOptions;
172
-
173
- export type ParserPluginWithOptions =
174
- | ["decorators", DecoratorsPluginOptions]
175
- | ["pipelineOperator", PipelineOperatorPluginOptions]
176
- | ["recordAndTuple", RecordAndTuplePluginOptions]
177
- | ["flow", FlowPluginOptions]
178
- | ["typescript", TypeScriptPluginOptions];
179
-
180
- export interface DecoratorsPluginOptions {
181
- decoratorsBeforeExport?: boolean;
182
- }
183
-
184
- export interface PipelineOperatorPluginOptions {
185
- proposal: "minimal" | "fsharp" | "hack" | "smart";
186
- topicToken?: "%" | "#" | "@@" | "^^" | "^";
187
- }
210
+ type ParserPlugin = PluginConfig;
188
211
 
189
- export interface RecordAndTuplePluginOptions {
190
- syntaxType?: "bar" | "hash";
191
- }
192
212
 
193
- export interface FlowPluginOptions {
194
- all?: boolean;
195
- enums?: boolean;
196
- }
197
-
198
- export interface TypeScriptPluginOptions {
199
- dts?: boolean;
200
- disallowAmbiguousJSXLike?: boolean;
201
- }
202
-
203
- export const tokTypes: {
213
+ declare const tokTypes: {
204
214
  // todo(flow->ts) real token type
205
215
  [name: string]: any;
206
216
  };
207
217
 
208
- export interface ParseError {
218
+ interface ParseError {
209
219
  code: string;
210
220
  reasonCode: string;
211
221
  }
@@ -213,3 +223,5 @@ export interface ParseError {
213
223
  type ParseResult<Result> = Result & {
214
224
  errors: ParseError[];
215
225
  };
226
+
227
+ export { DecoratorsPluginOptions, FlowPluginOptions, ParseError, ParseResult, ParserOptions, ParserPlugin, ParserPluginWithOptions, PipelineOperatorPluginOptions, RecordAndTuplePluginOptions, TypeScriptPluginOptions, parse, parseExpression, tokTypes };
@@ -0,0 +1,6 @@
1
+ var _typeof = require("./typeof.js")["default"];
2
+ function _checkInRHS(value) {
3
+ if (Object(value) !== value) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== value ? _typeof(value) : "null"));
4
+ return value;
5
+ }
6
+ module.exports = _checkInRHS, module.exports.__esModule = true, module.exports["default"] = module.exports;
@@ -1,10 +1,11 @@
1
+ var toPropertyKey = require("./toPropertyKey.js");
1
2
  function _defineProperties(target, props) {
2
3
  for (var i = 0; i < props.length; i++) {
3
4
  var descriptor = props[i];
4
5
  descriptor.enumerable = descriptor.enumerable || false;
5
6
  descriptor.configurable = true;
6
7
  if ("value" in descriptor) descriptor.writable = true;
7
- Object.defineProperty(target, descriptor.key, descriptor);
8
+ Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
8
9
  }
9
10
  }
10
11
  function _createClass(Constructor, protoProps, staticProps) {
@@ -1,4 +1,6 @@
1
+ var toPropertyKey = require("./toPropertyKey.js");
1
2
  function _defineProperty(obj, key, value) {
3
+ key = toPropertyKey(key);
2
4
  if (key in obj) {
3
5
  Object.defineProperty(obj, key, {
4
6
  value: value,
@@ -0,0 +1,5 @@
1
+ import _typeof from "./typeof.js";
2
+ export default function _checkInRHS(value) {
3
+ if (Object(value) !== value) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== value ? _typeof(value) : "null"));
4
+ return value;
5
+ }
@@ -1,10 +1,11 @@
1
+ import toPropertyKey from "./toPropertyKey.js";
1
2
  function _defineProperties(target, props) {
2
3
  for (var i = 0; i < props.length; i++) {
3
4
  var descriptor = props[i];
4
5
  descriptor.enumerable = descriptor.enumerable || false;
5
6
  descriptor.configurable = true;
6
7
  if ("value" in descriptor) descriptor.writable = true;
7
- Object.defineProperty(target, descriptor.key, descriptor);
8
+ Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
8
9
  }
9
10
  }
10
11
  export default function _createClass(Constructor, protoProps, staticProps) {
@@ -1,4 +1,6 @@
1
+ import toPropertyKey from "./toPropertyKey.js";
1
2
  export default function _defineProperty(obj, key, value) {
3
+ key = toPropertyKey(key);
2
4
  if (key in obj) {
3
5
  Object.defineProperty(obj, key, {
4
6
  value: value,
@@ -1,24 +1,29 @@
1
1
  export default function _iterableToArrayLimit(arr, i) {
2
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
3
- if (_i == null) return;
4
- var _arr = [];
5
- var _n = true;
6
- var _d = false;
7
- var _s, _e;
8
- try {
9
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
10
- _arr.push(_s.value);
11
- if (i && _arr.length === i) break;
12
- }
13
- } catch (err) {
14
- _d = true;
15
- _e = err;
16
- } finally {
2
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
3
+ if (null != _i) {
4
+ var _s,
5
+ _e,
6
+ _x,
7
+ _r,
8
+ _arr = [],
9
+ _n = !0,
10
+ _d = !1;
17
11
  try {
18
- if (!_n && _i["return"] != null) _i["return"]();
12
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
13
+ if (Object(_i) !== _i) return;
14
+ _n = !1;
15
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) {
16
+ ;
17
+ }
18
+ } catch (err) {
19
+ _d = !0, _e = err;
19
20
  } finally {
20
- if (_d) throw _e;
21
+ try {
22
+ if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
23
+ } finally {
24
+ if (_d) throw _e;
25
+ }
21
26
  }
27
+ return _arr;
22
28
  }
23
- return _arr;
24
29
  }
@@ -1,10 +1,11 @@
1
1
  export default function _iterableToArrayLimitLoose(arr, i) {
2
- var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]);
3
- if (_i == null) return;
4
- var _arr = [];
5
- for (_i = _i.call(arr), _step; !(_step = _i.next()).done;) {
6
- _arr.push(_step.value);
7
- if (i && _arr.length === i) break;
2
+ var _i = arr && ("undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]);
3
+ if (null != _i) {
4
+ var _s,
5
+ _arr = [];
6
+ for (_i = _i.call(arr); arr.length < i && !(_s = _i.next()).done;) {
7
+ _arr.push(_s.value);
8
+ }
9
+ return _arr;
8
10
  }
9
- return _arr;
10
11
  }
@@ -135,14 +135,9 @@ export default function _regeneratorRuntime() {
135
135
  };
136
136
  }
137
137
  function maybeInvokeDelegate(delegate, context) {
138
- var method = delegate.iterator[context.method];
139
- if (undefined === method) {
140
- if (context.delegate = null, "throw" === context.method) {
141
- if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
142
- context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
143
- }
144
- return ContinueSentinel;
145
- }
138
+ var methodName = context.method,
139
+ method = delegate.iterator[methodName];
140
+ if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
146
141
  var record = tryCatch(method, delegate.iterator, context.arg);
147
142
  if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
148
143
  var info = record.arg;
@@ -1,25 +1,30 @@
1
1
  function _iterableToArrayLimit(arr, i) {
2
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
3
- if (_i == null) return;
4
- var _arr = [];
5
- var _n = true;
6
- var _d = false;
7
- var _s, _e;
8
- try {
9
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
10
- _arr.push(_s.value);
11
- if (i && _arr.length === i) break;
12
- }
13
- } catch (err) {
14
- _d = true;
15
- _e = err;
16
- } finally {
2
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
3
+ if (null != _i) {
4
+ var _s,
5
+ _e,
6
+ _x,
7
+ _r,
8
+ _arr = [],
9
+ _n = !0,
10
+ _d = !1;
17
11
  try {
18
- if (!_n && _i["return"] != null) _i["return"]();
12
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
13
+ if (Object(_i) !== _i) return;
14
+ _n = !1;
15
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) {
16
+ ;
17
+ }
18
+ } catch (err) {
19
+ _d = !0, _e = err;
19
20
  } finally {
20
- if (_d) throw _e;
21
+ try {
22
+ if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
23
+ } finally {
24
+ if (_d) throw _e;
25
+ }
21
26
  }
27
+ return _arr;
22
28
  }
23
- return _arr;
24
29
  }
25
30
  module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
@@ -1,11 +1,12 @@
1
1
  function _iterableToArrayLimitLoose(arr, i) {
2
- var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]);
3
- if (_i == null) return;
4
- var _arr = [];
5
- for (_i = _i.call(arr), _step; !(_step = _i.next()).done;) {
6
- _arr.push(_step.value);
7
- if (i && _arr.length === i) break;
2
+ var _i = arr && ("undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]);
3
+ if (null != _i) {
4
+ var _s,
5
+ _arr = [];
6
+ for (_i = _i.call(arr); arr.length < i && !(_s = _i.next()).done;) {
7
+ _arr.push(_s.value);
8
+ }
9
+ return _arr;
8
10
  }
9
- return _arr;
10
11
  }
11
12
  module.exports = _iterableToArrayLimitLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
@@ -135,14 +135,9 @@ function _regeneratorRuntime() {
135
135
  };
136
136
  }
137
137
  function maybeInvokeDelegate(delegate, context) {
138
- var method = delegate.iterator[context.method];
139
- if (undefined === method) {
140
- if (context.delegate = null, "throw" === context.method) {
141
- if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
142
- context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
143
- }
144
- return ContinueSentinel;
145
- }
138
+ var methodName = context.method,
139
+ method = delegate.iterator[methodName];
140
+ if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
146
141
  var record = tryCatch(method, delegate.iterator, context.arg);
147
142
  if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
148
143
  var info = record.arg;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babel/runtime",
3
- "version": "7.20.1",
3
+ "version": "7.20.6",
4
4
  "description": "babel's modular runtime helpers",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -14,7 +14,7 @@
14
14
  "homepage": "https://babel.dev/docs/en/next/babel-runtime",
15
15
  "author": "The Babel Team (https://babel.dev/team)",
16
16
  "dependencies": {
17
- "regenerator-runtime": "^0.13.10"
17
+ "regenerator-runtime": "^0.13.11"
18
18
  },
19
19
  "exports": {
20
20
  "./helpers/AsyncGenerator": [
@@ -80,6 +80,33 @@
80
80
  "./helpers/awaitAsyncGenerator.js"
81
81
  ],
82
82
  "./helpers/esm/awaitAsyncGenerator": "./helpers/esm/awaitAsyncGenerator.js",
83
+ "./helpers/checkInRHS": [
84
+ {
85
+ "node": "./helpers/checkInRHS.js",
86
+ "import": "./helpers/esm/checkInRHS.js",
87
+ "default": "./helpers/checkInRHS.js"
88
+ },
89
+ "./helpers/checkInRHS.js"
90
+ ],
91
+ "./helpers/esm/checkInRHS": "./helpers/esm/checkInRHS.js",
92
+ "./helpers/iterableToArrayLimit": [
93
+ {
94
+ "node": "./helpers/iterableToArrayLimit.js",
95
+ "import": "./helpers/esm/iterableToArrayLimit.js",
96
+ "default": "./helpers/iterableToArrayLimit.js"
97
+ },
98
+ "./helpers/iterableToArrayLimit.js"
99
+ ],
100
+ "./helpers/esm/iterableToArrayLimit": "./helpers/esm/iterableToArrayLimit.js",
101
+ "./helpers/iterableToArrayLimitLoose": [
102
+ {
103
+ "node": "./helpers/iterableToArrayLimitLoose.js",
104
+ "import": "./helpers/esm/iterableToArrayLimitLoose.js",
105
+ "default": "./helpers/iterableToArrayLimitLoose.js"
106
+ },
107
+ "./helpers/iterableToArrayLimitLoose.js"
108
+ ],
109
+ "./helpers/esm/iterableToArrayLimitLoose": "./helpers/esm/iterableToArrayLimitLoose.js",
83
110
  "./helpers/jsx": [
84
111
  {
85
112
  "node": "./helpers/jsx.js",
@@ -548,24 +575,6 @@
548
575
  "./helpers/iterableToArray.js"
549
576
  ],
550
577
  "./helpers/esm/iterableToArray": "./helpers/esm/iterableToArray.js",
551
- "./helpers/iterableToArrayLimit": [
552
- {
553
- "node": "./helpers/iterableToArrayLimit.js",
554
- "import": "./helpers/esm/iterableToArrayLimit.js",
555
- "default": "./helpers/iterableToArrayLimit.js"
556
- },
557
- "./helpers/iterableToArrayLimit.js"
558
- ],
559
- "./helpers/esm/iterableToArrayLimit": "./helpers/esm/iterableToArrayLimit.js",
560
- "./helpers/iterableToArrayLimitLoose": [
561
- {
562
- "node": "./helpers/iterableToArrayLimitLoose.js",
563
- "import": "./helpers/esm/iterableToArrayLimitLoose.js",
564
- "default": "./helpers/iterableToArrayLimitLoose.js"
565
- },
566
- "./helpers/iterableToArrayLimitLoose.js"
567
- ],
568
- "./helpers/esm/iterableToArrayLimitLoose": "./helpers/esm/iterableToArrayLimitLoose.js",
569
578
  "./helpers/unsupportedIterableToArray": [
570
579
  {
571
580
  "node": "./helpers/unsupportedIterableToArray.js",
@@ -107,8 +107,9 @@ function stop() {
107
107
  function setScope() {
108
108
  if (this.opts && this.opts.noScope) return;
109
109
  let path = this.parentPath;
110
-
111
- if ((this.key === "key" || this.listKey === "decorators") && path.isMethod()) {
110
+ if (
111
+ (this.key === "key" || this.listKey === "decorators") && path.isMethod() ||
112
+ this.key === "discriminant" && path.isSwitchStatement()) {
112
113
  path = path.parentPath;
113
114
  }
114
115
  let target;
@@ -1 +1 @@
1
- {"version":3,"names":["call","key","opts","debug","node","_call","type","fns","fn","ret","state","then","Error","_traverseFlags","isDenylisted","denylist","blacklist","indexOf","restoreContext","path","context","visit","shouldSkip","currentContext","shouldStop","traverseNode","scope","skipKeys","skip","skipKey","stop","SHOULD_SKIP","SHOULD_STOP","setScope","noScope","parentPath","listKey","isMethod","target","getScope","init","setContext","resync","removed","_resyncParent","_resyncList","_resyncKey","parent","container","Array","isArray","i","length","setKey","Object","keys","inList","newContainer","_resyncRemoved","_markRemoved","popContext","contexts","pop","undefined","pushContext","push","setup","requeue","pathToQueue","maybeQueue","_getQueueContexts"],"sources":["../../src/path/context.ts"],"sourcesContent":["// This file contains methods responsible for maintaining a TraversalContext.\n\nimport { traverseNode } from \"../traverse-node\";\nimport { SHOULD_SKIP, SHOULD_STOP } from \"./index\";\nimport type TraversalContext from \"../context\";\nimport type NodePath from \"./index\";\nimport type * as t from \"@babel/types\";\n\nexport function call(this: NodePath, key: string): boolean {\n const opts = this.opts;\n\n this.debug(key);\n\n if (this.node) {\n if (this._call(opts[key])) return true;\n }\n\n if (this.node) {\n return this._call(opts[this.node.type] && opts[this.node.type][key]);\n }\n\n return false;\n}\n\nexport function _call(this: NodePath, fns?: Array<Function>): boolean {\n if (!fns) return false;\n\n for (const fn of fns) {\n if (!fn) continue;\n\n const node = this.node;\n if (!node) return true;\n\n const ret = fn.call(this.state, this, this.state);\n if (ret && typeof ret === \"object\" && typeof ret.then === \"function\") {\n throw new Error(\n `You appear to be using a plugin with an async traversal visitor, ` +\n `which your current version of Babel does not support. ` +\n `If you're using a published plugin, you may need to upgrade ` +\n `your @babel/core version.`,\n );\n }\n if (ret) {\n throw new Error(`Unexpected return value from visitor method ${fn}`);\n }\n\n // node has been replaced, it will have been requeued\n if (this.node !== node) return true;\n\n // this.shouldSkip || this.shouldStop || this.removed\n if (this._traverseFlags > 0) return true;\n }\n\n return false;\n}\n\nexport function isDenylisted(this: NodePath): boolean {\n const denylist = this.opts.denylist ?? this.opts.blacklist;\n return denylist && denylist.indexOf(this.node.type) > -1;\n}\n\n// TODO: Remove in Babel 8\nexport { isDenylisted as isBlacklisted };\n\nfunction restoreContext(path: NodePath, context: TraversalContext) {\n if (path.context !== context) {\n path.context = context;\n path.state = context.state;\n path.opts = context.opts;\n }\n}\n\nexport function visit(this: NodePath): boolean {\n if (!this.node) {\n return false;\n }\n\n if (this.isDenylisted()) {\n return false;\n }\n\n if (this.opts.shouldSkip && this.opts.shouldSkip(this)) {\n return false;\n }\n\n const currentContext = this.context;\n // Note: We need to check \"this.shouldSkip\" first because\n // another visitor can set it to true. Usually .shouldSkip is false\n // before calling the enter visitor, but it can be true in case of\n // a requeued node (e.g. by .replaceWith()) that is then marked\n // with .skip().\n if (this.shouldSkip || this.call(\"enter\")) {\n this.debug(\"Skip...\");\n return this.shouldStop;\n }\n restoreContext(this, currentContext);\n\n this.debug(\"Recursing into...\");\n this.shouldStop = traverseNode(\n this.node,\n this.opts,\n this.scope,\n this.state,\n this,\n this.skipKeys,\n );\n\n restoreContext(this, currentContext);\n\n this.call(\"exit\");\n\n return this.shouldStop;\n}\n\nexport function skip(this: NodePath) {\n this.shouldSkip = true;\n}\n\nexport function skipKey(this: NodePath, key: string) {\n if (this.skipKeys == null) {\n this.skipKeys = {};\n }\n this.skipKeys[key] = true;\n}\n\nexport function stop(this: NodePath) {\n // this.shouldSkip = true; this.shouldStop = true;\n this._traverseFlags |= SHOULD_SKIP | SHOULD_STOP;\n}\n\nexport function setScope(this: NodePath) {\n if (this.opts && this.opts.noScope) return;\n\n let path = this.parentPath;\n\n // Skip method scope if is computed method key or decorator expression\n if (\n (this.key === \"key\" || this.listKey === \"decorators\") &&\n path.isMethod()\n ) {\n path = path.parentPath;\n }\n\n let target;\n while (path && !target) {\n if (path.opts && path.opts.noScope) return;\n\n target = path.scope;\n path = path.parentPath;\n }\n\n this.scope = this.getScope(target);\n if (this.scope) this.scope.init();\n}\n\nexport function setContext<S = unknown>(\n this: NodePath,\n context?: TraversalContext<S>,\n) {\n if (this.skipKeys != null) {\n this.skipKeys = {};\n }\n // this.shouldSkip = false; this.shouldStop = false; this.removed = false;\n this._traverseFlags = 0;\n\n if (context) {\n this.context = context;\n this.state = context.state;\n this.opts = context.opts;\n }\n\n this.setScope();\n\n return this;\n}\n\n/**\n * Here we resync the node paths `key` and `container`. If they've changed according\n * to what we have stored internally then we attempt to resync by crawling and looking\n * for the new values.\n */\n\nexport function resync(this: NodePath) {\n if (this.removed) return;\n\n this._resyncParent();\n this._resyncList();\n this._resyncKey();\n //this._resyncRemoved();\n}\n\nexport function _resyncParent(this: NodePath) {\n if (this.parentPath) {\n this.parent = this.parentPath.node;\n }\n}\n\nexport function _resyncKey(this: NodePath) {\n if (!this.container) return;\n\n if (\n this.node ===\n // @ts-expect-error this.key should present in this.container\n this.container[this.key]\n ) {\n return;\n }\n\n // grrr, path key is out of sync. this is likely due to a modification to the AST\n // not done through our path APIs\n\n if (Array.isArray(this.container)) {\n for (let i = 0; i < this.container.length; i++) {\n if (this.container[i] === this.node) {\n return this.setKey(i);\n }\n }\n } else {\n for (const key of Object.keys(this.container)) {\n // @ts-expect-error this.key should present in this.container\n if (this.container[key] === this.node) {\n return this.setKey(key);\n }\n }\n }\n\n // ¯\\_(ツ)_/¯ who knows where it's gone lol\n this.key = null;\n}\n\nexport function _resyncList(this: NodePath) {\n if (!this.parent || !this.inList) return;\n\n const newContainer =\n // @ts-expect-error this.listKey should present in this.parent\n this.parent[this.listKey];\n if (this.container === newContainer) return;\n\n // container is out of sync. this is likely the result of it being reassigned\n this.container = newContainer || null;\n}\n\nexport function _resyncRemoved(this: NodePath) {\n if (\n this.key == null ||\n !this.container ||\n // @ts-expect-error this.key should present in this.container\n this.container[this.key] !== this.node\n ) {\n this._markRemoved();\n }\n}\n\nexport function popContext(this: NodePath) {\n this.contexts.pop();\n if (this.contexts.length > 0) {\n this.setContext(this.contexts[this.contexts.length - 1]);\n } else {\n this.setContext(undefined);\n }\n}\n\nexport function pushContext(this: NodePath, context: TraversalContext) {\n this.contexts.push(context);\n this.setContext(context);\n}\n\nexport function setup(\n this: NodePath,\n parentPath: NodePath | undefined,\n container: t.Node,\n listKey: string,\n key: string | number,\n) {\n this.listKey = listKey;\n this.container = container;\n\n this.parentPath = parentPath || this.parentPath;\n this.setKey(key);\n}\n\nexport function setKey(this: NodePath, key: string | number) {\n this.key = key;\n this.node =\n // @ts-expect-error this.key must present in this.container\n this.container[this.key];\n this.type = this.node?.type;\n}\n\nexport function requeue(this: NodePath, pathToQueue = this) {\n if (pathToQueue.removed) return;\n\n // If a path is skipped, and then replaced with a\n // new one, the new one shouldn't probably be skipped.\n if (process.env.BABEL_8_BREAKING) {\n pathToQueue.shouldSkip = false;\n }\n\n // TODO(loganfsmyth): This should be switched back to queue in parent contexts\n // automatically once #2892 and #4135 have been resolved. See #4140.\n // let contexts = this._getQueueContexts();\n const contexts = this.contexts;\n\n for (const context of contexts) {\n context.maybeQueue(pathToQueue);\n }\n}\n\nexport function _getQueueContexts(this: NodePath) {\n let path = this;\n let contexts = this.contexts;\n while (!contexts.length) {\n path = path.parentPath;\n if (!path) break;\n contexts = path.contexts;\n }\n return contexts;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAEA;AACA;;AAKO,SAASA,IAAI,CAAiBC,GAAW,EAAW;EACzD,MAAMC,IAAI,GAAG,IAAI,CAACA,IAAI;EAEtB,IAAI,CAACC,KAAK,CAACF,GAAG,CAAC;EAEf,IAAI,IAAI,CAACG,IAAI,EAAE;IACb,IAAI,IAAI,CAACC,KAAK,CAACH,IAAI,CAACD,GAAG,CAAC,CAA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ACb,UAAU,GAAGA,UAAU,IAAI,IAAI,CAACA,UAAU;EAC/C,IAAI,CAACkB,MAAM,CAACpD,GAAG,CAAC;AAClB;AAEO,SAASoD,MAAM,CAAiBpD,GAAoB,EAAE;EAAA;EAC3D,IAAI,CAACA,GAAG,GAAGA,GAAG;EACd,IAAI,CAACG,IAAI;EAEP,IAAI,CAAC4C,SAAS,CAAC,IAAI,CAAC/C,GAAG,CAAC;EAC1B,IAAI,CAACK,IAAI,iBAAG,IAAI,CAACF,IAAI,qBAAT,WAAWE,IAAI;AAC7B;AAEO,SAAS6D,OAAO,CAAiBC,WAAW,GAAG,IAAI,EAAE;EAC1D,IAAIA,WAAW,CAACzB,OAAO,EAAE;;EAAO;EAWhC,MAAMkB,QAAQ,GAAG,IAAI,CAACA,QAAQ;EAE9B,KAAK,MAAMzC,OAAO,IAAIyC,QAAQ,EAAE;IAC9BzC,OAAO,CAACiD,UAAU,CAACD,WAAW,CAAC;EACjC;AACF;AAEO,SAASE,iBAAiB,GAAiB;EAChD,IAAInD,IAAI,GAAG,IAAI;EACf,IAAI0C,QAAQ,GAAG,IAAI,CAACA,QAAQ;EAC5B,OAAO,CAACA,QAAQ,CAACT,MAAM,EAAE;IACvBjC,IAAI,GAAGA,IAAI,CAACgB,UAAU;IACtB,IAAI,CAAChB,IAAI,EAAE;IACX0C,QAAQ,GAAG1C,IAAI,CAAC0C,QAAQ;EAC1B;EACA,OAAOA,QAAQ;AACjB"}
1
+ {"version":3,"names":["call","key","opts","debug","node","_call","type","fns","fn","ret","state","then","Error","_traverseFlags","isDenylisted","denylist","blacklist","indexOf","restoreContext","path","context","visit","shouldSkip","currentContext","shouldStop","traverseNode","scope","skipKeys","skip","skipKey","stop","SHOULD_SKIP","SHOULD_STOP","setScope","noScope","parentPath","listKey","isMethod","isSwitchStatement","target","getScope","init","setContext","resync","removed","_resyncParent","_resyncList","_resyncKey","parent","container","Array","isArray","i","length","setKey","Object","keys","inList","newContainer","_resyncRemoved","_markRemoved","popContext","contexts","pop","undefined","pushContext","push","setup","requeue","pathToQueue","maybeQueue","_getQueueContexts"],"sources":["../../src/path/context.ts"],"sourcesContent":["// This file contains methods responsible for maintaining a TraversalContext.\n\nimport { traverseNode } from \"../traverse-node\";\nimport { SHOULD_SKIP, SHOULD_STOP } from \"./index\";\nimport type TraversalContext from \"../context\";\nimport type NodePath from \"./index\";\nimport type * as t from \"@babel/types\";\n\nexport function call(this: NodePath, key: string): boolean {\n const opts = this.opts;\n\n this.debug(key);\n\n if (this.node) {\n if (this._call(opts[key])) return true;\n }\n\n if (this.node) {\n return this._call(opts[this.node.type] && opts[this.node.type][key]);\n }\n\n return false;\n}\n\nexport function _call(this: NodePath, fns?: Array<Function>): boolean {\n if (!fns) return false;\n\n for (const fn of fns) {\n if (!fn) continue;\n\n const node = this.node;\n if (!node) return true;\n\n const ret = fn.call(this.state, this, this.state);\n if (ret && typeof ret === \"object\" && typeof ret.then === \"function\") {\n throw new Error(\n `You appear to be using a plugin with an async traversal visitor, ` +\n `which your current version of Babel does not support. ` +\n `If you're using a published plugin, you may need to upgrade ` +\n `your @babel/core version.`,\n );\n }\n if (ret) {\n throw new Error(`Unexpected return value from visitor method ${fn}`);\n }\n\n // node has been replaced, it will have been requeued\n if (this.node !== node) return true;\n\n // this.shouldSkip || this.shouldStop || this.removed\n if (this._traverseFlags > 0) return true;\n }\n\n return false;\n}\n\nexport function isDenylisted(this: NodePath): boolean {\n const denylist = this.opts.denylist ?? this.opts.blacklist;\n return denylist && denylist.indexOf(this.node.type) > -1;\n}\n\n// TODO: Remove in Babel 8\nexport { isDenylisted as isBlacklisted };\n\nfunction restoreContext(path: NodePath, context: TraversalContext) {\n if (path.context !== context) {\n path.context = context;\n path.state = context.state;\n path.opts = context.opts;\n }\n}\n\nexport function visit(this: NodePath): boolean {\n if (!this.node) {\n return false;\n }\n\n if (this.isDenylisted()) {\n return false;\n }\n\n if (this.opts.shouldSkip && this.opts.shouldSkip(this)) {\n return false;\n }\n\n const currentContext = this.context;\n // Note: We need to check \"this.shouldSkip\" first because\n // another visitor can set it to true. Usually .shouldSkip is false\n // before calling the enter visitor, but it can be true in case of\n // a requeued node (e.g. by .replaceWith()) that is then marked\n // with .skip().\n if (this.shouldSkip || this.call(\"enter\")) {\n this.debug(\"Skip...\");\n return this.shouldStop;\n }\n restoreContext(this, currentContext);\n\n this.debug(\"Recursing into...\");\n this.shouldStop = traverseNode(\n this.node,\n this.opts,\n this.scope,\n this.state,\n this,\n this.skipKeys,\n );\n\n restoreContext(this, currentContext);\n\n this.call(\"exit\");\n\n return this.shouldStop;\n}\n\nexport function skip(this: NodePath) {\n this.shouldSkip = true;\n}\n\nexport function skipKey(this: NodePath, key: string) {\n if (this.skipKeys == null) {\n this.skipKeys = {};\n }\n this.skipKeys[key] = true;\n}\n\nexport function stop(this: NodePath) {\n // this.shouldSkip = true; this.shouldStop = true;\n this._traverseFlags |= SHOULD_SKIP | SHOULD_STOP;\n}\n\nexport function setScope(this: NodePath) {\n if (this.opts && this.opts.noScope) return;\n\n let path = this.parentPath;\n\n if (\n // Skip method scope if is computed method key or decorator expression\n ((this.key === \"key\" || this.listKey === \"decorators\") &&\n path.isMethod()) ||\n // Skip switch scope if for discriminant (`x` in `switch (x) {}`).\n (this.key === \"discriminant\" && path.isSwitchStatement())\n ) {\n path = path.parentPath;\n }\n\n let target;\n while (path && !target) {\n if (path.opts && path.opts.noScope) return;\n\n target = path.scope;\n path = path.parentPath;\n }\n\n this.scope = this.getScope(target);\n if (this.scope) this.scope.init();\n}\n\nexport function setContext<S = unknown>(\n this: NodePath,\n context?: TraversalContext<S>,\n) {\n if (this.skipKeys != null) {\n this.skipKeys = {};\n }\n // this.shouldSkip = false; this.shouldStop = false; this.removed = false;\n this._traverseFlags = 0;\n\n if (context) {\n this.context = context;\n this.state = context.state;\n this.opts = context.opts;\n }\n\n this.setScope();\n\n return this;\n}\n\n/**\n * Here we resync the node paths `key` and `container`. If they've changed according\n * to what we have stored internally then we attempt to resync by crawling and looking\n * for the new values.\n */\n\nexport function resync(this: NodePath) {\n if (this.removed) return;\n\n this._resyncParent();\n this._resyncList();\n this._resyncKey();\n //this._resyncRemoved();\n}\n\nexport function _resyncParent(this: NodePath) {\n if (this.parentPath) {\n this.parent = this.parentPath.node;\n }\n}\n\nexport function _resyncKey(this: NodePath) {\n if (!this.container) return;\n\n if (\n this.node ===\n // @ts-expect-error this.key should present in this.container\n this.container[this.key]\n ) {\n return;\n }\n\n // grrr, path key is out of sync. this is likely due to a modification to the AST\n // not done through our path APIs\n\n if (Array.isArray(this.container)) {\n for (let i = 0; i < this.container.length; i++) {\n if (this.container[i] === this.node) {\n return this.setKey(i);\n }\n }\n } else {\n for (const key of Object.keys(this.container)) {\n // @ts-expect-error this.key should present in this.container\n if (this.container[key] === this.node) {\n return this.setKey(key);\n }\n }\n }\n\n // ¯\\_(ツ)_/¯ who knows where it's gone lol\n this.key = null;\n}\n\nexport function _resyncList(this: NodePath) {\n if (!this.parent || !this.inList) return;\n\n const newContainer =\n // @ts-expect-error this.listKey should present in this.parent\n this.parent[this.listKey];\n if (this.container === newContainer) return;\n\n // container is out of sync. this is likely the result of it being reassigned\n this.container = newContainer || null;\n}\n\nexport function _resyncRemoved(this: NodePath) {\n if (\n this.key == null ||\n !this.container ||\n // @ts-expect-error this.key should present in this.container\n this.container[this.key] !== this.node\n ) {\n this._markRemoved();\n }\n}\n\nexport function popContext(this: NodePath) {\n this.contexts.pop();\n if (this.contexts.length > 0) {\n this.setContext(this.contexts[this.contexts.length - 1]);\n } else {\n this.setContext(undefined);\n }\n}\n\nexport function pushContext(this: NodePath, context: TraversalContext) {\n this.contexts.push(context);\n this.setContext(context);\n}\n\nexport function setup(\n this: NodePath,\n parentPath: NodePath | undefined,\n container: t.Node,\n listKey: string,\n key: string | number,\n) {\n this.listKey = listKey;\n this.container = container;\n\n this.parentPath = parentPath || this.parentPath;\n this.setKey(key);\n}\n\nexport function setKey(this: NodePath, key: string | number) {\n this.key = key;\n this.node =\n // @ts-expect-error this.key must present in this.container\n this.container[this.key];\n this.type = this.node?.type;\n}\n\nexport function requeue(this: NodePath, pathToQueue = this) {\n if (pathToQueue.removed) return;\n\n // If a path is skipped, and then replaced with a\n // new one, the new one shouldn't probably be skipped.\n if (process.env.BABEL_8_BREAKING) {\n pathToQueue.shouldSkip = false;\n }\n\n // TODO(loganfsmyth): This should be switched back to queue in parent contexts\n // automatically once #2892 and #4135 have been resolved. See #4140.\n // let contexts = this._getQueueContexts();\n const contexts = this.contexts;\n\n for (const context of contexts) {\n context.maybeQueue(pathToQueue);\n }\n}\n\nexport function _getQueueContexts(this: NodePath) {\n let path = this;\n let contexts = this.contexts;\n while (!contexts.length) {\n path = path.parentPath;\n if (!path) break;\n contexts = path.contexts;\n }\n return contexts;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAEA;AACA;;AAKO,SAASA,IAAI,CAAiBC,GAAW,EAAW;EACzD,MAAMC,IAAI,GAAG,IAAI,CAACA,IAAI;EAEtB,IAAI,CAACC,KAAK,CAACF,GAAG,CAAC;EAEf,IAAI,IAAI,CAACG,IAAI,EAAE;IACb,IAAI,IAAI,CAACC,KAAK,CAACH,IAAI,CAACD,GAAG,CAAC,CAAC,EAAE,OAAO,IAAI;EACxC;EAEA,IAAI,IAAI,CAACG,IAAI,EAAE;IACb,OAAO,IAAI,CAACC,KAAK,CAACH,IAAI,CAAC,IAAI,CAACE,IAAI,CAACE,IAAI,CAAC,IAAIJ,IAAI,CAAC,IAAI,CAACE,IAAI,CAACE,IAAI,CAAC,CAACL,GAAG,CAAC,CAAC;EACtE;EAEA,OAAO,KAAK;AACd;AAEO,SAASI,KAAK,CAAiBE,GAAqB,EAAW;EACpE,IAAI,CAACA,GAAG,EAAE,OAAO,KAAK;EAEtB,KAAK,MAAMC,EAAE,IAAID,GAAG,EAAE;IACpB,IAAI,CAACC,EAAE,EAAE;IAET,MAAMJ,IAAI,GAAG,IAAI,CAACA,IAAI;IACtB,IAAI,CAACA,IAAI,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