babel-helper-explode-assignable-expression
Advanced tools
Comparing version 7.0.0-beta.2 to 7.0.0-beta.3
"use strict"; | ||
exports.__esModule = true; | ||
exports.default = _default; | ||
exports.default = function (node, nodes, file, scope, allowedSingleIdent) { | ||
var obj = void 0; | ||
var t = _interopRequireWildcard(require("babel-types")); | ||
if (t.isIdentifier(node) && allowedSingleIdent) { | ||
obj = node; | ||
} else { | ||
obj = getObjRef(node, nodes, file, scope); | ||
} | ||
var ref = void 0, | ||
uid = void 0; | ||
if (t.isIdentifier(node)) { | ||
ref = node; | ||
uid = obj; | ||
} else { | ||
var prop = getPropRef(node, nodes, file, scope); | ||
var computed = node.computed || t.isLiteral(prop); | ||
uid = ref = t.memberExpression(obj, prop, computed); | ||
} | ||
return { | ||
uid: uid, | ||
ref: ref | ||
}; | ||
}; | ||
var _babelTypes = require("babel-types"); | ||
var t = _interopRequireWildcard(_babelTypes); | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } | ||
function getObjRef(node, nodes, file, scope) { | ||
var ref = void 0; | ||
var ref; | ||
@@ -77,2 +49,28 @@ if (t.isSuper(node)) { | ||
return temp; | ||
} | ||
function _default(node, nodes, file, scope, allowedSingleIdent) { | ||
var obj; | ||
if (t.isIdentifier(node) && allowedSingleIdent) { | ||
obj = node; | ||
} else { | ||
obj = getObjRef(node, nodes, file, scope); | ||
} | ||
var ref, uid; | ||
if (t.isIdentifier(node)) { | ||
ref = node; | ||
uid = obj; | ||
} else { | ||
var prop = getPropRef(node, nodes, file, scope); | ||
var computed = node.computed || t.isLiteral(prop); | ||
uid = ref = t.memberExpression(obj, prop, computed); | ||
} | ||
return { | ||
uid: uid, | ||
ref: ref | ||
}; | ||
} |
{ | ||
"name": "babel-helper-explode-assignable-expression", | ||
"version": "7.0.0-beta.2", | ||
"version": "7.0.0-beta.3", | ||
"description": "Helper function to explode an assignable expression", | ||
@@ -9,5 +9,5 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-explode-assignable-expression", | ||
"dependencies": { | ||
"babel-traverse": "7.0.0-beta.2", | ||
"babel-types": "7.0.0-beta.2" | ||
"babel-traverse": "7.0.0-beta.3", | ||
"babel-types": "7.0.0-beta.3" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2381
61
+ Addedbabel-code-frame@7.0.0-beta.3(transitive)
+ Addedbabel-helper-function-name@7.0.0-beta.3(transitive)
+ Addedbabel-helper-get-function-arity@7.0.0-beta.3(transitive)
+ Addedbabel-template@7.0.0-beta.3(transitive)
+ Addedbabel-traverse@7.0.0-beta.3(transitive)
+ Addedbabel-types@7.0.0-beta.3(transitive)
+ Addedbabylon@7.0.0-beta.27(transitive)
- Removedbabel-code-frame@7.0.0-beta.2(transitive)
- Removedbabel-helper-function-name@7.0.0-beta.2(transitive)
- Removedbabel-helper-get-function-arity@7.0.0-beta.2(transitive)
- Removedbabel-messages@7.0.0-beta.2(transitive)
- Removedbabel-template@7.0.0-beta.2(transitive)
- Removedbabel-traverse@7.0.0-beta.2(transitive)
- Removedbabel-types@7.0.0-beta.2(transitive)
- Removedbabylon@7.0.0-beta.25(transitive)
Updatedbabel-traverse@7.0.0-beta.3
Updatedbabel-types@7.0.0-beta.3