Socket
Socket
Sign inDemoInstall

babel-plugin-dotenv

Package Overview
Dependencies
1
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.0 to 0.1.1

test/fixtures/empty-values/.babelrc

7

index.js

@@ -33,4 +33,3 @@ var dotEnv = require('dotenv');

var localId = specifier.local.name;
if(!config[importedId]) {
if(!(config.hasOwnProperty(importedId))) {
throw path.get('specifiers')[idx].buildCodeFrameError('Try to import dotenv variable "' + importedId + '" which is not defined in any ' + configFile + ' files.')

@@ -41,5 +40,3 @@ }

binding.referencePaths.forEach(function(refPath){
if (config[importedId]) {
refPath.replaceWith(t.valueToNode(config[importedId]))
}
refPath.replaceWith(t.valueToNode(config[importedId]))
});

@@ -46,0 +43,0 @@ })

{
"name": "babel-plugin-dotenv",
"version": "0.1.0",
"version": "0.1.1",
"description": "Load environment variables from .env file using import statement",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -35,2 +35,7 @@ var babel = require("babel-core");

it('should load empty variable as empty string ', function(){
var result = babel.transformFileSync('test/fixtures/empty-values/source.js')
expect(result.code).to.be('\'use strict\';\n\nconsole.log(\'abc123\');\nconsole.log(\'username\');\nconsole.log(\'\');')
})
it('should load let .env.development overwrite .env', function(){

@@ -37,0 +42,0 @@ var result = babel.transformFileSync('test/fixtures/dev-env/source.js')

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc