babel-plugin-jest-hoist
Advanced tools
Comparing version 28.1.3 to 29.0.0-alpha.0
@@ -155,7 +155,3 @@ 'use strict'; | ||
if ( | ||
binding !== null && | ||
binding !== void 0 && | ||
binding.path.isVariableDeclarator() | ||
) { | ||
if (binding?.path.isVariableDeclarator()) { | ||
const {node} = binding.path; | ||
@@ -242,4 +238,2 @@ const initNode = node.init; | ||
const extractJestObjExprIfHoistable = expr => { | ||
var _FUNCTIONS$propertyNa; | ||
if (!expr.isCallExpression()) { | ||
@@ -269,7 +263,3 @@ return null; | ||
const functionLooksHoistable = | ||
(_FUNCTIONS$propertyNa = FUNCTIONS[propertyName]) === null || | ||
_FUNCTIONS$propertyNa === void 0 | ||
? void 0 | ||
: _FUNCTIONS$propertyNa.call(FUNCTIONS, args); | ||
const functionLooksHoistable = FUNCTIONS[propertyName]?.(args); | ||
return functionLooksHoistable ? jestObjExpr : null; | ||
@@ -342,4 +332,2 @@ }; | ||
function visitCallExpr(callExpr) { | ||
var _self$jestObjGetterId; | ||
const { | ||
@@ -351,7 +339,3 @@ node: {callee} | ||
(0, _types().isIdentifier)(callee) && | ||
callee.name === | ||
((_self$jestObjGetterId = self.jestObjGetterIdentifier) === | ||
null || _self$jestObjGetterId === void 0 | ||
? void 0 | ||
: _self$jestObjGetterId.name) | ||
callee.name === self.jestObjGetterIdentifier?.name | ||
) { | ||
@@ -358,0 +342,0 @@ const mockStmt = callExpr.getStatementParent(); |
{ | ||
"name": "babel-plugin-jest-hoist", | ||
"version": "28.1.3", | ||
"version": "29.0.0-alpha.0", | ||
"repository": { | ||
@@ -10,3 +10,3 @@ "type": "git", | ||
"engines": { | ||
"node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" | ||
"node": "^14.15.0 || ^16.10.0 || >=18.0.0" | ||
}, | ||
@@ -41,3 +41,3 @@ "license": "MIT", | ||
}, | ||
"gitHead": "2cce069800dab3fc8ca7c469b32d2e2b2f7e2bb1" | ||
"gitHead": "6862afb00307b52f32eedee977a9b3041355f184" | ||
} |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
13266
335
2