@tinacms/app 1.1.0 → 1.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.
Files changed (136) hide show
  1. package/appFiles/node_modules/.package-lock.json +29 -28
  2. package/appFiles/node_modules/@babel/generator/lib/buffer.js +34 -10
  3. package/appFiles/node_modules/@babel/generator/lib/buffer.js.map +1 -1
  4. package/appFiles/node_modules/@babel/generator/lib/generators/classes.js +3 -4
  5. package/appFiles/node_modules/@babel/generator/lib/generators/classes.js.map +1 -1
  6. package/appFiles/node_modules/@babel/generator/lib/generators/expressions.js +7 -0
  7. package/appFiles/node_modules/@babel/generator/lib/generators/expressions.js.map +1 -1
  8. package/appFiles/node_modules/@babel/generator/lib/generators/methods.js +51 -8
  9. package/appFiles/node_modules/@babel/generator/lib/generators/methods.js.map +1 -1
  10. package/appFiles/node_modules/@babel/generator/lib/generators/modules.js +7 -10
  11. package/appFiles/node_modules/@babel/generator/lib/generators/modules.js.map +1 -1
  12. package/appFiles/node_modules/@babel/generator/lib/generators/types.js +2 -0
  13. package/appFiles/node_modules/@babel/generator/lib/generators/types.js.map +1 -1
  14. package/appFiles/node_modules/@babel/generator/lib/generators/typescript.js +2 -2
  15. package/appFiles/node_modules/@babel/generator/lib/generators/typescript.js.map +1 -1
  16. package/appFiles/node_modules/@babel/generator/lib/index.js +1 -1
  17. package/appFiles/node_modules/@babel/generator/lib/index.js.map +1 -1
  18. package/appFiles/node_modules/@babel/generator/lib/node/parentheses.js.map +1 -1
  19. package/appFiles/node_modules/@babel/generator/lib/printer.js +7 -0
  20. package/appFiles/node_modules/@babel/generator/lib/printer.js.map +1 -1
  21. package/appFiles/node_modules/@babel/generator/lib/source-map.js +40 -9
  22. package/appFiles/node_modules/@babel/generator/lib/source-map.js.map +1 -1
  23. package/appFiles/node_modules/@babel/generator/package.json +5 -5
  24. package/appFiles/node_modules/@babel/helper-function-name/lib/index.js +0 -31
  25. package/appFiles/node_modules/@babel/helper-function-name/lib/index.js.map +1 -1
  26. package/appFiles/node_modules/@babel/helper-function-name/package.json +3 -3
  27. package/appFiles/node_modules/@babel/parser/lib/index.js +1901 -1885
  28. package/appFiles/node_modules/@babel/parser/lib/index.js.map +1 -1
  29. package/appFiles/node_modules/@babel/parser/package.json +2 -2
  30. package/appFiles/node_modules/@babel/parser/typings/babel-parser.d.ts +12 -0
  31. package/appFiles/node_modules/@babel/runtime/helpers/applyDecs2203R.js +173 -170
  32. package/appFiles/node_modules/@babel/runtime/helpers/applyDecs2301.js +221 -0
  33. package/appFiles/node_modules/@babel/runtime/helpers/esm/applyDecs2203R.js +173 -170
  34. package/appFiles/node_modules/@babel/runtime/helpers/esm/applyDecs2301.js +220 -0
  35. package/appFiles/node_modules/@babel/runtime/package.json +10 -1
  36. package/appFiles/node_modules/@babel/traverse/lib/path/modification.js.map +1 -1
  37. package/appFiles/node_modules/@babel/traverse/lib/visitors.js +11 -5
  38. package/appFiles/node_modules/@babel/traverse/lib/visitors.js.map +1 -1
  39. package/appFiles/node_modules/@babel/traverse/package.json +5 -5
  40. package/appFiles/node_modules/@babel/types/lib/asserts/generated/index.js +12 -7
  41. package/appFiles/node_modules/@babel/types/lib/asserts/generated/index.js.map +1 -1
  42. package/appFiles/node_modules/@babel/types/lib/ast-types/generated/index.js.map +1 -1
  43. package/appFiles/node_modules/@babel/types/lib/builders/generated/index.js +5 -5
  44. package/appFiles/node_modules/@babel/types/lib/builders/generated/index.js.map +1 -1
  45. package/appFiles/node_modules/@babel/types/lib/clone/cloneNode.js +2 -6
  46. package/appFiles/node_modules/@babel/types/lib/clone/cloneNode.js.map +1 -1
  47. package/appFiles/node_modules/@babel/types/lib/constants/generated/index.js +5 -4
  48. package/appFiles/node_modules/@babel/types/lib/constants/generated/index.js.map +1 -1
  49. package/appFiles/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js +0 -3
  50. package/appFiles/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js.map +1 -1
  51. package/appFiles/node_modules/@babel/types/lib/converters/toComputedKey.js +1 -2
  52. package/appFiles/node_modules/@babel/types/lib/converters/toComputedKey.js.map +1 -1
  53. package/appFiles/node_modules/@babel/types/lib/converters/toExpression.js +0 -3
  54. package/appFiles/node_modules/@babel/types/lib/converters/toExpression.js.map +1 -1
  55. package/appFiles/node_modules/@babel/types/lib/converters/toIdentifier.js +0 -3
  56. package/appFiles/node_modules/@babel/types/lib/converters/toIdentifier.js.map +1 -1
  57. package/appFiles/node_modules/@babel/types/lib/converters/toKeyAlias.js +0 -3
  58. package/appFiles/node_modules/@babel/types/lib/converters/toKeyAlias.js.map +1 -1
  59. package/appFiles/node_modules/@babel/types/lib/converters/toSequenceExpression.js +0 -1
  60. package/appFiles/node_modules/@babel/types/lib/converters/toSequenceExpression.js.map +1 -1
  61. package/appFiles/node_modules/@babel/types/lib/converters/toStatement.js +0 -3
  62. package/appFiles/node_modules/@babel/types/lib/converters/toStatement.js.map +1 -1
  63. package/appFiles/node_modules/@babel/types/lib/converters/valueToNode.js +1 -9
  64. package/appFiles/node_modules/@babel/types/lib/converters/valueToNode.js.map +1 -1
  65. package/appFiles/node_modules/@babel/types/lib/definitions/core.js +21 -57
  66. package/appFiles/node_modules/@babel/types/lib/definitions/core.js.map +1 -1
  67. package/appFiles/node_modules/@babel/types/lib/definitions/deprecated-aliases.js +12 -0
  68. package/appFiles/node_modules/@babel/types/lib/definitions/deprecated-aliases.js.map +1 -0
  69. package/appFiles/node_modules/@babel/types/lib/definitions/experimental.js +0 -3
  70. package/appFiles/node_modules/@babel/types/lib/definitions/experimental.js.map +1 -1
  71. package/appFiles/node_modules/@babel/types/lib/definitions/flow.js +0 -1
  72. package/appFiles/node_modules/@babel/types/lib/definitions/flow.js.map +1 -1
  73. package/appFiles/node_modules/@babel/types/lib/definitions/index.js +10 -0
  74. package/appFiles/node_modules/@babel/types/lib/definitions/index.js.map +1 -1
  75. package/appFiles/node_modules/@babel/types/lib/definitions/typescript.js +6 -4
  76. package/appFiles/node_modules/@babel/types/lib/definitions/typescript.js.map +1 -1
  77. package/appFiles/node_modules/@babel/types/lib/definitions/utils.js +0 -2
  78. package/appFiles/node_modules/@babel/types/lib/definitions/utils.js.map +1 -1
  79. package/appFiles/node_modules/@babel/types/lib/index-legacy.d.ts +10 -3
  80. package/appFiles/node_modules/@babel/types/lib/index.d.ts +23 -6
  81. package/appFiles/node_modules/@babel/types/lib/index.js +9 -2
  82. package/appFiles/node_modules/@babel/types/lib/index.js.flow +8 -3
  83. package/appFiles/node_modules/@babel/types/lib/index.js.map +1 -1
  84. package/appFiles/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js +1 -9
  85. package/appFiles/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js.map +1 -1
  86. package/appFiles/node_modules/@babel/types/lib/modifications/inherits.js +0 -3
  87. package/appFiles/node_modules/@babel/types/lib/modifications/inherits.js.map +1 -1
  88. package/appFiles/node_modules/@babel/types/lib/modifications/removeProperties.js +1 -3
  89. package/appFiles/node_modules/@babel/types/lib/modifications/removeProperties.js.map +1 -1
  90. package/appFiles/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js +0 -8
  91. package/appFiles/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js.map +1 -1
  92. package/appFiles/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js +2 -6
  93. package/appFiles/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js.map +1 -1
  94. package/appFiles/node_modules/@babel/types/lib/traverse/traverseFast.js +1 -2
  95. package/appFiles/node_modules/@babel/types/lib/traverse/traverseFast.js.map +1 -1
  96. package/appFiles/node_modules/@babel/types/lib/utils/deprecationWarning.js +30 -0
  97. package/appFiles/node_modules/@babel/types/lib/utils/deprecationWarning.js.map +1 -0
  98. package/appFiles/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js +0 -3
  99. package/appFiles/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js.map +1 -1
  100. package/appFiles/node_modules/@babel/types/lib/utils/shallowEqual.js +1 -2
  101. package/appFiles/node_modules/@babel/types/lib/utils/shallowEqual.js.map +1 -1
  102. package/appFiles/node_modules/@babel/types/lib/validators/generated/index.js +11 -6
  103. package/appFiles/node_modules/@babel/types/lib/validators/generated/index.js.map +1 -1
  104. package/appFiles/node_modules/@babel/types/lib/validators/isBinding.js +2 -4
  105. package/appFiles/node_modules/@babel/types/lib/validators/isBinding.js.map +1 -1
  106. package/appFiles/node_modules/@babel/types/lib/validators/isLet.js +1 -2
  107. package/appFiles/node_modules/@babel/types/lib/validators/isLet.js.map +1 -1
  108. package/appFiles/node_modules/@babel/types/lib/validators/isNodesEquivalent.js +1 -2
  109. package/appFiles/node_modules/@babel/types/lib/validators/isNodesEquivalent.js.map +1 -1
  110. package/appFiles/node_modules/@babel/types/lib/validators/isReferenced.js +0 -21
  111. package/appFiles/node_modules/@babel/types/lib/validators/isReferenced.js.map +1 -1
  112. package/appFiles/node_modules/@babel/types/lib/validators/isScope.js +0 -1
  113. package/appFiles/node_modules/@babel/types/lib/validators/isScope.js.map +1 -1
  114. package/appFiles/node_modules/@babel/types/lib/validators/isSpecifierDefault.js +1 -2
  115. package/appFiles/node_modules/@babel/types/lib/validators/isSpecifierDefault.js.map +1 -1
  116. package/appFiles/node_modules/@babel/types/lib/validators/isType.js +0 -1
  117. package/appFiles/node_modules/@babel/types/lib/validators/isType.js.map +1 -1
  118. package/appFiles/node_modules/@babel/types/lib/validators/isValidES3Identifier.js +0 -1
  119. package/appFiles/node_modules/@babel/types/lib/validators/isValidES3Identifier.js.map +1 -1
  120. package/appFiles/node_modules/@babel/types/lib/validators/isVar.js +1 -2
  121. package/appFiles/node_modules/@babel/types/lib/validators/isVar.js.map +1 -1
  122. package/appFiles/node_modules/@babel/types/package.json +3 -3
  123. package/appFiles/node_modules/css-to-react-native/index.d.ts +17 -0
  124. package/appFiles/node_modules/css-to-react-native/index.js +15 -0
  125. package/appFiles/node_modules/css-to-react-native/package.json +2 -1
  126. package/appFiles/node_modules/css-to-react-native/src/__tests__/aspectRatio.js +23 -0
  127. package/appFiles/node_modules/css-to-react-native/src/transforms/aspectRatio.js +12 -0
  128. package/appFiles/node_modules/css-to-react-native/src/transforms/index.js +2 -0
  129. package/appFiles/src/App.tsx +3 -5
  130. package/appFiles/src/fields/rich-text/monaco/error-message.tsx +1 -1
  131. package/appFiles/src/fields/rich-text/monaco/mdx.js +13517 -8946
  132. package/appFiles/src/lib/machines/document-machine.ts +4 -9
  133. package/appFiles/src/lib/machines/query-machine.ts +0 -13
  134. package/appFiles/src/preview.tsx +23 -0
  135. package/dist/index.js +3 -1
  136. package/package.json +5 -5
@@ -19,7 +19,6 @@ function cloneIfNodeOrArray(obj, deep, withoutLoc, commentsCache) {
19
19
  }
20
20
  return cloneIfNode(obj, deep, withoutLoc, commentsCache);
21
21
  }
22
-
23
22
  function cloneNode(node, deep = true, withoutLoc = false) {
24
23
  return cloneNodeInternal(node, deep, withoutLoc, new Map());
25
24
  }
@@ -31,7 +30,6 @@ function cloneNodeInternal(node, deep = true, withoutLoc = false, commentsCache)
31
30
  const newNode = {
32
31
  type: node.type
33
32
  };
