babel-plugin-transform-inline-environment-variables
Advanced tools
Comparing version 0.3.0-alpha.7f4dc3d4 to 0.3.0-alpha.879f25ec
"use strict"; | ||
module.exports = function (_ref) { | ||
var t = _ref.types; | ||
module.exports = function ({ types: t }) { | ||
return { | ||
name: "transform-inline-environment-variables", | ||
visitor: { | ||
MemberExpression(path, _ref2) { | ||
var _ref2$opts = _ref2.opts; | ||
_ref2$opts = _ref2$opts === undefined ? {} : _ref2$opts; | ||
var include = _ref2$opts.include, | ||
exclude = _ref2$opts.exclude; | ||
MemberExpression(path, { opts: { include, exclude } = {} }) { | ||
if (path.get("object").matchesPattern("process.env")) { | ||
var key = path.toComputedKey(); | ||
const key = path.toComputedKey(); | ||
if (t.isStringLiteral(key) && (!include || include.indexOf(key.value) !== -1) && (!exclude || exclude.indexOf(key.value) === -1)) { | ||
@@ -18,0 +11,0 @@ path.replaceWith(t.valueToNode(process.env[key.value])); |
{ | ||
"name": "babel-plugin-transform-inline-environment-variables", | ||
"version": "0.3.0-alpha.7f4dc3d4", | ||
"version": "0.3.0-alpha.879f25ec", | ||
"description": "Inline environment variables.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
2027
15