index.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. var helperPluginUtils = require('@babel/helper-plugin-utils');
  4. var core = require('@babel/core');
  5. function isPureVoid(node) {
  6. return core.types.isUnaryExpression(node) && node.operator === "void" && core.types.isPureish(node.argument);
  7. }
  8. function unshiftForXStatementBody(statementPath, newStatements) {
  9. statementPath.ensureBlock();
  10. const {
  11. scope,
  12. node
  13. } = statementPath;
  14. const bodyScopeBindings = statementPath.get("body").scope.bindings;
  15. const hasShadowedBlockScopedBindings = Object.keys(bodyScopeBindings).some(name => scope.hasBinding(name));
  16. if (hasShadowedBlockScopedBindings) {
  17. node.body = core.types.blockStatement([...newStatements, node.body]);
  18. } else {
  19. node.body.body.unshift(...newStatements);
  20. }
  21. }
  22. function hasArrayRest(pattern) {
  23. return pattern.elements.some(elem => core.types.isRestElement(elem));
  24. }
  25. function hasObjectRest(pattern) {
  26. return pattern.properties.some(prop => core.types.isRestElement(prop));
  27. }
  28. const STOP_TRAVERSAL = {};
  29. const arrayUnpackVisitor = (node, ancestors, state) => {
  30. if (!ancestors.length) {
  31. return;
  32. }
  33. if (core.types.isIdentifier(node) && core.types.isReferenced(node, ancestors[ancestors.length - 1].node) && state.bindings[node.name]) {
  34. state.deopt = true;
  35. throw STOP_TRAVERSAL;
  36. }
  37. };
  38. class DestructuringTransformer {
  39. constructor(opts) {
  40. this.blockHoist = void 0;
  41. this.operator = void 0;
  42. this.arrayRefSet = void 0;
  43. this.nodes = void 0;
  44. this.scope = void 0;
  45. this.kind = void 0;
  46. this.iterableIsArray = void 0;
  47. this.arrayLikeIsIterable = void 0;
  48. this.objectRestNoSymbols = void 0;
  49. this.useBuiltIns = void 0;
  50. this.addHelper = void 0;
  51. this.blockHoist = opts.blockHoist;
  52. this.operator = opts.operator;
  53. this.arrayRefSet = new Set();
  54. this.nodes = opts.nodes || [];
  55. this.scope = opts.scope;
  56. this.kind = opts.kind;
  57. this.iterableIsArray = opts.iterableIsArray;
  58. this.arrayLikeIsIterable = opts.arrayLikeIsIterable;
  59. this.objectRestNoSymbols = opts.objectRestNoSymbols;
  60. this.useBuiltIns = opts.useBuiltIns;
  61. this.addHelper = opts.addHelper;
  62. }
  63. getExtendsHelper() {
  64. return this.useBuiltIns ? core.types.memberExpression(core.types.identifier("Object"), core.types.identifier("assign")) : this.addHelper("extends");
  65. }
  66. buildVariableAssignment(id, init) {
  67. let op = this.operator;
  68. if (core.types.isMemberExpression(id)) op = "=";
  69. let node;
  70. if (op) {
  71. node = core.types.expressionStatement(core.types.assignmentExpression(op, id, core.types.cloneNode(init) || this.scope.buildUndefinedNode()));
  72. } else {
  73. let nodeInit;
  74. if ((this.kind === "const" || this.kind === "using") && init === null) {
  75. nodeInit = this.scope.buildUndefinedNode();
  76. } else {
  77. nodeInit = core.types.cloneNode(init);
  78. }
  79. node = core.types.variableDeclaration(this.kind, [core.types.variableDeclarator(id, nodeInit)]);
  80. }
  81. node._blockHoist = this.blockHoist;
  82. return node;
  83. }
  84. buildVariableDeclaration(id, init) {
  85. const declar = core.types.variableDeclaration("var", [core.types.variableDeclarator(core.types.cloneNode(id), core.types.cloneNode(init))]);
  86. declar._blockHoist = this.blockHoist;
  87. return declar;
  88. }
  89. push(id, _init) {
  90. const init = core.types.cloneNode(_init);
  91. if (core.types.isObjectPattern(id)) {
  92. this.pushObjectPattern(id, init);
  93. } else if (core.types.isArrayPattern(id)) {
  94. this.pushArrayPattern(id, init);
  95. } else if (core.types.isAssignmentPattern(id)) {
  96. this.pushAssignmentPattern(id, init);
  97. } else {
  98. this.nodes.push(this.buildVariableAssignment(id, init));
  99. }
  100. }
  101. toArray(node, count) {
  102. if (this.iterableIsArray || core.types.isIdentifier(node) && this.arrayRefSet.has(node.name)) {
  103. return node;
  104. } else {
  105. return this.scope.toArray(node, count, this.arrayLikeIsIterable);
  106. }
  107. }
  108. pushAssignmentPattern({
  109. left,
  110. right
  111. }, valueRef) {
  112. if (isPureVoid(valueRef)) {
  113. this.push(left, right);
  114. return;
  115. }
  116. const tempId = this.scope.generateUidIdentifierBasedOnNode(valueRef);
  117. this.nodes.push(this.buildVariableDeclaration(tempId, valueRef));
  118. const tempConditional = core.types.conditionalExpression(core.types.binaryExpression("===", core.types.cloneNode(tempId), this.scope.buildUndefinedNode()), right, core.types.cloneNode(tempId));
  119. if (core.types.isPattern(left)) {
  120. let patternId;
  121. let node;
  122. if (this.kind === "const" || this.kind === "let" || this.kind === "using") {
  123. patternId = this.scope.generateUidIdentifier(tempId.name);
  124. node = this.buildVariableDeclaration(patternId, tempConditional);
  125. } else {
  126. patternId = tempId;
  127. node = core.types.expressionStatement(core.types.assignmentExpression("=", core.types.cloneNode(tempId), tempConditional));
  128. }
  129. this.nodes.push(node);
  130. this.push(left, patternId);
  131. } else {
  132. this.nodes.push(this.buildVariableAssignment(left, tempConditional));
  133. }
  134. }
  135. pushObjectRest(pattern, objRef, spreadProp, spreadPropIndex) {
  136. const value = buildObjectExcludingKeys(pattern.properties.slice(0, spreadPropIndex), objRef, this.scope, name => this.addHelper(name), this.objectRestNoSymbols, this.useBuiltIns);
  137. this.nodes.push(this.buildVariableAssignment(spreadProp.argument, value));
  138. }
  139. pushObjectProperty(prop, propRef) {
  140. if (core.types.isLiteral(prop.key)) prop.computed = true;
  141. const pattern = prop.value;
  142. const objRef = core.types.memberExpression(core.types.cloneNode(propRef), prop.key, prop.computed);
  143. if (core.types.isPattern(pattern)) {
  144. this.push(pattern, objRef);
  145. } else {
  146. this.nodes.push(this.buildVariableAssignment(pattern, objRef));
  147. }
  148. }
  149. pushObjectPattern(pattern, objRef) {
  150. if (!pattern.properties.length) {
  151. this.nodes.push(core.types.expressionStatement(core.types.callExpression(this.addHelper("objectDestructuringEmpty"), isPureVoid(objRef) ? [] : [objRef])));
  152. return;
  153. }
  154. if (pattern.properties.length > 1 && !this.scope.isStatic(objRef)) {
  155. const temp = this.scope.generateUidIdentifierBasedOnNode(objRef);
  156. this.nodes.push(this.buildVariableDeclaration(temp, objRef));
  157. objRef = temp;
  158. }
  159. if (hasObjectRest(pattern)) {
  160. let copiedPattern;
  161. for (let i = 0; i < pattern.properties.length; i++) {
  162. const prop = pattern.properties[i];
  163. if (core.types.isRestElement(prop)) {
  164. break;
  165. }
  166. const key = prop.key;
  167. if (prop.computed && !this.scope.isPure(key)) {
  168. const name = this.scope.generateUidIdentifierBasedOnNode(key);
  169. this.nodes.push(
  170. this.buildVariableDeclaration(name, key));
  171. if (!copiedPattern) {
  172. copiedPattern = pattern = Object.assign({}, pattern, {
  173. properties: pattern.properties.slice()
  174. });
  175. }
  176. copiedPattern.properties[i] = Object.assign({}, prop, {
  177. key: name
  178. });
  179. }
  180. }
  181. }
  182. for (let i = 0; i < pattern.properties.length; i++) {
  183. const prop = pattern.properties[i];
  184. if (core.types.isRestElement(prop)) {
  185. this.pushObjectRest(pattern, objRef, prop, i);
  186. } else {
  187. this.pushObjectProperty(prop, objRef);
  188. }
  189. }
  190. }
  191. canUnpackArrayPattern(pattern, arr) {
  192. if (!core.types.isArrayExpression(arr)) return false;
  193. if (pattern.elements.length > arr.elements.length) return;
  194. if (pattern.elements.length < arr.elements.length && !hasArrayRest(pattern)) {
  195. return false;
  196. }
  197. for (const elem of pattern.elements) {
  198. if (!elem) return false;
  199. if (core.types.isMemberExpression(elem)) return false;
  200. }
  201. for (const elem of arr.elements) {
  202. if (core.types.isSpreadElement(elem)) return false;
  203. if (core.types.isCallExpression(elem)) return false;
  204. if (core.types.isMemberExpression(elem)) return false;
  205. }
  206. const bindings = core.types.getBindingIdentifiers(pattern);
  207. const state = {
  208. deopt: false,
  209. bindings
  210. };
  211. try {
  212. core.types.traverse(arr, arrayUnpackVisitor, state);
  213. } catch (e) {
  214. if (e !== STOP_TRAVERSAL) throw e;
  215. }
  216. return !state.deopt;
  217. }
  218. pushUnpackedArrayPattern(pattern, arr) {
  219. const holeToUndefined = el => el != null ? el : this.scope.buildUndefinedNode();
  220. for (let i = 0; i < pattern.elements.length; i++) {
  221. const elem = pattern.elements[i];
  222. if (core.types.isRestElement(elem)) {
  223. this.push(elem.argument, core.types.arrayExpression(arr.elements.slice(i).map(holeToUndefined)));
  224. } else {
  225. this.push(elem, holeToUndefined(arr.elements[i]));
  226. }
  227. }
  228. }
  229. pushArrayPattern(pattern, arrayRef) {
  230. if (arrayRef === null) {
  231. this.nodes.push(core.types.expressionStatement(core.types.callExpression(this.addHelper("objectDestructuringEmpty"), [])));
  232. return;
  233. }
  234. if (!pattern.elements) return;
  235. if (this.canUnpackArrayPattern(pattern, arrayRef)) {
  236. return this.pushUnpackedArrayPattern(pattern, arrayRef);
  237. }
  238. const count = !hasArrayRest(pattern) && pattern.elements.length;
  239. const toArray = this.toArray(arrayRef, count);
  240. if (core.types.isIdentifier(toArray)) {
  241. arrayRef = toArray;
  242. } else {
  243. arrayRef = this.scope.generateUidIdentifierBasedOnNode(arrayRef);
  244. this.arrayRefSet.add(arrayRef.name);
  245. this.nodes.push(this.buildVariableDeclaration(arrayRef, toArray));
  246. }
  247. for (let i = 0; i < pattern.elements.length; i++) {
  248. const elem = pattern.elements[i];
  249. if (!elem) continue;
  250. let elemRef;
  251. if (core.types.isRestElement(elem)) {
  252. elemRef = this.toArray(arrayRef);
  253. elemRef = core.types.callExpression(core.types.memberExpression(elemRef, core.types.identifier("slice")), [core.types.numericLiteral(i)]);
  254. this.push(elem.argument, elemRef);
  255. } else {
  256. elemRef = core.types.memberExpression(arrayRef, core.types.numericLiteral(i), true);
  257. this.push(elem, elemRef);
  258. }
  259. }
  260. }
  261. init(pattern, ref) {
  262. if (!core.types.isArrayExpression(ref) && !core.types.isMemberExpression(ref)) {
  263. const memo = this.scope.maybeGenerateMemoised(ref, true);
  264. if (memo) {
  265. this.nodes.push(this.buildVariableDeclaration(memo, core.types.cloneNode(ref)));
  266. ref = memo;
  267. }
  268. }
  269. this.push(pattern, ref);
  270. return this.nodes;
  271. }
  272. }
  273. function buildObjectExcludingKeys(excludedKeys, objRef, scope, addHelper, objectRestNoSymbols, useBuiltIns) {
  274. const keys = [];
  275. let allLiteral = true;
  276. let hasTemplateLiteral = false;
  277. for (let i = 0; i < excludedKeys.length; i++) {
  278. const prop = excludedKeys[i];
  279. const key = prop.key;
  280. if (core.types.isIdentifier(key) && !prop.computed) {
  281. keys.push(core.types.stringLiteral(key.name));
  282. } else if (core.types.isTemplateLiteral(key)) {
  283. keys.push(core.types.cloneNode(key));
  284. hasTemplateLiteral = true;
  285. } else if (core.types.isLiteral(key)) {
  286. keys.push(core.types.stringLiteral(String(key.value)));
  287. } else if (core.types.isPrivateName(key)) ; else {
  288. keys.push(core.types.cloneNode(key));
  289. allLiteral = false;
  290. }
  291. }
  292. let value;
  293. if (keys.length === 0) {
  294. const extendsHelper = useBuiltIns ? core.types.memberExpression(core.types.identifier("Object"), core.types.identifier("assign")) : addHelper("extends");
  295. value = core.types.callExpression(extendsHelper, [core.types.objectExpression([]), core.types.sequenceExpression([core.types.callExpression(addHelper("objectDestructuringEmpty"), [core.types.cloneNode(objRef)]), core.types.cloneNode(objRef)])]);
  296. } else {
  297. let keyExpression = core.types.arrayExpression(keys);
  298. if (!allLiteral) {
  299. keyExpression = core.types.callExpression(core.types.memberExpression(keyExpression, core.types.identifier("map")), [addHelper("toPropertyKey")]);
  300. } else if (!hasTemplateLiteral && !core.types.isProgram(scope.block)) {
  301. const programScope = scope.getProgramParent();
  302. const id = programScope.generateUidIdentifier("excluded");
  303. programScope.push({
  304. id,
  305. init: keyExpression,
  306. kind: "const"
  307. });
  308. keyExpression = core.types.cloneNode(id);
  309. }
  310. value = core.types.callExpression(addHelper(`objectWithoutProperties${objectRestNoSymbols ? "Loose" : ""}`), [core.types.cloneNode(objRef), keyExpression]);
  311. }
  312. return value;
  313. }
  314. function convertVariableDeclaration(path, addHelper, arrayLikeIsIterable, iterableIsArray, objectRestNoSymbols, useBuiltIns) {
  315. const {
  316. node,
  317. scope
  318. } = path;
  319. const nodeKind = node.kind;
  320. const nodeLoc = node.loc;
  321. const nodes = [];
  322. for (let i = 0; i < node.declarations.length; i++) {
  323. const declar = node.declarations[i];
  324. const patternId = declar.init;
  325. const pattern = declar.id;
  326. const destructuring = new DestructuringTransformer({
  327. blockHoist: node._blockHoist,
  328. nodes: nodes,
  329. scope: scope,
  330. kind: node.kind,
  331. iterableIsArray,
  332. arrayLikeIsIterable,
  333. useBuiltIns,
  334. objectRestNoSymbols,
  335. addHelper
  336. });
  337. if (core.types.isPattern(pattern)) {
  338. destructuring.init(pattern, patternId);
  339. if (+i !== node.declarations.length - 1) {
  340. core.types.inherits(nodes[nodes.length - 1], declar);
  341. }
  342. } else {
  343. nodes.push(core.types.inherits(destructuring.buildVariableAssignment(pattern, patternId), declar));
  344. }
  345. }
  346. let tail = null;
  347. let nodesOut = [];
  348. for (const node of nodes) {
  349. if (core.types.isVariableDeclaration(node)) {
  350. if (tail !== null) {
  351. tail.declarations.push(...node.declarations);
  352. continue;
  353. } else {
  354. node.kind = nodeKind;
  355. tail = node;
  356. }
  357. } else {
  358. tail = null;
  359. }
  360. if (!node.loc) {
  361. node.loc = nodeLoc;
  362. }
  363. nodesOut.push(node);
  364. }
  365. if (nodesOut.length === 2 && core.types.isVariableDeclaration(nodesOut[0]) && core.types.isExpressionStatement(nodesOut[1]) && core.types.isCallExpression(nodesOut[1].expression) && nodesOut[0].declarations.length === 1) {
  366. const expr = nodesOut[1].expression;
  367. expr.arguments = [nodesOut[0].declarations[0].init];
  368. nodesOut = [expr];
  369. } else {
  370. if (core.types.isForStatement(path.parent, {
  371. init: node
  372. }) && !nodesOut.some(v => core.types.isVariableDeclaration(v))) {
  373. for (let i = 0; i < nodesOut.length; i++) {
  374. const node = nodesOut[i];
  375. if (core.types.isExpressionStatement(node)) {
  376. nodesOut[i] = node.expression;
  377. }
  378. }
  379. }
  380. }
  381. if (nodesOut.length === 1) {
  382. path.replaceWith(nodesOut[0]);
  383. } else {
  384. path.replaceWithMultiple(nodesOut);
  385. }
  386. scope.crawl();
  387. }
  388. function convertAssignmentExpression(path, addHelper, arrayLikeIsIterable, iterableIsArray, objectRestNoSymbols, useBuiltIns) {
  389. const {
  390. node,
  391. scope,
  392. parentPath
  393. } = path;
  394. const nodes = [];
  395. const destructuring = new DestructuringTransformer({
  396. operator: node.operator,
  397. scope: scope,
  398. nodes: nodes,
  399. arrayLikeIsIterable,
  400. iterableIsArray,
  401. objectRestNoSymbols,
  402. useBuiltIns,
  403. addHelper
  404. });
  405. let ref;
  406. if (!parentPath.isExpressionStatement() && !parentPath.isSequenceExpression() || path.isCompletionRecord()) {
  407. ref = scope.generateUidIdentifierBasedOnNode(node.right, "ref");
  408. nodes.push(core.types.variableDeclaration("var", [core.types.variableDeclarator(ref, node.right)]));
  409. if (core.types.isArrayExpression(node.right)) {
  410. destructuring.arrayRefSet.add(ref.name);
  411. }
  412. }
  413. destructuring.init(node.left, ref || node.right);
  414. if (ref) {
  415. if (parentPath.isArrowFunctionExpression()) {
  416. path.replaceWith(core.types.blockStatement([]));
  417. nodes.push(core.types.returnStatement(core.types.cloneNode(ref)));
  418. } else {
  419. nodes.push(core.types.expressionStatement(core.types.cloneNode(ref)));
  420. }
  421. }
  422. path.replaceWithMultiple(nodes);
  423. scope.crawl();
  424. }
  425. function variableDeclarationHasPattern(node) {
  426. for (const declar of node.declarations) {
  427. if (core.types.isPattern(declar.id)) {
  428. return true;
  429. }
  430. }
  431. return false;
  432. }
  433. var index = helperPluginUtils.declare((api, options) => {
  434. var _ref, _api$assumption, _ref2, _options$allowArrayLi, _ref3, _api$assumption2;
  435. api.assertVersion(7);
  436. const {
  437. useBuiltIns = false
  438. } = options;
  439. const iterableIsArray = (_ref = (_api$assumption = api.assumption("iterableIsArray")) != null ? _api$assumption : options.loose) != null ? _ref : false;
  440. const arrayLikeIsIterable = (_ref2 = (_options$allowArrayLi = options.allowArrayLike) != null ? _options$allowArrayLi : api.assumption("arrayLikeIsIterable")) != null ? _ref2 : false;
  441. const objectRestNoSymbols = (_ref3 = (_api$assumption2 = api.assumption("objectRestNoSymbols")) != null ? _api$assumption2 : options.loose) != null ? _ref3 : false;
  442. return {
  443. name: "transform-destructuring",
  444. visitor: {
  445. ExportNamedDeclaration(path) {
  446. const declaration = path.get("declaration");
  447. if (!declaration.isVariableDeclaration()) return;
  448. if (!variableDeclarationHasPattern(declaration.node)) return;
  449. const specifiers = [];
  450. for (const name of Object.keys(path.getOuterBindingIdentifiers())) {
  451. specifiers.push(core.types.exportSpecifier(core.types.identifier(name), core.types.identifier(name)));
  452. }
  453. path.replaceWith(declaration.node);
  454. path.insertAfter(core.types.exportNamedDeclaration(null, specifiers));
  455. path.scope.crawl();
  456. },
  457. ForXStatement(path) {
  458. const {
  459. node,
  460. scope
  461. } = path;
  462. const left = node.left;
  463. if (core.types.isPattern(left)) {
  464. const temp = scope.generateUidIdentifier("ref");
  465. node.left = core.types.variableDeclaration("var", [core.types.variableDeclarator(temp)]);
  466. path.ensureBlock();
  467. const statementBody = path.node.body.body;
  468. const nodes = [];
  469. if (statementBody.length === 0 && path.isCompletionRecord()) {
  470. nodes.unshift(core.types.expressionStatement(scope.buildUndefinedNode()));
  471. }
  472. nodes.unshift(core.types.expressionStatement(core.types.assignmentExpression("=", left, core.types.cloneNode(temp))));
  473. unshiftForXStatementBody(path, nodes);
  474. scope.crawl();
  475. return;
  476. }
  477. if (!core.types.isVariableDeclaration(left)) return;
  478. const pattern = left.declarations[0].id;
  479. if (!core.types.isPattern(pattern)) return;
  480. const key = scope.generateUidIdentifier("ref");
  481. node.left = core.types.variableDeclaration(left.kind, [core.types.variableDeclarator(key, null)]);
  482. const nodes = [];
  483. const destructuring = new DestructuringTransformer({
  484. kind: left.kind,
  485. scope: scope,
  486. nodes: nodes,
  487. arrayLikeIsIterable,
  488. iterableIsArray,
  489. objectRestNoSymbols,
  490. useBuiltIns,
  491. addHelper: name => this.addHelper(name)
  492. });
  493. destructuring.init(pattern, key);
  494. unshiftForXStatementBody(path, nodes);
  495. scope.crawl();
  496. },
  497. CatchClause({
  498. node,
  499. scope
  500. }) {
  501. const pattern = node.param;
  502. if (!core.types.isPattern(pattern)) return;
  503. const ref = scope.generateUidIdentifier("ref");
  504. node.param = ref;
  505. const nodes = [];
  506. const destructuring = new DestructuringTransformer({
  507. kind: "let",
  508. scope: scope,
  509. nodes: nodes,
  510. arrayLikeIsIterable,
  511. iterableIsArray,
  512. objectRestNoSymbols,
  513. useBuiltIns,
  514. addHelper: name => this.addHelper(name)
  515. });
  516. destructuring.init(pattern, ref);
  517. node.body.body = [...nodes, ...node.body.body];
  518. scope.crawl();
  519. },
  520. AssignmentExpression(path, state) {
  521. if (!core.types.isPattern(path.node.left)) return;
  522. convertAssignmentExpression(path, name => state.addHelper(name), arrayLikeIsIterable, iterableIsArray, objectRestNoSymbols, useBuiltIns);
  523. },
  524. VariableDeclaration(path, state) {
  525. const {
  526. node,
  527. parent
  528. } = path;
  529. if (core.types.isForXStatement(parent)) return;
  530. if (!parent || !path.container) return;
  531. if (!variableDeclarationHasPattern(node)) return;
  532. convertVariableDeclaration(path, name => state.addHelper(name), arrayLikeIsIterable, iterableIsArray, objectRestNoSymbols, useBuiltIns);
  533. }
  534. }
  535. };
  536. });
  537. exports.buildObjectExcludingKeys = buildObjectExcludingKeys;
  538. exports["default"] = index;
  539. exports.unshiftForXStatementBody = unshiftForXStatementBody;
  540. //# sourceMappingURL=index.js.map