34
-
35
33
  if ((0, _generated.isIdentifier)(node)) {
36
34
  newNode.name = node.name;
37
35
  if (has(node, "optional") && typeof node.optional === "boolean") {
@@ -46,11 +44,9 @@ function cloneNodeInternal(node, deep = true, withoutLoc = false, commentsCache)
46
44
  for (const field of Object.keys(_definitions.NODE_FIELDS[type])) {
47
45
  if (has(node, field)) {
48
46
  if (deep) {
49
- newNode[field] = (0, _generated.isFile)(node) && field === "comments" ? maybeCloneComments(node.comments, deep, withoutLoc, commentsCache) : cloneIfNodeOrArray(
50
- node[field], true, withoutLoc, commentsCache);
47
+ newNode[field] = (0, _generated.isFile)(node) && field === "comments" ? maybeCloneComments(node.comments, deep, withoutLoc, commentsCache) : cloneIfNodeOrArray(node[field], true, withoutLoc, commentsCache);
51
48
  } else {
52
- newNode[field] =
53
- node[field];
49
+ newNode[field] = node[field];
54
50
  }
55
51
  }
56
52
  }
@@ -1 +1 @@
1
- {"version":3,"names":["has","Function","call","bind","Object","prototype","hasOwnProperty","cloneIfNode","obj","deep","withoutLoc","commentsCache","type","cloneNodeInternal","cloneIfNodeOrArray","Array","isArray","map","node","cloneNode","Map","newNode","isIdentifier","name","optional","typeAnnotation","NODE_FIELDS","Error","field","keys","isFile","maybeCloneComments","comments","loc","leadingComments","innerComments","trailingComments","extra","comment","cache","get","value","ret","set"],"sources":["../../src/clone/cloneNode.ts"],"sourcesContent":["import { NODE_FIELDS } from \"../definitions\";\nimport type * as t from \"..\";\nimport { isFile, isIdentifier } from \"../validators/generated\";\n\nconst has = Function.call.bind(Object.prototype.hasOwnProperty);\n\ntype CommentCache = Map<t.Comment, t.Comment>;\n\n// This function will never be called for comments, only for real nodes.\nfunction cloneIfNode(\n obj: t.Node | undefined | null,\n deep: boolean,\n withoutLoc: boolean,\n commentsCache: CommentCache,\n) {\n if (obj && typeof obj.type === \"string\") {\n return cloneNodeInternal(obj, deep, withoutLoc, commentsCache);\n }\n\n return obj;\n}\n\nfunction cloneIfNodeOrArray(\n obj: t.Node | undefined | null | (t.Node | undefined | null)[],\n deep: boolean,\n withoutLoc: boolean,\n commentsCache: CommentCache,\n) {\n if (Array.isArray(obj)) {\n return obj.map(node => cloneIfNode(node, deep, withoutLoc, commentsCache));\n }\n return cloneIfNode(obj, deep, withoutLoc, commentsCache);\n}\n\n/**\n * Create a clone of a `node` including only properties belonging to the node.\n * If the second parameter is `false`, cloneNode performs a shallow clone.\n * If the third parameter is true, the cloned nodes exclude location properties.\n */\nexport default function cloneNode<T extends t.Node>(\n node: T,\n deep: boolean = true,\n withoutLoc: boolean = false,\n): T {\n return cloneNodeInternal(node, deep, withoutLoc, new Map());\n}\n\nfunction cloneNodeInternal<T extends t.Node>(\n node: T,\n deep: boolean = true,\n withoutLoc: boolean = false,\n commentsCache: CommentCache,\n): T {\n if (!node) return node;\n\n const { type } = node;\n const newNode: any = { type: node.type };\n\n // Special-case identifiers since they are the most cloned nodes.\n if (isIdentifier(node)) {\n newNode.name = node.name;\n\n if (has(node, \"optional\") && typeof node.optional === \"boolean\") {\n newNode.optional = node.optional;\n }\n\n if (has(node, \"typeAnnotation\")) {\n newNode.typeAnnotation = deep\n ? cloneIfNodeOrArray(\n node.typeAnnotation,\n true,\n withoutLoc,\n commentsCache,\n )\n : node.typeAnnotation;\n }\n } else if (!has(NODE_FIELDS, type)) {\n throw new Error(`Unknown node type: \"${type}\"`);\n } else {\n for (const field of Object.keys(NODE_FIELDS[type])) {\n if (has(node, field)) {\n if (deep) {\n newNode[field] =\n isFile(node) && field === \"comments\"\n ? maybeCloneComments(\n node.comments,\n deep,\n withoutLoc,\n commentsCache,\n )\n : cloneIfNodeOrArray(\n // @ts-expect-error node[field] has been guarded by has check\n node[field],\n true,\n withoutLoc,\n commentsCache,\n );\n } else {\n newNode[field] =\n // @ts-expect-error node[field] has been guarded by has check\n node[field];\n }\n }\n }\n }\n\n if (has(node, \"loc\")) {\n if (withoutLoc) {\n newNode.loc = null;\n } else {\n newNode.loc = node.loc;\n }\n }\n if (has(node, \"leadingComments\")) {\n newNode.leadingComments = maybeCloneComments(\n node.leadingComments,\n deep,\n withoutLoc,\n commentsCache,\n );\n }\n if (has(node, \"innerComments\")) {\n newNode.innerComments = maybeCloneComments(\n node.innerComments,\n deep,\n withoutLoc,\n commentsCache,\n );\n }\n if (has(node, \"trailingComments\")) {\n newNode.trailingComments = maybeCloneComments(\n node.trailingComments,\n deep,\n withoutLoc,\n commentsCache,\n );\n }\n if (has(node, \"extra\")) {\n newNode.extra = {\n ...node.extra,\n };\n }\n\n return newNode;\n}\n\nfunction maybeCloneComments<T extends t.Comment>(\n comments: ReadonlyArray<T> | null,\n deep: boolean,\n withoutLoc: boolean,\n commentsCache: Map<T, T>,\n): ReadonlyArray<T> | null {\n if (!comments || !deep) {\n return comments;\n }\n return comments.map(comment => {\n const cache = commentsCache.get(comment);\n if (cache) return cache;\n\n const { type, value, loc } = comment;\n\n const ret = { type, value, loc } as T;\n if (withoutLoc) {\n ret.loc = null;\n }\n\n commentsCache.set(comment, ret);\n\n return ret;\n });\n}\n"],"mappings":";;;;;;AAAA;AAEA;AAEA,MAAMA,GAAG,GAAGC,QAAQ,CAACC,IAAI,CAACC,IAAI,CAACC,MAAM,CAACC,SAAS,CAACC,cAAc,CAAC;AAK/D,SAASC,WAAW,CAClBC,GAA8B,EAC9BC,IAAa,EACbC,UAAmB,EACnBC,aAA2B,EAC3B;EACA,IAAIH,GAAG,IAAI,OAAOA,GAAG,CAACI,IAAI,KAAK,QAAQ,EAAE;IACvC,OAAOC,iBAAiB,CAACL,GAAG,EAAEC,IAAI,EAAEC,UAAU,EAAEC,aAAa,CAAC;EAChE;EAEA,OAAOH,GAAG;AACZ;AAEA,SAASM,kBAAkB,CACzBN,GAA8D,EAC9DC,IAAa,EACbC,UAAmB,EACnBC,aAA2B,EAC3B;EACA,IAAII,KAAK,CAACC,OAAO,CAACR,GAAG,CAAC,EAAE;IACtB,OAAOA,GAAG,CAACS,GAAG,CAACC,IAAI,IAAIX,WAAW,CAACW,IAAI,EAAET,IAAI,EAAEC,UAAU,EAAEC,aAAa,CAAC,CAAC;EAC5E;EACA,OAAOJ,WAAW,CAACC,GAAG,EAAEC,IAAI,EAAEC,UAAU,EAAEC,aAAa,CAAC;AAC1D;;AAOe,SAASQ,SAAS,CAC/BD,IAAO,EACPT,IAAa,GAAG,IAAI,EACpBC,UAAmB,GAAG,KAAK,EACxB;EACH,OAAOG,iBAAiB,CAACK,IAAI,EAAET,IAAI,EAAEC,UAAU,EAAE,IAAIU,GAAG,EAAE,CAAC;AAC7D;AAEA,SAASP,iBAAiB,CACxBK,IAAO,EACPT,IAAa,GAAG,IAAI,EACpBC,UAAmB,GAAG,KAAK,EAC3BC,aAA2B,EACxB;EACH,IAAI,CAACO,IAAI,EAAE,OAAOA,IAAI;EAEtB,MAAM;IAAEN;EAAK,CAAC,GAAGM,IA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,IAAI;MAAE6B,KAAK;MAAER;IAAI,CAAC,GAAGK,OAAO;IAEpC,MAAMI,GAAG,GAAG;MAAE9B,IAAI;MAAE6B,KAAK;MAAER;IAAI,CAAM;IACrC,IAAIvB,UAAU,EAAE;MACdgC,GAAG,CAACT,GAAG,GAAG,IAAI;IAChB;IAEAtB,aAAa,CAACgC,GAAG,CAACL,OAAO,EAAEI,GAAG,CAAC;IAE/B,OAAOA,GAAG;EACZ,CAAC,CAAC;AACJ"}
1
+ {"version":3,"names":["has","Function","call","bind","Object","prototype","hasOwnProperty","cloneIfNode","obj","deep","withoutLoc","commentsCache","type","cloneNodeInternal","cloneIfNodeOrArray","Array","isArray","map","node","cloneNode","Map","newNode","isIdentifier","name","optional","typeAnnotation","NODE_FIELDS","Error","field","keys","isFile","maybeCloneComments","comments","loc","leadingComments","innerComments","trailingComments","extra","comment","cache","get","value","ret","set"],"sources":["../../src/clone/cloneNode.ts"],"sourcesContent":["import { NODE_FIELDS } from \"../definitions\";\nimport type * as t from \"..\";\nimport { isFile, isIdentifier } from \"../validators/generated\";\n\nconst has = Function.call.bind(Object.prototype.hasOwnProperty);\n\ntype CommentCache = Map<t.Comment, t.Comment>;\n\n// This function will never be called for comments, only for real nodes.\nfunction cloneIfNode(\n obj: t.Node | undefined | null,\n deep: boolean,\n withoutLoc: boolean,\n commentsCache: CommentCache,\n) {\n if (obj && typeof obj.type === \"string\") {\n return cloneNodeInternal(obj, deep, withoutLoc, commentsCache);\n }\n\n return obj;\n}\n\nfunction cloneIfNodeOrArray(\n obj: t.Node | undefined | null | (t.Node | undefined | null)[],\n deep: boolean,\n withoutLoc: boolean,\n commentsCache: CommentCache,\n) {\n if (Array.isArray(obj)) {\n return obj.map(node => cloneIfNode(node, deep, withoutLoc, commentsCache));\n }\n return cloneIfNode(obj, deep, withoutLoc, commentsCache);\n}\n\n/**\n * Create a clone of a `node` including only properties belonging to the node.\n * If the second parameter is `false`, cloneNode performs a shallow clone.\n * If the third parameter is true, the cloned nodes exclude location properties.\n */\nexport default function cloneNode<T extends t.Node>(\n node: T,\n deep: boolean = true,\n withoutLoc: boolean = false,\n): T {\n return cloneNodeInternal(node, deep, withoutLoc, new Map());\n}\n\nfunction cloneNodeInternal<T extends t.Node>(\n node: T,\n deep: boolean = true,\n withoutLoc: boolean = false,\n commentsCache: CommentCache,\n): T {\n if (!node) return node;\n\n const { type } = node;\n const newNode: any = { type: node.type };\n\n // Special-case identifiers since they are the most cloned nodes.\n if (isIdentifier(node)) {\n newNode.name = node.name;\n\n if (has(node, \"optional\") && typeof node.optional === \"boolean\") {\n newNode.optional = node.optional;\n }\n\n if (has(node, \"typeAnnotation\")) {\n newNode.typeAnnotation = deep\n ? cloneIfNodeOrArray(\n node.typeAnnotation,\n true,\n withoutLoc,\n commentsCache,\n )\n : node.typeAnnotation;\n }\n } else if (!has(NODE_FIELDS, type)) {\n throw new Error(`Unknown node type: \"${type}\"`);\n } else {\n for (const field of Object.keys(NODE_FIELDS[type])) {\n if (has(node, field)) {\n if (deep) {\n newNode[field] =\n isFile(node) && field === \"comments\"\n ? maybeCloneComments(\n node.comments,\n deep,\n withoutLoc,\n commentsCache,\n )\n : cloneIfNodeOrArray(\n // @ts-expect-error node[field] has been guarded by has check\n node[field],\n true,\n withoutLoc,\n commentsCache,\n );\n } else {\n newNode[field] =\n // @ts-expect-error node[field] has been guarded by has check\n node[field];\n }\n }\n }\n }\n\n if (has(node, \"loc\")) {\n if (withoutLoc) {\n newNode.loc = null;\n } else {\n newNode.loc = node.loc;\n }\n }\n if (has(node, \"leadingComments\")) {\n newNode.leadingComments = maybeCloneComments(\n node.leadingComments,\n deep,\n withoutLoc,\n commentsCache,\n );\n }\n if (has(node, \"innerComments\")) {\n newNode.innerComments = maybeCloneComments(\n node.innerComments,\n deep,\n withoutLoc,\n commentsCache,\n );\n }\n if (has(node, \"trailingComments\")) {\n newNode.trailingComments = maybeCloneComments(\n node.trailingComments,\n deep,\n withoutLoc,\n commentsCache,\n );\n }\n if (has(node, \"extra\")) {\n newNode.extra = {\n ...node.extra,\n };\n }\n\n return newNode;\n}\n\nfunction maybeCloneComments<T extends t.Comment>(\n comments: ReadonlyArray<T> | null,\n deep: boolean,\n withoutLoc: boolean,\n commentsCache: Map<T, T>,\n): ReadonlyArray<T> | null {\n if (!comments || !deep) {\n return comments;\n }\n return comments.map(comment => {\n const cache = commentsCache.get(comment);\n if (cache) return cache;\n\n const { type, value, loc } = comment;\n\n const ret = { type, value, loc } as T;\n if (withoutLoc) {\n ret.loc = null;\n }\n\n commentsCache.set(comment, ret);\n\n return ret;\n });\n}\n"],"mappings":";;;;;;AAAA;AAEA;AAEA,MAAMA,GAAG,GAAGC,QAAQ,CAACC,IAAI,CAACC,IAAI,CAACC,MAAM,CAACC,SAAS,CAACC,cAAc,CAAC;AAK/D,SAASC,WAAW,CAClBC,GAA8B,EAC9BC,IAAa,EACbC,UAAmB,EACnBC,aAA2B,EAC3B;EACA,IAAIH,GAAG,IAAI,OAAOA,GAAG,CAACI,IAAI,KAAK,QAAQ,EAAE;IACvC,OAAOC,iBAAiB,CAACL,GAAG,EAAEC,IAAI,EAAEC,UAAU,EAAEC,aAAa,CAAC;EAChE;EAEA,OAAOH,GAAG;AACZ;AAEA,SAASM,kBAAkB,CACzBN,GAA8D,EAC9DC,IAAa,EACbC,UAAmB,EACnBC,aAA2B,EAC3B;EACA,IAAII,KAAK,CAACC,OAAO,CAACR,GAAG,CAAC,EAAE;IACtB,OAAOA,GAAG,CAACS,GAAG,CAACC,IAAI,IAAIX,WAAW,CAACW,IAAI,EAAET,IAAI,EAAEC,UAAU,EAAEC,aAAa,CAAC,CAAC;EAC5E;EACA,OAAOJ,WAAW,CAACC,GAAG,EAAEC,IAAI,EAAEC,UAAU,EAAEC,aAAa,CAAC;AAC1D;AAOe,SAASQ,SAAS,CAC/BD,IAAO,EACPT,IAAa,GAAG,IAAI,EACpBC,UAAmB,GAAG,KAAK,EACxB;EACH,OAAOG,iBAAiB,CAACK,IAAI,EAAET,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I,CAACqB,QAAQ,IAAI,CAACvB,IAAI,EAAE;IACtB,OAAOuB,QAAQ;EACjB;EACA,OAAOA,QAAQ,CAACf,GAAG,CAACqB,OAAO,IAAI;IAC7B,MAAMC,KAAK,GAAG5B,aAAa,CAAC6B,GAAG,CAACF,OAAO,CAAC;IACxC,IAAIC,KAAK,EAAE,OAAOA,KAAK;IAEvB,MAAM;MAAE3B,IAAI;MAAE6B,KAAK;MAAER;IAAI,CAAC,GAAGK,OAAO;IAEpC,MAAMI,GAAG,GAAG;MAAE9B,IAAI;MAAE6B,KAAK;MAAER;IAAI,CAAM;IACrC,IAAIvB,UAAU,EAAE;MACdgC,GAAG,CAACT,GAAG,GAAG,IAAI;IAChB;IAEAtB,aAAa,CAACgC,GAAG,CAACL,OAAO,EAAEI,GAAG,CAAC;IAE/B,OAAOA,GAAG;EACZ,CAAC,CAAC;AACJ"}
@@ -3,9 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.WHILE_TYPES = exports.USERWHITESPACABLE_TYPES = exports.UNARYLIKE_TYPES = exports.TYPESCRIPT_TYPES = exports.TSTYPE_TYPES = exports.TSTYPEELEMENT_TYPES = exports.TSENTITYNAME_TYPES = exports.TSBASETYPE_TYPES = exports.TERMINATORLESS_TYPES = exports.STATEMENT_TYPES = exports.STANDARDIZED_TYPES = exports.SCOPABLE_TYPES = exports.PUREISH_TYPES = exports.PROPERTY_TYPES = exports.PRIVATE_TYPES = exports.PATTERN_TYPES = exports.PATTERNLIKE_TYPES = exports.OBJECTMEMBER_TYPES = exports.MODULESPECIFIER_TYPES = exports.MODULEDECLARATION_TYPES = exports.MISCELLANEOUS_TYPES = exports.METHOD_TYPES = exports.LVAL_TYPES = exports.LOOP_TYPES = exports.LITERAL_TYPES = exports.JSX_TYPES = exports.IMMUTABLE_TYPES = exports.FUNCTION_TYPES = exports.FUNCTIONPARENT_TYPES = exports.FOR_TYPES = exports.FORXSTATEMENT_TYPES = exports.FLOW_TYPES = exports.FLOWTYPE_TYPES = exports.FLOWPREDICATE_TYPES = exports.FLOWDECLARATION_TYPES = exports.FLOWBASEANNOTATION_TYPES = exports.EXPRESSION_TYPES = exports.EXPRESSIONWRAPPER_TYPES = exports.EXPORTDECLARATION_TYPES = exports.ENUMMEMBER_TYPES = exports.ENUMBODY_TYPES = exports.DECLARATION_TYPES = exports.CONDITIONAL_TYPES = exports.COMPLETIONSTATEMENT_TYPES = exports.CLASS_TYPES = exports.BLOCK_TYPES = exports.BLOCKPARENT_TYPES = exports.BINARY_TYPES = exports.ACCESSOR_TYPES = void 0;
6
+ exports.WHILE_TYPES = exports.USERWHITESPACABLE_TYPES = exports.UNARYLIKE_TYPES = exports.TYPESCRIPT_TYPES = exports.TSTYPE_TYPES = exports.TSTYPEELEMENT_TYPES = exports.TSENTITYNAME_TYPES = exports.TSBASETYPE_TYPES = exports.TERMINATORLESS_TYPES = exports.STATEMENT_TYPES = exports.STANDARDIZED_TYPES = exports.SCOPABLE_TYPES = exports.PUREISH_TYPES = exports.PROPERTY_TYPES = exports.PRIVATE_TYPES = exports.PATTERN_TYPES = exports.PATTERNLIKE_TYPES = exports.OBJECTMEMBER_TYPES = exports.MODULESPECIFIER_TYPES = exports.MODULEDECLARATION_TYPES = exports.MISCELLANEOUS_TYPES = exports.METHOD_TYPES = exports.LVAL_TYPES = exports.LOOP_TYPES = exports.LITERAL_TYPES = exports.JSX_TYPES = exports.IMPORTOREXPORTDECLARATION_TYPES = exports.IMMUTABLE_TYPES = exports.FUNCTION_TYPES = exports.FUNCTIONPARENT_TYPES = exports.FOR_TYPES = exports.FORXSTATEMENT_TYPES = exports.FLOW_TYPES = exports.FLOWTYPE_TYPES = exports.FLOWPREDICATE_TYPES = exports.FLOWDECLARATION_TYPES = exports.FLOWBASEANNOTATION_TYPES = exports.EXPRESSION_TYPES = exports.EXPRESSIONWRAPPER_TYPES = exports.EXPORTDECLARATION_TYPES = exports.ENUMMEMBER_TYPES = exports.ENUMBODY_TYPES = exports.DECLARATION_TYPES = exports.CONDITIONAL_TYPES = exports.COMPLETIONSTATEMENT_TYPES = exports.CLASS_TYPES = exports.BLOCK_TYPES = exports.BLOCKPARENT_TYPES = exports.BINARY_TYPES = exports.ACCESSOR_TYPES = void 0;
7
7
  var _definitions = require("../../definitions");
8
-
9
8
  const STANDARDIZED_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Standardized"];
10
9
  exports.STANDARDIZED_TYPES = STANDARDIZED_TYPES;
11
10
  const EXPRESSION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Expression"];
@@ -68,8 +67,8 @@ const PATTERN_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Pattern"];
68
67
  exports.PATTERN_TYPES = PATTERN_TYPES;
69
68
  const CLASS_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Class"];
70
69
  exports.CLASS_TYPES = CLASS_TYPES;
71
- const MODULEDECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ModuleDeclaration"];
72
- exports.MODULEDECLARATION_TYPES = MODULEDECLARATION_TYPES;
70
+ const IMPORTOREXPORTDECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ImportOrExportDeclaration"];
71
+ exports.IMPORTOREXPORTDECLARATION_TYPES = IMPORTOREXPORTDECLARATION_TYPES;
73
72
  const EXPORTDECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ExportDeclaration"];
74
73
  exports.EXPORTDECLARATION_TYPES = EXPORTDECLARATION_TYPES;
75
74
  const MODULESPECIFIER_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ModuleSpecifier"];
@@ -104,5 +103,7 @@ const TSTYPE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["TSType"];
104
103
  exports.TSTYPE_TYPES = TSTYPE_TYPES;
105
104
  const TSBASETYPE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["TSBaseType"];
106
105
  exports.TSBASETYPE_TYPES = TSBASETYPE_TYPES;
106
+ const MODULEDECLARATION_TYPES = IMPORTOREXPORTDECLARATION_TYPES;
107
+ exports.MODULEDECLARATION_TYPES = MODULEDECLARATION_TYPES;
107
108
 
108
109
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["STANDARDIZED_TYPES","FLIPPED_ALIAS_KEYS","EXPRESSION_TYPES","BINARY_TYPES","SCOPABLE_TYPES","BLOCKPARENT_TYPES","BLOCK_TYPES","STATEMENT_TYPES","TERMINATORLESS_TYPES","COMPLETIONSTATEMENT_TYPES","CONDITIONAL_TYPES","LOOP_TYPES","WHILE_TYPES","EXPRESSIONWRAPPER_TYPES","FOR_TYPES","FORXSTATEMENT_TYPES","FUNCTION_TYPES","FUNCTIONPARENT_TYPES","PUREISH_TYPES","DECLARATION_TYPES","PATTERNLIKE_TYPES","LVAL_TYPES","TSENTITYNAME_TYPES","LITERAL_TYPES","IMMUTABLE_TYPES","USERWHITESPACABLE_TYPES","METHOD_TYPES","OBJECTMEMBER_TYPES","PROPERTY_TYPES","UNARYLIKE_TYPES","PATTERN_TYPES","CLASS_TYPES","MODULEDECLARATION_TYPES","EXPORTDECLARATION_TYPES","MODULESPECIFIER_TYPES","ACCESSOR_TYPES","PRIVATE_TYPES","FLOW_TYPES","FLOWTYPE_TYPES","FLOWBASEANNOTATION_TYPES","FLOWDECLARATION_TYPES","FLOWPREDICATE_TYPES","ENUMBODY_TYPES","ENUMMEMBER_TYPES","JSX_TYPES","MISCELLANEOUS_TYPES","TYPESCRIPT_TYPES","TSTYPEELEMENT_TYPES","TSTYPE_TYPES","TSBASETYPE_TYPES"],"sources":["../../../src/constants/generated/index.ts"],"sourcesContent":["/*\n * This file is auto-generated! Do not modify it directly.\n * To re-generate run 'make build'\n */\nimport { FLIPPED_ALIAS_KEYS } from \"../../definitions\";\n\nexport const STANDARDIZED_TYPES = FLIPPED_ALIAS_KEYS[\"Standardized\"];\nexport const EXPRESSION_TYPES = FLIPPED_ALIAS_KEYS[\"Expression\"];\nexport const BINARY_TYPES = FLIPPED_ALIAS_KEYS[\"Binary\"];\nexport const SCOPABLE_TYPES = FLIPPED_ALIAS_KEYS[\"Scopable\"];\nexport const BLOCKPARENT_TYPES = FLIPPED_ALIAS_KEYS[\"BlockParent\"];\nexport const BLOCK_TYPES = FLIPPED_ALIAS_KEYS[\"Block\"];\nexport const STATEMENT_TYPES = FLIPPED_ALIAS_KEYS[\"Statement\"];\nexport const TERMINATORLESS_TYPES = FLIPPED_ALIAS_KEYS[\"Terminatorless\"];\nexport const COMPLETIONSTATEMENT_TYPES =\n FLIPPED_ALIAS_KEYS[\"CompletionStatement\"];\nexport const CONDITIONAL_TYPES = FLIPPED_ALIAS_KEYS[\"Conditional\"];\nexport const LOOP_TYPES = FLIPPED_ALIAS_KEYS[\"Loop\"];\nexport const WHILE_TYPES = FLIPPED_ALIAS_KEYS[\"While\"];\nexport const EXPRESSIONWRAPPER_TYPES = FLIPPED_ALIAS_KEYS[\"ExpressionWrapper\"];\nexport const FOR_TYPES = FLIPPED_ALIAS_KEYS[\"For\"];\nexport const FORXSTATEMENT_TYPES = FLIPPED_ALIAS_KEYS[\"ForXStatement\"];\nexport const FUNCTION_TYPES = FLIPPED_ALIAS_KEYS[\"Function\"];\nexport const FUNCTIONPARENT_TYPES = FLIPPED_ALIAS_KEYS[\"FunctionParent\"];\nexport const PUREISH_TYPES = FLIPPED_ALIAS_KEYS[\"Pureish\"];\nexport const DECLARATION_TYPES = FLIPPED_ALIAS_KEYS[\"Declaration\"];\nexport const PATTERNLIKE_TYPES = FLIPPED_ALIAS_KEYS[\"PatternLike\"];\nexport const LVAL_TYPES = FLIPPED_ALIAS_KEYS[\"LVal\"];\nexport const TSENTITYNAME_TYPES = FLIPPED_ALIAS_KEYS[\"TSEntityName\"];\nexport const LITERAL_TYPES = FLIPPED_ALIAS_KEYS[\"Literal\"];\nexport const IMMUTABLE_TYPES = FLIPPED_ALIAS_KEYS[\"Immutable\"];\nexport const USERWHITESPACABLE_TYPES = FLIPPED_ALIAS_KEYS[\"UserWhitespacable\"];\nexport const METHOD_TYPES = FLIPPED_ALIAS_KEYS[\"Method\"];\nexport const OBJECTMEMBER_TYPES = FLIPPED_ALIAS_KEYS[\"ObjectMember\"];\nexport const PROPERTY_TYPES = FLIPPED_ALIAS_KEYS[\"Property\"];\nexport const UNARYLIKE_TYPES = FLIPPED_ALIAS_KEYS[\"UnaryLike\"];\nexport const PATTERN_TYPES = FLIPPED_ALIAS_KEYS[\"Pattern\"];\nexport const CLASS_TYPES = FLIPPED_ALIAS_KEYS[\"Class\"];\nexport const MODULEDECLARATION_TYPES = FLIPPED_ALIAS_KEYS[\"ModuleDeclaration\"];\nexport const EXPORTDECLARATION_TYPES = FLIPPED_ALIAS_KEYS[\"ExportDeclaration\"];\nexport const MODULESPECIFIER_TYPES = FLIPPED_ALIAS_KEYS[\"ModuleSpecifier\"];\nexport const ACCESSOR_TYPES = FLIPPED_ALIAS_KEYS[\"Accessor\"];\nexport const PRIVATE_TYPES = FLIPPED_ALIAS_KEYS[\"Private\"];\nexport const FLOW_TYPES = FLIPPED_ALIAS_KEYS[\"Flow\"];\nexport const FLOWTYPE_TYPES = FLIPPED_ALIAS_KEYS[\"FlowType\"];\nexport const FLOWBASEANNOTATION_TYPES =\n FLIPPED_ALIAS_KEYS[\"FlowBaseAnnotation\"];\nexport const FLOWDECLARATION_TYPES = FLIPPED_ALIAS_KEYS[\"FlowDeclaration\"];\nexport const FLOWPREDICATE_TYPES = FLIPPED_ALIAS_KEYS[\"FlowPredicate\"];\nexport const ENUMBODY_TYPES = FLIPPED_ALIAS_KEYS[\"EnumBody\"];\nexport const ENUMMEMBER_TYPES = FLIPPED_ALIAS_KEYS[\"EnumMember\"];\nexport const JSX_TYPES = FLIPPED_ALIAS_KEYS[\"JSX\"];\nexport const MISCELLANEOUS_TYPES = FLIPPED_ALIAS_KEYS[\"Miscellaneous\"];\nexport const TYPESCRIPT_TYPES = FLIPPED_ALIAS_KEYS[\"TypeScript\"];\nexport const TSTYPEELEMENT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CAAC,MAAM,CAAC;AAAC;AAC9C,MAAMqC,cAAc,GAAGrC,+BAAkB,CAAC,UAAU,CAAC;AAAC;AACtD,MAAMsC,wBAAwB,GACnCtC,+BAAkB,CAAC,oBAAoB,CAAC;AAAC;AACpC,MAAMuC,qBAAqB,GAAGvC,+BAAkB,CAAC,iBAAiB,CAAC;AAAC;AACpE,MAAMwC,mBAAmB,GAAGxC,+BAAkB,CAAC,eAAe,CAAC;AAAC;AAChE,MAAMyC,cAAc,GAAGzC,+BAAkB,CAAC,UAAU,CAAC;AAAC;AACtD,MAAM0C,gBAAgB,GAAG1C,+BAAkB,CAAC,YAAY,CAAC;AAAC;AAC1D,MAAM2C,SAAS,GAAG3C,+BAAkB,CAAC,KAAK,CAAC;AAAC;AAC5C,MAAM4C,mBAAmB,GAAG5C,+BAAkB,CAAC,eAAe,CAAC;AAAC;AAChE,MAAM6C,gBAAgB,GAAG7C,+BAAkB,CAAC,YAAY,CAAC;AAAC;AAC1D,MAAM8C,mBAAmB,GAAG9C,+BAAkB,CAAC,eAAe,CAAC;AAAC;AAChE,MAAM+C,YAAY,GAAG/C,+BAAkB,CAAC,QAAQ,CAAC;AAAC;AAClD,MAAMgD,gBAAgB,GAAGhD,+BAAkB,CAAC,YAAY,CAAC;AAAC"}
1
+ {"version":3,"names":["STANDARDIZED_TYPES","FLIPPED_ALIAS_KEYS","EXPRESSION_TYPES","BINARY_TYPES","SCOPABLE_TYPES","BLOCKPARENT_TYPES","BLOCK_TYPES","STATEMENT_TYPES","TERMINATORLESS_TYPES","COMPLETIONSTATEMENT_TYPES","CONDITIONAL_TYPES","LOOP_TYPES","WHILE_TYPES","EXPRESSIONWRAPPER_TYPES","FOR_TYPES","FORXSTATEMENT_TYPES","FUNCTION_TYPES","FUNCTIONPARENT_TYPES","PUREISH_TYPES","DECLARATION_TYPES","PATTERNLIKE_TYPES","LVAL_TYPES","TSENTITYNAME_TYPES","LITERAL_TYPES","IMMUTABLE_TYPES","USERWHITESPACABLE_TYPES","METHOD_TYPES","OBJECTMEMBER_TYPES","PROPERTY_TYPES","UNARYLIKE_TYPES","PATTERN_TYPES","CLASS_TYPES","IMPORTOREXPORTDECLARATION_TYPES","EXPORTDECLARATION_TYPES","MODULESPECIFIER_TYPES","ACCESSOR_TYPES","PRIVATE_TYPES","FLOW_TYPES","FLOWTYPE_TYPES","FLOWBASEANNOTATION_TYPES","FLOWDECLARATION_TYPES","FLOWPREDICATE_TYPES","ENUMBODY_TYPES","ENUMMEMBER_TYPES","JSX_TYPES","MISCELLANEOUS_TYPES","TYPESCRIPT_TYPES","TSTYPEELEMENT_TYPES","TSTYPE_TYPES","TSBASETYPE_TYPES","MODULEDECLARATION_TYPES"],"sources":["../../../src/constants/generated/index.ts"],"sourcesContent":["/*\n * This file is auto-generated! Do not modify it directly.\n * To re-generate run 'make build'\n */\nimport { FLIPPED_ALIAS_KEYS } from \"../../definitions\";\n\nexport const STANDARDIZED_TYPES = FLIPPED_ALIAS_KEYS[\"Standardized\"];\nexport const EXPRESSION_TYPES = FLIPPED_ALIAS_KEYS[\"Expression\"];\nexport const BINARY_TYPES = FLIPPED_ALIAS_KEYS[\"Binary\"];\nexport const SCOPABLE_TYPES = FLIPPED_ALIAS_KEYS[\"Scopable\"];\nexport const BLOCKPARENT_TYPES = FLIPPED_ALIAS_KEYS[\"BlockParent\"];\nexport const BLOCK_TYPES = FLIPPED_ALIAS_KEYS[\"Block\"];\nexport const STATEMENT_TYPES = FLIPPED_ALIAS_KEYS[\"Statement\"];\nexport const TERMINATORLESS_TYPES = FLIPPED_ALIAS_KEYS[\"Terminatorless\"];\nexport const COMPLETIONSTATEMENT_TYPES =\n FLIPPED_ALIAS_KEYS[\"CompletionStatement\"];\nexport const CONDITIONAL_TYPES = FLIPPED_ALIAS_KEYS[\"Conditional\"];\nexport const LOOP_TYPES = FLIPPED_ALIAS_KEYS[\"Loop\"];\nexport const WHILE_TYPES = FLIPPED_ALIAS_KEYS[\"While\"];\nexport const EXPRESSIONWRAPPER_TYPES = FLIPPED_ALIAS_KEYS[\"ExpressionWrapper\"];\nexport const FOR_TYPES = FLIPPED_ALIAS_KEYS[\"For\"];\nexport const FORXSTATEMENT_TYPES = FLIPPED_ALIAS_KEYS[\"ForXStatement\"];\nexport const FUNCTION_TYPES = FLIPPED_ALIAS_KEYS[\"Function\"];\nexport const FUNCTIONPARENT_TYPES = FLIPPED_ALIAS_KEYS[\"FunctionParent\"];\nexport const PUREISH_TYPES = FLIPPED_ALIAS_KEYS[\"Pureish\"];\nexport const DECLARATION_TYPES = FLIPPED_ALIAS_KEYS[\"Declaration\"];\nexport const PATTERNLIKE_TYPES = FLIPPED_ALIAS_KEYS[\"PatternLike\"];\nexport const LVAL_TYPES = FLIPPED_ALIAS_KEYS[\"LVal\"];\nexport const TSENTITYNAME_TYPES = FLIPPED_ALIAS_KEYS[\"TSEntityName\"];\nexport const LITERAL_TYPES = FLIPPED_ALIAS_KEYS[\"Literal\"];\nexport const IMMUTABLE_TYPES = FLIPPED_ALIAS_KEYS[\"Immutable\"];\nexport const USERWHITESPACABLE_TYPES = FLIPPED_ALIAS_KEYS[\"UserWhitespacable\"];\nexport const METHOD_TYPES = FLIPPED_ALIAS_KEYS[\"Method\"];\nexport const OBJECTMEMBER_TYPES = FLIPPED_ALIAS_KEYS[\"ObjectMember\"];\nexport const PROPERTY_TYPES = FLIPPED_ALIAS_KEYS[\"Property\"];\nexport const UNARYLIKE_TYPES = FLIPPED_ALIAS_KEYS[\"UnaryLike\"];\nexport const PATTERN_TYPES = FLIPPED_ALIAS_KEYS[\"Pattern\"];\nexport const CLASS_TYPES = FLIPPED_ALIAS_KEYS[\"Class\"];\nexport const IMPORTOREXPORTDECLARATION_TYPES =\n FLIPPED_ALIAS_KEYS[\"ImportOrExportDeclaration\"];\nexport const EXPORTDECLARATION_TYPES = FLIPPED_ALIAS_KEYS[\"ExportDeclaration\"];\nexport const MODULESPECIFIER_TYPES = FLIPPED_ALIAS_KEYS[\"ModuleSpecifier\"];\nexport const ACCESSOR_TYPES = FLIPPED_ALIAS_KEYS[\"Accessor\"];\nexport const PRIVATE_TYPES = FLIPPED_ALIAS_KEYS[\"Private\"];\nexport const FLOW_TYPES = FLIPPED_ALIAS_KEYS[\"Flow\"];\nexport const FLOWTYPE_TYPES = FLIPPED_ALIAS_KEYS[\"FlowType\"];\nexport const FLOWBASEANNOTATION_TYPES =\n FLIPPED_ALIAS_KEYS[\"FlowBaseAnnotation\"];\nexport const FLOWDECLARATION_TYPES = FLIPPED_ALIAS_KEYS[\"FlowDeclaration\"];\nexport const FLOWPREDICATE_TYPES = FLIPPED_ALIAS_KEYS[\"FlowPredicate\"];\nexport const ENUMBODY_TYPES = FLIPPED_ALIAS_KEYS[\"EnumBody\"];\nexport const ENUMMEMBER_TYPES = FLIPPED_ALIAS_KEYS[\"EnumMember\"];\nexport const JSX_TYPES = FLIPPED_ALIAS_KEYS[\"JSX\"];\nexport const MISCELLANEOUS_TYPES = FLIPPED_ALIAS_KEYS[\"Miscellaneous\"];\nexport const TYPESCRIPT_TYPES = FLIPPED_ALIAS_KEYS[\"TypeScript\"];\nexport const TSTYPEELEMENT_TYPES = FLIPPED_ALIAS_KEYS[\"TSTypeElement\"];\nexport const TSTYPE_TYPES = FLIPPED_ALIAS_KEYS[\"TSType\"];\nexport const TSBASETYPE_TYPES = FLIPPED_ALIAS_KEYS[\"TSBaseType\"];\n/**\n * @deprecated migrate to IMPORTOREXPORTDECLARATION_TYPES.\n */\nexport const MODULEDECLARATION_TYPES = IMPORTOREXPORTDECLARATION_TYPES;\n"],"mappings":";;;;;;AAIA;AAEO,MAAMA,kBAAkB,GAAGC,+BAAkB,CAAC,cAAc,CAAC;AAAC;AAC9D,MAAMC,gBAAgB,GAAGD,+BAAkB,CAAC,YAAY,CAAC;AAAC;AAC1D,MAAME,YAAY,GAAGF,+BAAkB,CAAC,QAAQ,CAAC;AAAC;AAClD,MAAMG,cAAc,GAAGH,+BAAkB,CAAC,UAAU,CAAC;AAAC;AACtD,MA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S,GAAG3C,+BAAkB,CAAC,KAAK,CAAC;AAAC;AAC5C,MAAM4C,mBAAmB,GAAG5C,+BAAkB,CAAC,eAAe,CAAC;AAAC;AAChE,MAAM6C,gBAAgB,GAAG7C,+BAAkB,CAAC,YAAY,CAAC;AAAC;AAC1D,MAAM8C,mBAAmB,GAAG9C,+BAAkB,CAAC,eAAe,CAAC;AAAC;AAChE,MAAM+C,YAAY,GAAG/C,+BAAkB,CAAC,QAAQ,CAAC;AAAC;AAClD,MAAMgD,gBAAgB,GAAGhD,+BAAkB,CAAC,YAAY,CAAC;AAAC;AAI1D,MAAMiD,uBAAuB,GAAGlB,+BAA+B;AAAC"}
@@ -21,7 +21,6 @@ function gatherSequenceExpressions(nodes, scope, declars) {
21
21
  exprs.push(node.expression);
22
22
  } else if ((0, _generated.isVariableDeclaration)(node)) {
23
23
  if (node.kind !== "var") return;
24
-
25
24
  for (const declar of node.declarations) {
26
25
  const bindings = (0, _getBindingIdentifiers.default)(declar);
27
26
  for (const key of Object.keys(bindings)) {
@@ -39,12 +38,10 @@ function gatherSequenceExpressions(nodes, scope, declars) {
39
38
  const consequent = node.consequent ? gatherSequenceExpressions([node.consequent], scope, declars) : scope.buildUndefinedNode();
40
39
  const alternate = node.alternate ? gatherSequenceExpressions([node.alternate], scope, declars) : scope.buildUndefinedNode();
41
40
  if (!consequent || !alternate) return;
42
-
43
41
  exprs.push((0, _generated2.conditionalExpression)(node.test, consequent, alternate));
44
42
  } else if ((0, _generated.isBlockStatement)(node)) {
45
43
  const body = gatherSequenceExpressions(node.body, scope, declars);
46
44
  if (!body) return;
47
-
48
45
  exprs.push(body);
49
46
  } else if ((0, _generated.isEmptyStatement)(node)) {
50
47
  if (nodes.indexOf(node) === 0) {
@@ -1 +1 @@
1
- {"version":3,"names":["gatherSequenceExpressions","nodes","scope","declars","exprs","ensureLastUndefined","node","isEmptyStatement","isExpression","push","isExpressionStatement","expression","isVariableDeclaration","kind","declar","declarations","bindings","getBindingIdentifiers","key","Object","keys","id","cloneNode","init","assignmentExpression","isIfStatement","consequent","buildUndefinedNode","alternate","conditionalExpression","test","isBlockStatement","body","indexOf","length","sequenceExpression"],"sources":["../../src/converters/gatherSequenceExpressions.ts"],"sourcesContent":["import getBindingIdentifiers from \"../retrievers/getBindingIdentifiers\";\nimport {\n isExpression,\n isExpressionStatement,\n isVariableDeclaration,\n isIfStatement,\n isBlockStatement,\n isEmptyStatement,\n} from \"../validators/generated\";\nimport {\n sequenceExpression,\n assignmentExpression,\n conditionalExpression,\n} from \"../builders/generated\";\nimport cloneNode from \"../clone/cloneNode\";\nimport type * as t from \"..\";\nimport type { Scope } from \"@babel/traverse\";\n\nexport type DeclarationInfo = {\n kind: t.VariableDeclaration[\"kind\"];\n id: t.Identifier;\n};\n\nexport default function gatherSequenceExpressions(\n nodes: ReadonlyArray<t.Node>,\n scope: Scope,\n declars: Array<DeclarationInfo>,\n) {\n const exprs: t.Expression[] = [];\n let ensureLastUndefined = true;\n\n for (const node of nodes) {\n // if we encounter emptyStatement before a non-emptyStatement\n // we want to disregard that\n if (!isEmptyStatement(node)) {\n ensureLastUndefined = false;\n }\n\n if (isExpression(node)) {\n exprs.push(node);\n } else if (isExpressionStatement(node)) {\n exprs.push(node.expression);\n } else if (isVariableDeclaration(node)) {\n if (node.kind !== \"var\") return; // bailed\n\n for (const declar of node.declarations) {\n const bindings = getBindingIdentifiers(declar);\n for (const key of Object.keys(bindings)) {\n declars.push({\n kind: node.kind,\n id: cloneNode(bindings[key]),\n });\n }\n\n if (declar.init) {\n exprs.push(assignmentExpression(\"=\", declar.id, declar.init));\n }\n }\n\n ensureLastUndefined = true;\n } else if (isIfStatement(node)) {\n const consequent = node.consequent\n ? gatherSequenceExpressions([node.consequent], scope, declars)\n : scope.buildUndefinedNode();\n const alternate = node.alternate\n ? gatherSequenceExpressions([node.alternate], scope, declars)\n : scope.buildUndefinedNode();\n if (!consequent || !alternate) return; // bailed\n\n exprs.push(conditionalExpression(node.test, consequent, alternate));\n } else if (isBlockStatement(node)) {\n const body = gatherSequenceExpressions(node.body, scope, declars);\n if (!body) return; // bailed\n\n exprs.push(body);\n } else if (isEmptyStatement(node)) {\n // empty statement so ensure the last item is undefined if we're last\n // checks if emptyStatement is first\n if (nodes.indexOf(node) === 0) {\n ensureLastUndefined = true;\n }\n } else {\n // bailed, we can't turn this statement into an expression\n return;\n }\n }\n\n if (ensureLastUndefined) {\n exprs.push(scope.buildUndefinedNode());\n }\n\n if (exprs.length === 1) {\n return exprs[0];\n } else {\n return sequenceExpression(exprs);\n }\n}\n"],"mappings":";;;;;;AAAA;AACA;AAQA;AAKA;AASe,SAASA,yBAAyB,CAC/CC,KAA4B,EAC5BC,KAAY,EACZC,OAA+B,EAC/B;EACA,MAAMC,KAAqB,GAAG,EAAE;EAChC,IAAIC,mBAAmB,GAAG,IAAI;EAE9B,KAAK,MAAMC,IAAI,IAAIL,KAAK,EAAE;IAGxB,IAAI,CAAC,IAAAM,2BAAgB,EAACD,IAAI,CAAC,EAAE;MAC3BD,mBAAmB,GAAG,KAAK;IAC7B;IAEA,IAAI,IAAAG,uBAAY,EAACF,IAAI,CAAC,EAAE;MACtBF,KAAK,CAACK,IAAI,CAACH,IAAI,CAAC;IAClB,CAAC,MAAM,IAAI,IAAAI,gCAAqB,EAACJ,IAAI,CAAC,EAAE;MACtCF,KAAK,CAACK,IAAI,CAACH,IAAI,CAACK,UAAU,CAAC;IAC7B,CAAC,MAAM,IAAI,IAAAC,gCAAqB,EAACN,IAAI,CAAC,EAAE;MACtC,IAAIA,IAAI,CAACO,IAAI,KAAK,KAAK,EAAE;;MAEzB,KAAK,MAAMC,MAAM,IAAIR,IAAI,CAACS,YAAY,EAAE;QACtC,MAAMC,QAAQ,GAAG,IAAAC,8BAAqB,EAACH,MAAM,CAAC;QAC9C,KAAK,MAAMI,GAAG,IAAIC,MAAM,CAACC,IAAI,CAACJ,QAAQ,CAAC,EAAE;UACvCb,OAAO,CAACM,IAAI,CAAC;YACXI,IAAI,EAAEP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AAC3B,IAAI,CAAC,KAAK,CAAC,EAAE;QAC7BD,mBAAmB,GAAG,IAAI;MAC5B;IACF,CAAC,MAAM;MAEL;IACF;EACF;EAEA,IAAIA,mBAAmB,EAAE;IACvBD,KAAK,CAACK,IAAI,CAACP,KAAK,CAACyB,kBAAkB,EAAE,CAAC;EACxC;EAEA,IAAIvB,KAAK,CAAC8B,MAAM,KAAK,CAAC,EAAE;IACtB,OAAO9B,KAAK,CAAC,CAAC,CAAC;EACjB,CAAC,MAAM;IACL,OAAO,IAAA+B,8BAAkB,EAAC/B,KAAK,CAAC;EAClC;AACF"}
1
+ {"version":3,"names":["gatherSequenceExpressions","nodes","scope","declars","exprs","ensureLastUndefined","node","isEmptyStatement","isExpression","push","isExpressionStatement","expression","isVariableDeclaration","kind","declar","declarations","bindings","getBindingIdentifiers","key","Object","keys","id","cloneNode","init","assignmentExpression","isIfStatement","consequent","buildUndefinedNode","alternate","conditionalExpression","test","isBlockStatement","body","indexOf","length","sequenceExpression"],"sources":["../../src/converters/gatherSequenceExpressions.ts"],"sourcesContent":["import getBindingIdentifiers from \"../retrievers/getBindingIdentifiers\";\nimport {\n isExpression,\n isExpressionStatement,\n isVariableDeclaration,\n isIfStatement,\n isBlockStatement,\n isEmptyStatement,\n} from \"../validators/generated\";\nimport {\n sequenceExpression,\n assignmentExpression,\n conditionalExpression,\n} from \"../builders/generated\";\nimport cloneNode from \"../clone/cloneNode\";\nimport type * as t from \"..\";\nimport type { Scope } from \"@babel/traverse\";\n\nexport type DeclarationInfo = {\n kind: t.VariableDeclaration[\"kind\"];\n id: t.Identifier;\n};\n\nexport default function gatherSequenceExpressions(\n nodes: ReadonlyArray<t.Node>,\n scope: Scope,\n declars: Array<DeclarationInfo>,\n) {\n const exprs: t.Expression[] = [];\n let ensureLastUndefined = true;\n\n for (const node of nodes) {\n // if we encounter emptyStatement before a non-emptyStatement\n // we want to disregard that\n if (!isEmptyStatement(node)) {\n ensureLastUndefined = false;\n }\n\n if (isExpression(node)) {\n exprs.push(node);\n } else if (isExpressionStatement(node)) {\n exprs.push(node.expression);\n } else if (isVariableDeclaration(node)) {\n if (node.kind !== \"var\") return; // bailed\n\n for (const declar of node.declarations) {\n const bindings = getBindingIdentifiers(declar);\n for (const key of Object.keys(bindings)) {\n declars.push({\n kind: node.kind,\n id: cloneNode(bindings[key]),\n });\n }\n\n if (declar.init) {\n exprs.push(assignmentExpression(\"=\", declar.id, declar.init));\n }\n }\n\n ensureLastUndefined = true;\n } else if (isIfStatement(node)) {\n const consequent = node.consequent\n ? gatherSequenceExpressions([node.consequent], scope, declars)\n : scope.buildUndefinedNode();\n const alternate = node.alternate\n ? gatherSequenceExpressions([node.alternate], scope, declars)\n : scope.buildUndefinedNode();\n if (!consequent || !alternate) return; // bailed\n\n exprs.push(conditionalExpression(node.test, consequent, alternate));\n } else if (isBlockStatement(node)) {\n const body = gatherSequenceExpressions(node.body, scope, declars);\n if (!body) return; // bailed\n\n exprs.push(body);\n } else if (isEmptyStatement(node)) {\n // empty statement so ensure the last item is undefined if we're last\n // checks if emptyStatement is first\n if (nodes.indexOf(node) === 0) {\n ensureLastUndefined = true;\n }\n } else {\n // bailed, we can't turn this statement into an expression\n return;\n }\n }\n\n if (ensureLastUndefined) {\n exprs.push(scope.buildUndefinedNode());\n }\n\n if (exprs.length === 1) {\n return exprs[0];\n } else {\n return sequenceExpression(exprs);\n }\n}\n"],"mappings":";;;;;;AAAA;AACA;AAQA;AAKA;AASe,SAASA,yBAAyB,CAC/CC,KAA4B,EAC5BC,KAAY,EACZC,OAA+B,EAC/B;EACA,MAAMC,KAAqB,GAAG,EAAE;EAChC,IAAIC,mBAAmB,GAAG,IAAI;EAE9B,KAAK,MAAMC,IAAI,IAAIL,KAAK,EAAE;IAGxB,IAAI,CAAC,IAAAM,2BAAgB,EAACD,IAAI,CAAC,EAAE;MAC3BD,mBAAmB,GAAG,KAAK;IAC7B;IAEA,IAAI,IAAAG,uBAAY,EAACF,IAAI,CAAC,EAAE;MACtBF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B,EAAE;MAC9B,IAAI,CAACD,UAAU,IAAI,CAACE,SAAS,EAAE;MAE/BxB,KAAK,CAACK,IAAI,CAAC,IAAAoB,iCAAqB,EAACvB,IAAI,CAACwB,IAAI,EAAEJ,UAAU,EAAEE,SAAS,CAAC,CAAC;IACrE,CAAC,MAAM,IAAI,IAAAG,2BAAgB,EAACzB,IAAI,CAAC,EAAE;MACjC,MAAM0B,IAAI,GAAGhC,yBAAyB,CAACM,IAAI,CAAC0B,IAAI,EAAE9B,KAAK,EAAEC,OAAO,CAAC;MACjE,IAAI,CAAC6B,IAAI,EAAE;MAEX5B,KAAK,CAACK,IAAI,CAACuB,IAAI,CAAC;IAClB,CAAC,MAAM,IAAI,IAAAzB,2BAAgB,EAACD,IAAI,CAAC,EAAE;MAGjC,IAAIL,KAAK,CAACgC,OAAO,CAAC3B,IAAI,CAAC,KAAK,CAAC,EAAE;QAC7BD,mBAAmB,GAAG,IAAI;MAC5B;IACF,CAAC,MAAM;MAEL;IACF;EACF;EAEA,IAAIA,mBAAmB,EAAE;IACvBD,KAAK,CAACK,IAAI,CAACP,KAAK,CAACyB,kBAAkB,EAAE,CAAC;EACxC;EAEA,IAAIvB,KAAK,CAAC8B,MAAM,KAAK,CAAC,EAAE;IACtB,OAAO9B,KAAK,CAAC,CAAC,CAAC;EACjB,CAAC,MAAM;IACL,OAAO,IAAA+B,8BAAkB,EAAC/B,KAAK,CAAC;EAClC;AACF"}
@@ -6,8 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = toComputedKey;
7
7
  var _generated = require("../validators/generated");
8
8
  var _generated2 = require("../builders/generated");
9
- function toComputedKey(node,
10
- key = node.key || node.property) {
9
+ function toComputedKey(node, key = node.key || node.property) {
11
10
  if (!node.computed && (0, _generated.isIdentifier)(key)) key = (0, _generated2.stringLiteral)(key.name);
12
11
  return key;
13
12
  }
@@ -1 +1 @@
1
- {"version":3,"names":["toComputedKey","node","key","property","computed","isIdentifier","stringLiteral","name"],"sources":["../../src/converters/toComputedKey.ts"],"sourcesContent":["import { isIdentifier } from \"../validators/generated\";\nimport { stringLiteral } from \"../builders/generated\";\nimport type * as t from \"..\";\n\nexport default function toComputedKey(\n node:\n | t.ObjectMember\n | t.ObjectProperty\n | t.ClassMethod\n | t.ClassProperty\n | t.ClassAccessorProperty\n | t.MemberExpression\n | t.OptionalMemberExpression,\n // @ts-expect-error todo(flow->ts): maybe check the type of node before accessing .key and .property\n key: t.Expression | t.PrivateName = node.key || node.property,\n) {\n if (!node.computed && isIdentifier(key)) key = stringLiteral(key.name);\n\n return key;\n}\n"],"mappings":";;;;;;AAAA;AACA;AAGe,SAASA,aAAa,CACnCC,IAO8B;AAE9BC,GAAiC,GAAGD,IAAI,CAACC,GAAG,IAAID,IAAI,CAACE,QAAQ,EAC7D;EACA,IAAI,CAACF,IAAI,CAACG,QAAQ,IAAI,IAAAC,uBAAY,EAACH,GAAG,CAAC,EAAEA,GAAG,GAAG,IAAAI,yBAAa,EAACJ,GAAG,CAACK,IAAI,CAAC;EAEtE,OAAOL,GAAG;AACZ"}
1
+ {"version":3,"names":["toComputedKey","node","key","property","computed","isIdentifier","stringLiteral","name"],"sources":["../../src/converters/toComputedKey.ts"],"sourcesContent":["import { isIdentifier } from \"../validators/generated\";\nimport { stringLiteral } from \"../builders/generated\";\nimport type * as t from \"..\";\n\nexport default function toComputedKey(\n node:\n | t.ObjectMember\n | t.ObjectProperty\n | t.ClassMethod\n | t.ClassProperty\n | t.ClassAccessorProperty\n | t.MemberExpression\n | t.OptionalMemberExpression,\n // @ts-expect-error todo(flow->ts): maybe check the type of node before accessing .key and .property\n key: t.Expression | t.PrivateName = node.key || node.property,\n) {\n if (!node.computed && isIdentifier(key)) key = stringLiteral(key.name);\n\n return key;\n}\n"],"mappings":";;;;;;AAAA;AACA;AAGe,SAASA,aAAa,CACnCC,IAO8B,EAE9BC,GAAiC,GAAGD,IAAI,CAACC,GAAG,IAAID,IAAI,CAACE,QAAQ,EAC7D;EACA,IAAI,CAACF,IAAI,CAACG,QAAQ,IAAI,IAAAC,uBAAY,EAACH,GAAG,CAAC,EAAEA,GAAG,GAAG,IAAAI,yBAAa,EAACJ,GAAG,CAACK,IAAI,CAAC;EAEtE,OAAOL,GAAG;AACZ"}
@@ -11,17 +11,14 @@ function toExpression(node) {
11
11
  if ((0, _generated.isExpressionStatement)(node)) {
12
12
  node = node.expression;
13
13
  }
14
-
15
14
  if ((0, _generated.isExpression)(node)) {
16
15
  return node;
17
16
  }
18
-
19
17
  if ((0, _generated.isClass)(node)) {
20
18
  node.type = "ClassExpression";
21
19
  } else if ((0, _generated.isFunction)(node)) {
22
20
  node.type = "FunctionExpression";
23
21
  }
24
-
25
22
  if (!(0, _generated.isExpression)(node)) {
26
23
  throw new Error(`cannot turn ${node.type} to an expression`);
27
24
  }
@@ -1 +1 @@
1
- {"version":3,"names":["toExpression","node","isExpressionStatement","expression","isExpression","isClass","type","isFunction","Error"],"sources":["../../src/converters/toExpression.ts"],"sourcesContent":["import {\n isExpression,\n isFunction,\n isClass,\n isExpressionStatement,\n} from \"../validators/generated\";\nimport type * as t from \"..\";\n\nexport default toExpression as {\n (node: t.Function): t.FunctionExpression;\n (node: t.Class): t.ClassExpression;\n (\n node: t.ExpressionStatement | t.Expression | t.Class | t.Function,\n ): t.Expression;\n};\n\nfunction toExpression(\n node: t.ExpressionStatement | t.Expression | t.Class | t.Function,\n): t.Expression {\n if (isExpressionStatement(node)) {\n node = node.expression;\n }\n\n // return unmodified node\n // important for things like ArrowFunctions where\n // type change from ArrowFunction to FunctionExpression\n // produces bugs like -> `()=>a` to `function () a`\n // without generating a BlockStatement for it\n // ref: https://github.com/babel/babili/issues/130\n if (isExpression(node)) {\n return node;\n }\n\n // convert all classes and functions\n // ClassDeclaration -> ClassExpression\n // FunctionDeclaration, ObjectMethod, ClassMethod -> FunctionExpression\n if (isClass(node)) {\n // @ts-expect-error todo(flow->ts): avoid type unsafe mutations\n node.type = \"ClassExpression\";\n } else if (isFunction(node)) {\n // @ts-expect-error todo(flow->ts): avoid type unsafe mutations\n node.type = \"FunctionExpression\";\n }\n\n // if it's still not an expression\n if (!isExpression(node)) {\n throw new Error(`cannot turn ${node.type} to an expression`);\n }\n\n return node;\n}\n"],"mappings":";;;;;;AAAA;AAKiC,eAGlBA,YAAY;AAAA;AAQ3B,SAASA,YAAY,CACnBC,IAAiE,EACnD;EACd,IAAI,IAAAC,gCAAqB,EAACD,IAAI,CAAC,EAAE;IAC/BA,IAAI,GAAGA,IAAI,CAACE,UAAU;EACxB;;EAQA,IAAI,IAAAC,uBAAY,EAACH,IAAI,CAAC,EAAE;IACtB,OAAOA,IAAI;EACb;;EAKA,IAAI,IAAAI,kBAAO,EAACJ,IAAI,CAAC,EAAE;IAEjBA,IAAI,CAACK,IAAI,GAAG,iBAAiB;EAC/B,CAAC,MAAM,IAAI,IAAAC,qBAAU,EAACN,IAAI,CAAC,EAAE;IAE3BA,IAAI,CAACK,IAAI,GAAG,oBAAoB;EAClC;;EAGA,IAAI,CAAC,IAAAF,uBAAY,EAACH,IAAI,CAAC,EAAE;IACvB,MAAM,IAAIO,KAAK,CAAE,eAAcP,IAAI,CAACK,IAAK,mBAAkB,CAAC;EAC9D;EAEA,OAAOL,IAAI;AACb"}
1
+ {"version":3,"names":["toExpression","node","isExpressionStatement","expression","isExpression","isClass","type","isFunction","Error"],"sources":["../../src/converters/toExpression.ts"],"sourcesContent":["import {\n isExpression,\n isFunction,\n isClass,\n isExpressionStatement,\n} from \"../validators/generated\";\nimport type * as t from \"..\";\n\nexport default toExpression as {\n (node: t.Function): t.FunctionExpression;\n (node: t.Class): t.ClassExpression;\n (\n node: t.ExpressionStatement | t.Expression | t.Class | t.Function,\n ): t.Expression;\n};\n\nfunction toExpression(\n node: t.ExpressionStatement | t.Expression | t.Class | t.Function,\n): t.Expression {\n if (isExpressionStatement(node)) {\n node = node.expression;\n }\n\n // return unmodified node\n // important for things like ArrowFunctions where\n // type change from ArrowFunction to FunctionExpression\n // produces bugs like -> `()=>a` to `function () a`\n // without generating a BlockStatement for it\n // ref: https://github.com/babel/babili/issues/130\n if (isExpression(node)) {\n return node;\n }\n\n // convert all classes and functions\n // ClassDeclaration -> ClassExpression\n // FunctionDeclaration, ObjectMethod, ClassMethod -> FunctionExpression\n if (isClass(node)) {\n // @ts-expect-error todo(flow->ts): avoid type unsafe mutations\n node.type = \"ClassExpression\";\n } else if (isFunction(node)) {\n // @ts-expect-error todo(flow->ts): avoid type unsafe mutations\n node.type = \"FunctionExpression\";\n }\n\n // if it's still not an expression\n if (!isExpression(node)) {\n throw new Error(`cannot turn ${node.type} to an expression`);\n }\n\n return node;\n}\n"],"mappings":";;;;;;AAAA;AAKiC,eAGlBA,YAAY;AAAA;AAQ3B,SAASA,YAAY,CACnBC,IAAiE,EACnD;EACd,IAAI,IAAAC,gCAAqB,EAACD,IAAI,CAAC,EAAE;IAC/BA,IAAI,GAAGA,IAAI,CAACE,UAAU;EACxB;EAQA,IAAI,IAAAC,uBAAY,EAACH,IAAI,CAAC,EAAE;IACtB,OAAOA,IAAI;EACb;EAKA,IAAI,IAAAI,kBAAO,EAACJ,IAAI,CAAC,EAAE;IAEjBA,IAAI,CAACK,IAAI,GAAG,iBAAiB;EAC/B,CAAC,MAAM,IAAI,IAAAC,qBAAU,EAACN,IAAI,CAAC,EAAE;IAE3BA,IAAI,CAACK,IAAI,GAAG,oBAAoB;EAClC;EAGA,IAAI,CAAC,IAAAF,uBAAY,EAACH,IAAI,CAAC,EAAE;IACvB,MAAM,IAAIO,KAAK,CAAE,eAAcP,IAAI,CAACK,IAAK,mBAAkB,CAAC;EAC9D;EAEA,OAAOL,IAAI;AACb"}
@@ -8,14 +8,11 @@ var _isValidIdentifier = require("../validators/isValidIdentifier");
8
8
  var _helperValidatorIdentifier = require("@babel/helper-validator-identifier");
9
9
  function toIdentifier(input) {
10
10
  input = input + "";
11
-
12
11
  let name = "";
13
12
  for (const c of input) {
14
13
  name += (0, _helperValidatorIdentifier.isIdentifierChar)(c.codePointAt(0)) ? c : "-";
15
14
  }
16
-
17
15
  name = name.replace(/^[-0-9]+/, "");
18
-
19
16
  name = name.replace(/[-\s]+(.)?/g, function (match, c) {
20
17
  return c ? c.toUpperCase() : "";
21
18
  });
@@ -1 +1 @@
1
- {"version":3,"names":["toIdentifier","input","name","c","isIdentifierChar","codePointAt","replace","match","toUpperCase","isValidIdentifier"],"sources":["../../src/converters/toIdentifier.ts"],"sourcesContent":["import isValidIdentifier from \"../validators/isValidIdentifier\";\nimport { isIdentifierChar } from \"@babel/helper-validator-identifier\";\n\nexport default function toIdentifier(input: string): string {\n input = input + \"\";\n\n // replace all non-valid identifiers with dashes\n let name = \"\";\n for (const c of input) {\n name += isIdentifierChar(c.codePointAt(0)) ? c : \"-\";\n }\n\n // remove all dashes and numbers from start of name\n name = name.replace(/^[-0-9]+/, \"\");\n\n // camel case\n name = name.replace(/[-\\s]+(.)?/g, function (match, c) {\n return c ? c.toUpperCase() : \"\";\n });\n\n if (!isValidIdentifier(name)) {\n name = `_${name}`;\n }\n\n return name || \"_\";\n}\n"],"mappings":";;;;;;AAAA;AACA;AAEe,SAASA,YAAY,CAACC,KAAa,EAAU;EAC1DA,KAAK,GAAGA,KAAK,GAAG,EAAE;;EAGlB,IAAIC,IAAI,GAAG,EAAE;EACb,KAAK,MAAMC,CAAC,IAAIF,KAAK,EAAE;IACrBC,IAAI,IAAI,IAAAE,2CAAgB,EAACD,CAAC,CAACE,WAAW,CAAC,CAAC,CAAC,CAAC,GAAGF,CAAC,GAAG,GAAG;EACtD;;EAGAD,IAAI,GAAGA,IAAI,CAACI,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;;EAGnCJ,IAAI,GAAGA,IAAI,CAACI,OAAO,CAAC,aAAa,EAAE,UAAUC,KAAK,EAAEJ,CAAC,EAAE;IACrD,OAAOA,CAAC,GAAGA,CAAC,CAACK,WAAW,EAAE,GAAG,EAAE;EACjC,CAAC,CAAC;EAEF,IAAI,CAAC,IAAAC,0BAAiB,EAACP,IAAI,CAAC,EAAE;IAC5BA,IAAI,GAAI,IAAGA,IAAK,EAAC;EACnB;EAEA,OAAOA,IAAI,IAAI,GAAG;AACpB"}
1
+ {"version":3,"names":["toIdentifier","input","name","c","isIdentifierChar","codePointAt","replace","match","toUpperCase","isValidIdentifier"],"sources":["../../src/converters/toIdentifier.ts"],"sourcesContent":["import isValidIdentifier from \"../validators/isValidIdentifier\";\nimport { isIdentifierChar } from \"@babel/helper-validator-identifier\";\n\nexport default function toIdentifier(input: string): string {\n input = input + \"\";\n\n // replace all non-valid identifiers with dashes\n let name = \"\";\n for (const c of input) {\n name += isIdentifierChar(c.codePointAt(0)) ? c : \"-\";\n }\n\n // remove all dashes and numbers from start of name\n name = name.replace(/^[-0-9]+/, \"\");\n\n // camel case\n name = name.replace(/[-\\s]+(.)?/g, function (match, c) {\n return c ? c.toUpperCase() : \"\";\n });\n\n if (!isValidIdentifier(name)) {\n name = `_${name}`;\n }\n\n return name || \"_\";\n}\n"],"mappings":";;;;;;AAAA;AACA;AAEe,SAASA,YAAY,CAACC,KAAa,EAAU;EAC1DA,KAAK,GAAGA,KAAK,GAAG,EAAE;EAGlB,IAAIC,IAAI,GAAG,EAAE;EACb,KAAK,MAAMC,CAAC,IAAIF,KAAK,EAAE;IACrBC,IAAI,IAAI,IAAAE,2CAAgB,EAACD,CAAC,CAACE,WAAW,CAAC,CAAC,CAAC,CAAC,GAAGF,CAAC,GAAG,GAAG;EACtD;EAGAD,IAAI,GAAGA,IAAI,CAACI,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;EAGnCJ,IAAI,GAAGA,IAAI,CAACI,OAAO,CAAC,aAAa,EAAE,UAAUC,KAAK,EAAEJ,CAAC,EAAE;IACrD,OAAOA,CAAC,GAAGA,CAAC,CAACK,WAAW,EAAE,GAAG,EAAE;EACjC,CAAC,CAAC;EAEF,IAAI,CAAC,IAAAC,0BAAiB,EAACP,IAAI,CAAC,EAAE;IAC5BA,IAAI,GAAI,IAAGA,IAAK,EAAC;EACnB;EAEA,OAAOA,IAAI,IAAI,GAAG;AACpB"}
@@ -9,7 +9,6 @@ var _cloneNode = require("../clone/cloneNode");
9
9
  var _removePropertiesDeep = require("../modifications/removePropertiesDeep");
10
10
  function toKeyAlias(node, key = node.key) {
11
11
  let alias;
12
-
13
12
  if (node.kind === "method") {
14
13
  return toKeyAlias.increment() + "";
15
14
  } else if ((0, _generated.isIdentifier)(key)) {
@@ -19,11 +18,9 @@ function toKeyAlias(node, key = node.key) {
19
18
  } else {
20
19
  alias = JSON.stringify((0, _removePropertiesDeep.default)((0, _cloneNode.default)(key)));
21
20
  }
22
-
23
21
  if (node.computed) {
24
22
  alias = `[${alias}]`;
25
23
  }
26
-
27
24
  if (node.static) {
28
25
  alias = `static:${alias}`;
29
26
  }
@@ -1 +1 @@
1
- {"version":3,"names":["toKeyAlias","node","key","alias","kind","increment","isIdentifier","name","isStringLiteral","JSON","stringify","value","removePropertiesDeep","cloneNode","computed","static","uid","Number","MAX_SAFE_INTEGER"],"sources":["../../src/converters/toKeyAlias.ts"],"sourcesContent":["import { isIdentifier, isStringLiteral } from \"../validators/generated\";\nimport cloneNode from \"../clone/cloneNode\";\nimport removePropertiesDeep from \"../modifications/removePropertiesDeep\";\nimport type * as t from \"..\";\n\nexport default function toKeyAlias(\n node: t.Method | t.Property,\n key: t.Node = node.key,\n): string {\n let alias;\n\n // @ts-expect-error todo(flow->ts): maybe add node type check before checking `.kind`\n if (node.kind === \"method\") {\n return toKeyAlias.increment() + \"\";\n } else if (isIdentifier(key)) {\n alias = key.name;\n } else if (isStringLiteral(key)) {\n alias = JSON.stringify(key.value);\n } else {\n alias = JSON.stringify(removePropertiesDeep(cloneNode(key)));\n }\n\n // @ts-expect-error todo(flow->ts): maybe add node type check before checking `.computed`\n if (node.computed) {\n alias = `[${alias}]`;\n }\n\n // @ts-expect-error todo(flow->ts): maybe add node type check before checking `.static`\n if (node.static) {\n alias = `static:${alias}`;\n }\n\n return alias;\n}\n\ntoKeyAlias.uid = 0;\n\ntoKeyAlias.increment = function () {\n if (toKeyAlias.uid >= Number.MAX_SAFE_INTEGER) {\n return (toKeyAlias.uid = 0);\n } else {\n return toKeyAlias.uid++;\n }\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AAGe,SAASA,UAAU,CAChCC,IAA2B,EAC3BC,GAAW,GAAGD,IAAI,CAACC,GAAG,EACd;EACR,IAAIC,KAAK;;EAGT,IAAIF,IAAI,CAACG,IAAI,KAAK,QAAQ,EAAE;IAC1B,OAAOJ,UAAU,CAACK,SAAS,EAAE,GAAG,EAAE;EACpC,CAAC,MAAM,IAAI,IAAAC,uBAAY,EAACJ,GAAG,CAAC,EAAE;IAC5BC,KAAK,GAAGD,GAAG,CAACK,IAAI;EAClB,CAAC,MAAM,IAAI,IAAAC,0BAAe,EAACN,GAAG,CAAC,EAAE;IAC/BC,KAAK,GAAGM,IAAI,CAACC,SAAS,CAACR,GAAG,CAACS,KAAK,CAAC;EACnC,CAAC,MAAM;IACLR,KAAK,GAAGM,IAAI,CAACC,SAAS,CAAC,IAAAE,6BAAoB,EAAC,IAAAC,kBAAS,EAACX,GAAG,CAAC,CAAC,CAAC;EAC9D;;EAGA,IAAID,IAAI,CAACa,QAAQ,EAAE;IACjBX,KAAK,GAAI,IAAGA,KAAM,GAAE;EACtB;;EAGA,IAAIF,IAAI,CAACc,MAAM,EAAE;IACfZ,KAAK,GAAI,UAASA,KAAM,EAAC;EAC3B;EAEA,OAAOA,KAAK;AACd;AAEAH,UAAU,CAACgB,GAAG,GAAG,CAAC;AAElBhB,UAAU,CAACK,SAAS,GAAG,YAAY;EACjC,IAAIL,UAAU,CAACgB,GAAG,IAAIC,MAAM,CAACC,gBAAgB,EAAE;IAC7C,OAAQlB,UAAU,CAACgB,GAAG,GAAG,CAAC;EAC5B,CAAC,MAAM;IACL,OAAOhB,UAAU,CAACgB,GAAG,EAAE;EACzB;AACF,CAAC"}
1
+ {"version":3,"names":["toKeyAlias","node","key","alias","kind","increment","isIdentifier","name","isStringLiteral","JSON","stringify","value","removePropertiesDeep","cloneNode","computed","static","uid","Number","MAX_SAFE_INTEGER"],"sources":["../../src/converters/toKeyAlias.ts"],"sourcesContent":["import { isIdentifier, isStringLiteral } from \"../validators/generated\";\nimport cloneNode from \"../clone/cloneNode\";\nimport removePropertiesDeep from \"../modifications/removePropertiesDeep\";\nimport type * as t from \"..\";\n\nexport default function toKeyAlias(\n node: t.Method | t.Property,\n key: t.Node = node.key,\n): string {\n let alias;\n\n // @ts-expect-error todo(flow->ts): maybe add node type check before checking `.kind`\n if (node.kind === \"method\") {\n return toKeyAlias.increment() + \"\";\n } else if (isIdentifier(key)) {\n alias = key.name;\n } else if (isStringLiteral(key)) {\n alias = JSON.stringify(key.value);\n } else {\n alias = JSON.stringify(removePropertiesDeep(cloneNode(key)));\n }\n\n // @ts-expect-error todo(flow->ts): maybe add node type check before checking `.computed`\n if (node.computed) {\n alias = `[${alias}]`;\n }\n\n // @ts-expect-error todo(flow->ts): maybe add node type check before checking `.static`\n if (node.static) {\n alias = `static:${alias}`;\n }\n\n return alias;\n}\n\ntoKeyAlias.uid = 0;\n\ntoKeyAlias.increment = function () {\n if (toKeyAlias.uid >= Number.MAX_SAFE_INTEGER) {\n return (toKeyAlias.uid = 0);\n } else {\n return toKeyAlias.uid++;\n }\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AAGe,SAASA,UAAU,CAChCC,IAA2B,EAC3BC,GAAW,GAAGD,IAAI,CAACC,GAAG,EACd;EACR,IAAIC,KAAK;EAGT,IAAIF,IAAI,CAACG,IAAI,KAAK,QAAQ,EAAE;IAC1B,OAAOJ,UAAU,CAACK,SAAS,EAAE,GAAG,EAAE;EACpC,CAAC,MAAM,IAAI,IAAAC,uBAAY,EAACJ,GAAG,CAAC,EAAE;IAC5BC,KAAK,GAAGD,GAAG,CAACK,IAAI;EAClB,CAAC,MAAM,IAAI,IAAAC,0BAAe,EAACN,GAAG,CAAC,EAAE;IAC/BC,KAAK,GAAGM,IAAI,CAACC,SAAS,CAACR,GAAG,CAACS,KAAK,CAAC;EACnC,CAAC,MAAM;IACLR,KAAK,GAAGM,IAAI,CAACC,SAAS,CAAC,IAAAE,6BAAoB,EAAC,IAAAC,kBAAS,EAACX,GAAG,CAAC,CAAC,CAAC;EAC9D;EAGA,IAAID,IAAI,CAACa,QAAQ,EAAE;IACjBX,KAAK,GAAI,IAAGA,KAAM,GAAE;EACtB;EAGA,IAAIF,IAAI,CAACc,MAAM,EAAE;IACfZ,KAAK,GAAI,UAASA,KAAM,EAAC;EAC3B;EAEA,OAAOA,KAAK;AACd;AAEAH,UAAU,CAACgB,GAAG,GAAG,CAAC;AAElBhB,UAAU,CAACK,SAAS,GAAG,YAAY;EACjC,IAAIL,UAAU,CAACgB,GAAG,IAAIC,MAAM,CAACC,gBAAgB,EAAE;IAC7C,OAAQlB,UAAU,CAACgB,GAAG,GAAG,CAAC;EAC5B,CAAC,MAAM;IACL,OAAOhB,UAAU,CAACgB,GAAG,EAAE;EACzB;AACF,CAAC"}
@@ -13,7 +13,6 @@ function toSequenceExpression(nodes, scope) {
13
13
  for (const declar of declars) {
14
14
  scope.push(declar);
15
15
  }
16
-
17
16
  return result;
18
17
  }
19
18
 
@@ -1 +1 @@
1
- {"version":3,"names":["toSequenceExpression","nodes","scope","length","declars","result","gatherSequenceExpressions","declar","push"],"sources":["../../src/converters/toSequenceExpression.ts"],"sourcesContent":["import gatherSequenceExpressions from \"./gatherSequenceExpressions\";\nimport type * as t from \"..\";\nimport type { DeclarationInfo } from \"./gatherSequenceExpressions\";\n\n/**\n * Turn an array of statement `nodes` into a `SequenceExpression`.\n *\n * Variable declarations are turned into simple assignments and their\n * declarations hoisted to the top of the current scope.\n *\n * Expression statements are just resolved to their expression.\n */\nexport default function toSequenceExpression(\n nodes: ReadonlyArray<t.Node>,\n scope: any,\n): t.SequenceExpression | undefined {\n if (!nodes?.length) return;\n\n const declars: DeclarationInfo[] = [];\n const result = gatherSequenceExpressions(nodes, scope, declars);\n if (!result) return;\n\n for (const declar of declars) {\n scope.push(declar);\n }\n\n // @ts-expect-error fixme: gatherSequenceExpressions will return an Expression when there are only one element\n return result;\n}\n"],"mappings":";;;;;;AAAA;AAYe,SAASA,oBAAoB,CAC1CC,KAA4B,EAC5BC,KAAU,EACwB;EAClC,IAAI,EAACD,KAAK,YAALA,KAAK,CAAEE,MAAM,GAAE;EAEpB,MAAMC,OAA0B,GAAG,EAAE;EACrC,MAAMC,MAAM,GAAG,IAAAC,kCAAyB,EAACL,KAAK,EAAEC,KAAK,EAAEE,OAAO,CAAC;EAC/D,IAAI,CAACC,MAAM,EAAE;EAEb,KAAK,MAAME,MAAM,IAAIH,OAAO,EAAE;IAC5BF,KAAK,CAACM,IAAI,CAACD,MAAM,CAAC;EACpB;;EAGA,OAAOF,MAAM;AACf"}
1
+ {"version":3,"names":["toSequenceExpression","nodes","scope","length","declars","result","gatherSequenceExpressions","declar","push"],"sources":["../../src/converters/toSequenceExpression.ts"],"sourcesContent":["import gatherSequenceExpressions from \"./gatherSequenceExpressions\";\nimport type * as t from \"..\";\nimport type { DeclarationInfo } from \"./gatherSequenceExpressions\";\n\n/**\n * Turn an array of statement `nodes` into a `SequenceExpression`.\n *\n * Variable declarations are turned into simple assignments and their\n * declarations hoisted to the top of the current scope.\n *\n * Expression statements are just resolved to their expression.\n */\nexport default function toSequenceExpression(\n nodes: ReadonlyArray<t.Node>,\n scope: any,\n): t.SequenceExpression | undefined {\n if (!nodes?.length) return;\n\n const declars: DeclarationInfo[] = [];\n const result = gatherSequenceExpressions(nodes, scope, declars);\n if (!result) return;\n\n for (const declar of declars) {\n scope.push(declar);\n }\n\n // @ts-expect-error fixme: gatherSequenceExpressions will return an Expression when there are only one element\n return result;\n}\n"],"mappings":";;;;;;AAAA;AAYe,SAASA,oBAAoB,CAC1CC,KAA4B,EAC5BC,KAAU,EACwB;EAClC,IAAI,EAACD,KAAK,YAALA,KAAK,CAAEE,MAAM,GAAE;EAEpB,MAAMC,OAA0B,GAAG,EAAE;EACrC,MAAMC,MAAM,GAAG,IAAAC,kCAAyB,EAACL,KAAK,EAAEC,KAAK,EAAEE,OAAO,CAAC;EAC/D,IAAI,CAACC,MAAM,EAAE;EAEb,KAAK,MAAME,MAAM,IAAIH,OAAO,EAAE;IAC5BF,KAAK,CAACM,IAAI,CAACD,MAAM,CAAC;EACpB;EAGA,OAAOF,MAAM;AACf"}
@@ -23,7 +23,6 @@ function toStatement(node, ignore) {
23
23
  } else if ((0, _generated.isAssignmentExpression)(node)) {
24
24
  return (0, _generated2.expressionStatement)(node);
25
25
  }
26
-
27
26
  if (mustHaveId && !node.id) {
28
27
  newType = false;
29
28
  }
@@ -34,9 +33,7 @@ function toStatement(node, ignore) {
34
33
  throw new Error(`cannot turn ${node.type} to a statement`);
35
34
  }
36
35
  }
37
-
38
36
  node.type = newType;
39
-
40
37
  return node;
41
38
  }
42
39
 
@@ -1 +1 @@
1
- {"version":3,"names":["toStatement","node","ignore","isStatement","mustHaveId","newType","isClass","isFunction","isAssignmentExpression","expressionStatement","id","Error","type"],"sources":["../../src/converters/toStatement.ts"],"sourcesContent":["import {\n isStatement,\n isFunction,\n isClass,\n isAssignmentExpression,\n} from \"../validators/generated\";\nimport { expressionStatement } from \"../builders/generated\";\nimport type * as t from \"..\";\n\nexport default toStatement as {\n (node: t.AssignmentExpression, ignore?: boolean): t.ExpressionStatement;\n\n <T extends t.Statement>(node: T, ignore: false): T;\n <T extends t.Statement>(node: T, ignore?: boolean): T | false;\n\n (node: t.Class, ignore: false): t.ClassDeclaration;\n (node: t.Class, ignore?: boolean): t.ClassDeclaration | false;\n\n (node: t.Function, ignore: false): t.FunctionDeclaration;\n (node: t.Function, ignore?: boolean): t.FunctionDeclaration | false;\n\n (node: t.Node, ignore: false): t.Statement;\n (node: t.Node, ignore?: boolean): t.Statement | false;\n};\n\nfunction toStatement(node: t.Node, ignore?: boolean): t.Statement | false {\n if (isStatement(node)) {\n return node;\n }\n\n let mustHaveId = false;\n let newType;\n\n if (isClass(node)) {\n mustHaveId = true;\n newType = \"ClassDeclaration\" as const;\n } else if (isFunction(node)) {\n mustHaveId = true;\n newType = \"FunctionDeclaration\" as const;\n } else if (isAssignmentExpression(node)) {\n return expressionStatement(node);\n }\n\n // @ts-expect-error todo(flow->ts): node.id might be missing\n if (mustHaveId && !node.id) {\n newType = false as false;\n }\n\n if (!newType) {\n if (ignore) {\n return false;\n } else {\n throw new Error(`cannot turn ${node.type} to a statement`);\n }\n }\n\n // @ts-expect-error manipulating node.type\n node.type = newType;\n\n // @ts-expect-error todo(flow->ts) refactor to avoid type unsafe mutations like reassigning node type above\n return node;\n}\n"],"mappings":";;;;;;AAAA;AAMA;AAA4D,eAG7CA,WAAW;AAAA;AAgB1B,SAASA,WAAW,CAACC,IAAY,EAAEC,MAAgB,EAAuB;EACxE,IAAI,IAAAC,sBAAW,EAACF,IAAI,CAAC,EAAE;IACrB,OAAOA,IAAI;EACb;EAEA,IAAIG,UAAU,GAAG,KAAK;EACtB,IAAIC,OAAO;EAEX,IAAI,IAAAC,kBAAO,EAACL,IAAI,CAAC,EAAE;IACjBG,UAAU,GAAG,IAAI;IACjBC,OAAO,GAAG,kBAA2B;EACvC,CAAC,MAAM,IAAI,IAAAE,qBAAU,EAACN,IAAI,CAAC,EAAE;IAC3BG,UAAU,GAAG,IAAI;IACjBC,OAAO,GAAG,qBAA8B;EAC1C,CAAC,MAAM,IAAI,IAAAG,iCAAsB,EAACP,IAAI,CAAC,EAAE;IACvC,OAAO,IAAAQ,+BAAmB,EAACR,IAAI,CAAC;EAClC;;EAGA,IAAIG,UAAU,IAAI,CAACH,IAAI,CAACS,EAAE,EAAE;IAC1BL,OAAO,GAAG,KAAc;EAC1B;EAEA,IAAI,CAACA,OAAO,EAAE;IACZ,IAAIH,MAAM,EAAE;MACV,OAAO,KAAK;IACd,CAAC,MAAM;MACL,MAAM,IAAIS,KAAK,CAAE,eAAcV,IAAI,CAACW,IAAK,iBAAgB,CAAC;IAC5D;EACF;;EAGAX,IAAI,CAACW,IAAI,GAAGP,OAAO;;EAGnB,OAAOJ,IAAI;AACb"}
1
+ {"version":3,"names":["toStatement","node","ignore","isStatement","mustHaveId","newType","isClass","isFunction","isAssignmentExpression","expressionStatement","id","Error","type"],"sources":["../../src/converters/toStatement.ts"],"sourcesContent":["import {\n isStatement,\n isFunction,\n isClass,\n isAssignmentExpression,\n} from \"../validators/generated\";\nimport { expressionStatement } from \"../builders/generated\";\nimport type * as t from \"..\";\n\nexport default toStatement as {\n (node: t.AssignmentExpression, ignore?: boolean): t.ExpressionStatement;\n\n <T extends t.Statement>(node: T, ignore: false): T;\n <T extends t.Statement>(node: T, ignore?: boolean): T | false;\n\n (node: t.Class, ignore: false): t.ClassDeclaration;\n (node: t.Class, ignore?: boolean): t.ClassDeclaration | false;\n\n (node: t.Function, ignore: false): t.FunctionDeclaration;\n (node: t.Function, ignore?: boolean): t.FunctionDeclaration | false;\n\n (node: t.Node, ignore: false): t.Statement;\n (node: t.Node, ignore?: boolean): t.Statement | false;\n};\n\nfunction toStatement(node: t.Node, ignore?: boolean): t.Statement | false {\n if (isStatement(node)) {\n return node;\n }\n\n let mustHaveId = false;\n let newType;\n\n if (isClass(node)) {\n mustHaveId = true;\n newType = \"ClassDeclaration\" as const;\n } else if (isFunction(node)) {\n mustHaveId = true;\n newType = \"FunctionDeclaration\" as const;\n } else if (isAssignmentExpression(node)) {\n return expressionStatement(node);\n }\n\n // @ts-expect-error todo(flow->ts): node.id might be missing\n if (mustHaveId && !node.id) {\n newType = false as false;\n }\n\n if (!newType) {\n if (ignore) {\n return false;\n } else {\n throw new Error(`cannot turn ${node.type} to a statement`);\n }\n }\n\n // @ts-expect-error manipulating node.type\n node.type = newType;\n\n // @ts-expect-error todo(flow->ts) refactor to avoid type unsafe mutations like reassigning node type above\n return node;\n}\n"],"mappings":";;;;;;AAAA;AAMA;AAA4D,eAG7CA,WAAW;AAAA;AAgB1B,SAASA,WAAW,CAACC,IAAY,EAAEC,MAAgB,EAAuB;EACxE,IAAI,IAAAC,sBAAW,EAACF,IAAI,CAAC,EAAE;IACrB,OAAOA,IAAI;EACb;EAEA,IAAIG,UAAU,GAAG,KAAK;EACtB,IAAIC,OAAO;EAEX,IAAI,IAAAC,kBAAO,EAACL,IAAI,CAAC,EAAE;IACjBG,UAAU,GAAG,IAAI;IACjBC,OAAO,GAAG,kBAA2B;EACvC,CAAC,MAAM,IAAI,IAAAE,qBAAU,EAACN,IAAI,CAAC,EAAE;IAC3BG,UAAU,GAAG,IAAI;IACjBC,OAAO,GAAG,qBAA8B;EAC1C,CAAC,MAAM,IAAI,IAAAG,iCAAsB,EAACP,IAAI,CAAC,EAAE;IACvC,OAAO,IAAAQ,+BAAmB,EAACR,IAAI,CAAC;EAClC;EAGA,IAAIG,UAAU,IAAI,CAACH,IAAI,CAACS,EAAE,EAAE;IAC1BL,OAAO,GAAG,KAAc;EAC1B;EAEA,IAAI,CAACA,OAAO,EAAE;IACZ,IAAIH,MAAM,EAAE;MACV,OAAO,KAAK;IACd,CAAC,MAAM;MACL,MAAM,IAAIS,KAAK,CAAE,eAAcV,IAAI,CAACW,IAAK,iBAAgB,CAAC;IAC5D;EACF;EAGAX,IAAI,CAACW,IAAI,GAAGP,OAAO;EAGnB,OAAOJ,IAAI;AACb"}
@@ -23,19 +23,15 @@ function valueToNode(value) {
23
23
  if (value === undefined) {
24
24
  return (0, _generated.identifier)("undefined");
25
25
  }
26
-
27
26
  if (value === true || value === false) {
28
27
  return (0, _generated.booleanLiteral)(value);
29
28
  }
30
-
31
29
  if (value === null) {
32
30
  return (0, _generated.nullLiteral)();
33
31
  }
34
-
35
32
  if (typeof value === "string") {
36
33
  return (0, _generated.stringLiteral)(value);
37
34
  }
38
-
39
35
  if (typeof value === "number") {
40
36
  let result;
41
37
  if (Number.isFinite(value)) {
@@ -54,17 +50,14 @@ function valueToNode(value) {
54
50
  }
55
51
  return result;
56
52
  }
57
-
58
53
  if (isRegExp(value)) {
59
54
  const pattern = value.source;
60
55
  const flags = value.toString().match(/\/([a-z]+|)$/)[1];
61
56
  return (0, _generated.regExpLiteral)(pattern, flags);
62
57
  }
63
-
64
58
  if (Array.isArray(value)) {
65
59
  return (0, _generated.arrayExpression)(value.map(valueToNode));
66
60
  }
67
-
68
61
  if (isPlainObject(value)) {
69
62
  const props = [];
70
63
  for (const key of Object.keys(value)) {
@@ -74,8 +67,7 @@ function valueToNode(value) {
74
67
  } else {
75
68
  nodeKey = (0, _generated.stringLiteral)(key);
76
69
  }
77
- props.push((0, _generated.objectProperty)(nodeKey, valueToNode(
78
- value[key])));
70
+ props.push((0, _generated.objectProperty)(nodeKey, valueToNode(value[key])));
79
71
  }
80
72
  return (0, _generated.objectExpression)(props);
81
73
  }
@@ -1 +1 @@
1
- {"version":3,"names":["valueToNode","objectToString","Function","call","bind","Object","prototype","toString","isRegExp","value","isPlainObject","proto","getPrototypeOf","undefined","identifier","booleanLiteral","nullLiteral","stringLiteral","result","Number","isFinite","numericLiteral","Math","abs","numerator","isNaN","binaryExpression","is","unaryExpression","pattern","source","flags","match","regExpLiteral","Array","isArray","arrayExpression","map","props","key","keys","nodeKey","isValidIdentifier","push","objectProperty","objectExpression","Error"],"sources":["../../src/converters/valueToNode.ts"],"sourcesContent":["import isValidIdentifier from \"../validators/isValidIdentifier\";\nimport {\n identifier,\n booleanLiteral,\n nullLiteral,\n stringLiteral,\n numericLiteral,\n regExpLiteral,\n arrayExpression,\n objectProperty,\n objectExpression,\n unaryExpression,\n binaryExpression,\n} from \"../builders/generated\";\nimport type * as t from \"..\";\n\nexport default valueToNode as {\n (value: undefined): t.Identifier; // TODO: This should return \"void 0\"\n (value: boolean): t.BooleanLiteral;\n (value: null): t.NullLiteral;\n (value: string): t.StringLiteral;\n // Infinities and NaN need to use a BinaryExpression; negative values must be wrapped in UnaryExpression\n (value: number): t.NumericLiteral | t.BinaryExpression | t.UnaryExpression;\n (value: RegExp): t.RegExpLiteral;\n (value: ReadonlyArray<unknown>): t.ArrayExpression;\n\n // this throws with objects that are not plain objects,\n // or if there are non-valueToNode-able values\n (value: object): t.ObjectExpression;\n\n (value: unknown): t.Expression;\n};\n\n// @ts-expect-error: Object.prototype.toString must return a string\nconst objectToString: (value: unknown) => string = Function.call.bind(\n Object.prototype.toString,\n);\n\nfunction isRegExp(value: unknown): value is RegExp {\n return objectToString(value) === \"[object RegExp]\";\n}\n\nfunction isPlainObject(value: unknown): value is object {\n if (\n typeof value !== \"object\" ||\n value === null ||\n Object.prototype.toString.call(value) !== \"[object Object]\"\n ) {\n return false;\n }\n const proto = Object.getPrototypeOf(value);\n // Object.prototype's __proto__ is null. Every other class's __proto__.__proto__ is\n // not null by default. We cannot check if proto === Object.prototype because it\n // could come from another realm.\n return proto === null || Object.getPrototypeOf(proto) === null;\n}\n\nfunction valueToNode(value: unknown): t.Expression {\n // undefined\n if (value === undefined) {\n return identifier(\"undefined\");\n }\n\n // boolean\n if (value === true || value === false) {\n return booleanLiteral(value);\n }\n\n // null\n if (value === null) {\n return nullLiteral();\n }\n\n // strings\n if (typeof value === \"string\") {\n return stringLiteral(value);\n }\n\n // numbers\n if (typeof value === \"number\") {\n let result;\n if (Number.isFinite(value)) {\n result = numericLiteral(Math.abs(value));\n } else {\n let numerator;\n if (Number.isNaN(value)) {\n // NaN\n numerator = numericLiteral(0);\n } else {\n // Infinity / -Infinity\n numerator = numericLiteral(1);\n }\n\n result = binaryExpression(\"/\", numerator, numericLiteral(0));\n }\n\n if (value < 0 || Object.is(value, -0)) {\n result = unaryExpression(\"-\", result);\n }\n\n return result;\n }\n\n // regexes\n if (isRegExp(value)) {\n const pattern = value.source;\n const flags = value.toString().match(/\\/([a-z]+|)$/)[1];\n return regExpLiteral(pattern, flags);\n }\n\n // array\n if (Array.isArray(value)) {\n return arrayExpression(value.map(valueToNode));\n }\n\n // object\n if (isPlainObject(value)) {\n const props = [];\n for (const key of Object.keys(value)) {\n let nodeKey;\n if (isValidIdentifier(key)) {\n nodeKey = identifier(key);\n } else {\n nodeKey = stringLiteral(key);\n }\n props.push(\n objectProperty(\n nodeKey,\n valueToNode(\n // @ts-expect-error key must present in value\n value[key],\n ),\n ),\n );\n }\n return objectExpression(props);\n }\n\n throw new Error(\"don't know how to turn this value into a node\");\n}\n"],"mappings":";;;;;;AAAA;AACA;AAY+B,eAGhBA,WAAW;AAAA;AAkB1B,MAAMC,cAA0C,GAAGC,QAAQ,CAACC,IAAI,CAACC,IAAI,CACnEC,MAAM,CAACC,SAAS,CAACC,QAAQ,CAC1B;AAED,SAASC,QAAQ,CAACC,KAAc,EAAmB;EACjD,OAAOR,cAAc,CAACQ,KAAK,CAAC,KAAK,iBAAiB;AACpD;AAEA,SAASC,aAAa,CAACD,KAAc,EAAmB;EACtD,IACE,OAAOA,KAAK,KAAK,QAAQ,IACzBA,KAAK,KAAK,IAAI,IACdJ,MAAM,CAACC,SAAS,CAACC,QAAQ,CAACJ,IAAI,CAACM,KAAK,CAAC,KAAK,iBAAiB,EAC3D;IACA,OAAO,KAAK;EACd;EACA,MAAME,KAAK,GAAGN,MAAM,CAACO,cAAc,CAACH,KAAK,CAAC;EAI1C,OAAOE,KAAK,KAAK,IAAI,IAAIN,MAAM,CAACO,cAAc,CAACD,KAAK,CAAC,KAAK,IAAI;AAChE;AAEA,SAASX,WAAW,CAACS,KAAc,EAAgB;EAEjD,IAAIA,KAAK,KAAKI,SAAS,EAAE;IACvB,OAAO,IAAAC,qBAAU,EAAC,WAAW,CAAC;EAChC;;EAGA,IAAIL,KAAK,KAAK,IAAI,IAAIA,KAAK,KAAK,KAAK,EAAE;IACrC,OAAO,IAAAM,yBAAc,EAACN,KAAK,CAAC;EAC9B;;EAGA,IAAIA,KAAK,KAAK,IAAI,EAAE;IAClB,OAAO,IAAAO,sBAAW,GAAE;EACtB;;EAGA,IAAI,OAAOP,KAAK,KAAK,QAAQ,EAAE;IAC7B,OAAO,IAAAQ,wBAAa,EAACR,KAAK,CAAC;EAC7B;;EAGA,IAAI,OAAOA,KAAK,KAAK,QAAQ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C,IAAI,CAAC/B,KAAK,CAAC,EAAE;MACpC,IAAIgC,OAAO;MACX,IAAI,IAAAC,0BAAiB,EAACH,GAAG,CAAC,EAAE;QAC1BE,OAAO,GAAG,IAAA3B,qBAAU,EAACyB,GAAG,CAAC;MAC3B,CAAC,MAAM;QACLE,OAAO,GAAG,IAAAxB,wBAAa,EAACsB,GAAG,CAAC;MAC9B;MACAD,KAAK,CAACK,IAAI,CACR,IAAAC,yBAAc,EACZH,OAAO,EACPzC,WAAW;MAETS,KAAK,CAAC8B,GAAG,CAAC,CACX,CACF,CACF;IACH;IACA,OAAO,IAAAM,2BAAgB,EAACP,KAAK,CAAC;EAChC;EAEA,MAAM,IAAIQ,KAAK,CAAC,+CAA+C,CAAC;AAClE"}
1
+ {"version":3,"names":["valueToNode","objectToString","Function","call","bind","Object","prototype","toString","isRegExp","value","isPlainObject","proto","getPrototypeOf","undefined","identifier","booleanLiteral","nullLiteral","stringLiteral","result","Number","isFinite","numericLiteral","Math","abs","numerator","isNaN","binaryExpression","is","unaryExpression","pattern","source","flags","match","regExpLiteral","Array","isArray","arrayExpression","map","props","key","keys","nodeKey","isValidIdentifier","push","objectProperty","objectExpression","Error"],"sources":["../../src/converters/valueToNode.ts"],"sourcesContent":["import isValidIdentifier from \"../validators/isValidIdentifier\";\nimport {\n identifier,\n booleanLiteral,\n nullLiteral,\n stringLiteral,\n numericLiteral,\n regExpLiteral,\n arrayExpression,\n objectProperty,\n objectExpression,\n unaryExpression,\n binaryExpression,\n} from \"../builders/generated\";\nimport type * as t from \"..\";\n\nexport default valueToNode as {\n (value: undefined): t.Identifier; // TODO: This should return \"void 0\"\n (value: boolean): t.BooleanLiteral;\n (value: null): t.NullLiteral;\n (value: string): t.StringLiteral;\n // Infinities and NaN need to use a BinaryExpression; negative values must be wrapped in UnaryExpression\n (value: number): t.NumericLiteral | t.BinaryExpression | t.UnaryExpression;\n (value: RegExp): t.RegExpLiteral;\n (value: ReadonlyArray<unknown>): t.ArrayExpression;\n\n // this throws with objects that are not plain objects,\n // or if there are non-valueToNode-able values\n (value: object): t.ObjectExpression;\n\n (value: unknown): t.Expression;\n};\n\n// @ts-expect-error: Object.prototype.toString must return a string\nconst objectToString: (value: unknown) => string = Function.call.bind(\n Object.prototype.toString,\n);\n\nfunction isRegExp(value: unknown): value is RegExp {\n return objectToString(value) === \"[object RegExp]\";\n}\n\nfunction isPlainObject(value: unknown): value is object {\n if (\n typeof value !== \"object\" ||\n value === null ||\n Object.prototype.toString.call(value) !== \"[object Object]\"\n ) {\n return false;\n }\n const proto = Object.getPrototypeOf(value);\n // Object.prototype's __proto__ is null. Every other class's __proto__.__proto__ is\n // not null by default. We cannot check if proto === Object.prototype because it\n // could come from another realm.\n return proto === null || Object.getPrototypeOf(proto) === null;\n}\n\nfunction valueToNode(value: unknown): t.Expression {\n // undefined\n if (value === undefined) {\n return identifier(\"undefined\");\n }\n\n // boolean\n if (value === true || value === false) {\n return booleanLiteral(value);\n }\n\n // null\n if (value === null) {\n return nullLiteral();\n }\n\n // strings\n if (typeof value === \"string\") {\n return stringLiteral(value);\n }\n\n // numbers\n if (typeof value === \"number\") {\n let result;\n if (Number.isFinite(value)) {\n result = numericLiteral(Math.abs(value));\n } else {\n let numerator;\n if (Number.isNaN(value)) {\n // NaN\n numerator = numericLiteral(0);\n } else {\n // Infinity / -Infinity\n numerator = numericLiteral(1);\n }\n\n result = binaryExpression(\"/\", numerator, numericLiteral(0));\n }\n\n if (value < 0 || Object.is(value, -0)) {\n result = unaryExpression(\"-\", result);\n }\n\n return result;\n }\n\n // regexes\n if (isRegExp(value)) {\n const pattern = value.source;\n const flags = value.toString().match(/\\/([a-z]+|)$/)[1];\n return regExpLiteral(pattern, flags);\n }\n\n // array\n if (Array.isArray(value)) {\n return arrayExpression(value.map(valueToNode));\n }\n\n // object\n if (isPlainObject(value)) {\n const props = [];\n for (const key of Object.keys(value)) {\n let nodeKey;\n if (isValidIdentifier(key)) {\n nodeKey = identifier(key);\n } else {\n nodeKey = stringLiteral(key);\n }\n props.push(\n objectProperty(\n nodeKey,\n valueToNode(\n // @ts-expect-error key must present in value\n value[key],\n ),\n ),\n );\n }\n return objectExpression(props);\n }\n\n throw new Error(\"don't know how to turn this value into a node\");\n}\n"],"mappings":";;;;;;AAAA;AACA;AAY+B,eAGhBA,WAAW;AAAA;AAkB1B,MAAMC,cAA0C,GAAGC,QAAQ,CAACC,IAAI,CAACC,IAAI,CACnEC,MAAM,CAACC,SAAS,CAACC,QAAQ,CAC1B;AAED,SAASC,QAAQ,CAACC,KAAc,EAAmB;EACjD,OAAOR,cAAc,CAACQ,KAAK,CAAC,KAAK,iBAAiB;AACpD;AAEA,SAASC,aAAa,CAACD,KAAc,EAAmB;EACtD,IACE,OAAOA,KAAK,KAAK,QAAQ,IACzBA,KAAK,KAAK,IAAI,IACdJ,MAAM,CAACC,SAAS,CAACC,QAAQ,CAACJ,IAAI,CAACM,KAAK,CAAC,KAAK,iBAAiB,EAC3D;IACA,OAAO,KAAK;EACd;EACA,MAAME,KAAK,GAAGN,MAAM,CAACO,cAAc,CAACH,KAAK,CAAC;EAI1C,OAAOE,KAAK,KAAK,IAAI,IAAIN,MAAM,CAACO,cAAc,CAACD,KAAK,CAAC,KAAK,IAAI;AAChE;AAEA,SAASX,WAAW,CAACS,KAAc,EAAgB;EAEjD,IAAIA,KAAK,KAAKI,SAAS,EAAE;IACvB,OAAO,IAAAC,qBAAU,EAAC,WAAW,CAAC;EAChC;EAGA,IAAIL,KAAK,KAAK,IAAI,IAAIA,KAAK,KAAK,KAAK,EAAE;IACrC,OAAO,IAAAM,yBAAc,EAACN,KAAK,CAAC;EAC9B;EAGA,IAAIA,KAAK,KAAK,IAAI,EAAE;IAClB,OAAO,IAAAO,sBAAW,GAAE;EACtB;EAGA,IAAI,OAAOP,KAAK,KAAK,QAAQ,EAAE;IAC7B,OAAO,IAAAQ,wBAAa,EAACR,KAAK,CAAC;EAC7B;EAGA,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;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