Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-dotenv

Package Overview
Dependencies
Maintainers
3
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-dotenv - npm Package Compare versions

Comparing version 2.5.1 to 2.5.3

__tests__/__fixtures__/local-env/.babelrc

10

__tests__/index.test.js

@@ -59,2 +59,7 @@ const {transformFileSync} = require('@babel/core')

it('should load local env files', () => {
const {code} = transformFileSync(FIXTURES + 'local-env/source.js')
expect(code).toBe('console.log("local-key");\nconsole.log("username123456");')
})
it('should support `as alias` import syntax', () => {

@@ -70,2 +75,7 @@ const {code} = transformFileSync(FIXTURES + 'as-alias/source.js')

it('should allow specifying the package module name', () => {
const {code} = transformFileSync(FIXTURES + 'module-name/source.js')
expect(code).toBe('// eslint-disable-next-line import/no-unresolved\nconsole.log("abc123");\nconsole.log("username");')
})
it('should leave other imports untouched', () => {

@@ -72,0 +82,0 @@ const {code} = transformFileSync(FIXTURES + 'unused/source.js')

7

index.js

@@ -39,5 +39,10 @@ const {readFileSync} = require('fs')

const modeParsed = parseDotenvFile(this.opts.path + '.' + babelMode)
this.env = Object.assign(parsed, modeParsed)
const localParsed = parseDotenvFile(this.opts.path + '.local')
this.env = Object.assign(Object.assign(parsed, modeParsed), localParsed)
} else {
dotenv.config({
path: this.opts.path + '.local',
silent: true
})
dotenv.config({
path: this.opts.path + '.' + babelMode,

@@ -44,0 +49,0 @@ silent: true

4

package.json
{
"name": "react-native-dotenv",
"version": "2.5.1",
"version": "2.5.3",
"description": "Load environment variables using import statements.",

@@ -24,3 +24,3 @@ "repository": "github:goatandsheep/react-native-dotenv",

"devDependencies": {
"@babel/core": "7.12.10",
"@babel/core": "7.12.13",
"codecov": "^3.8.1",

@@ -27,0 +27,0 @@ "jest": "26.6.3",

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc