@babel/helper-remap-async-to-generator
Advanced tools
Comparing version 7.21.4-esm to 7.21.4-esm.1
@@ -1,12 +0,6 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = _default; | ||
var _helperWrapFunction = require("@babel/helper-wrap-function"); | ||
var _helperAnnotateAsPure = require("@babel/helper-annotate-as-pure"); | ||
var _helperEnvironmentVisitor = require("@babel/helper-environment-visitor"); | ||
var _core = require("@babel/core"); | ||
var _t = require("@babel/types"); | ||
import wrapFunction from "@babel/helper-wrap-function"; | ||
import annotateAsPure from "@babel/helper-annotate-as-pure"; | ||
import environmentVisitor from "@babel/helper-environment-visitor"; | ||
import { traverse } from "@babel/core"; | ||
import * as _t from "@babel/types"; | ||
const { | ||
@@ -19,3 +13,3 @@ callExpression, | ||
} = _t; | ||
const awaitVisitor = _core.traverse.visitors.merge([{ | ||
const awaitVisitor = traverse.visitors.merge([{ | ||
ArrowFunctionExpression(path) { | ||
@@ -30,4 +24,4 @@ path.skip(); | ||
} | ||
}, _helperEnvironmentVisitor.default]); | ||
function _default(path, helpers, noNewArrows, ignoreFunctionLength) { | ||
}, environmentVisitor]); | ||
export default function (path, helpers, noNewArrows, ignoreFunctionLength) { | ||
path.traverse(awaitVisitor, { | ||
@@ -39,6 +33,6 @@ wrapAwait: helpers.wrapAwait | ||
path.node.generator = true; | ||
(0, _helperWrapFunction.default)(path, cloneNode(helpers.wrapAsync), noNewArrows, ignoreFunctionLength); | ||
wrapFunction(path, cloneNode(helpers.wrapAsync), noNewArrows, ignoreFunctionLength); | ||
const isProperty = path.isObjectMethod() || path.isClassMethod() || path.parentPath.isObjectProperty() || path.parentPath.isClassProperty(); | ||
if (!isProperty && !isIIFE && path.isExpression()) { | ||
(0, _helperAnnotateAsPure.default)(path); | ||
annotateAsPure(path); | ||
} | ||
@@ -45,0 +39,0 @@ function checkIsIIFE(path) { |
{ | ||
"name": "@babel/helper-remap-async-to-generator", | ||
"version": "7.21.4-esm", | ||
"version": "7.21.4-esm.1", | ||
"description": "Helper function to remap async functions to generators", | ||
@@ -17,13 +17,13 @@ "repository": { | ||
"dependencies": { | ||
"@babel/helper-annotate-as-pure": "^7.21.4-esm", | ||
"@babel/helper-environment-visitor": "^7.21.4-esm", | ||
"@babel/helper-wrap-function": "^7.21.4-esm", | ||
"@babel/types": "^7.21.4-esm" | ||
"@babel/helper-annotate-as-pure": "^7.21.4-esm.1", | ||
"@babel/helper-environment-visitor": "^7.21.4-esm.1", | ||
"@babel/helper-wrap-function": "^7.21.4-esm.1", | ||
"@babel/types": "^7.21.4-esm.1" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.21.4-esm", | ||
"@babel/traverse": "^7.21.4-esm" | ||
"@babel/core": "^7.21.4-esm.1", | ||
"@babel/traverse": "^7.21.4-esm.1" | ||
}, | ||
"peerDependencies": { | ||
"@babel/core": "^7.0.0 || 7.21.4-esm" | ||
"@babel/core": "^7.0.0 || 7.21.4-esm.1" | ||
}, | ||
@@ -34,3 +34,3 @@ "engines": { | ||
"author": "The Babel Team (https://babel.dev/team)", | ||
"type": "commonjs" | ||
"type": "module" | ||
} |
Sorry, the diff of this file is not supported yet
Yes
9825
58