react-native-dotenv
Advanced tools
Comparing version 3.4.7 to 3.4.8
14
index.js
@@ -1,2 +0,2 @@ | ||
const {readFileSync, statSync} = require('fs') | ||
const fs = require('fs') | ||
const path = require('path') | ||
@@ -9,3 +9,3 @@ const dotenv = require('dotenv') | ||
try { | ||
content = readFileSync(path) | ||
content = fs.readFileSync(path) | ||
} catch (error) { | ||
@@ -53,3 +53,3 @@ // The env file does not exist. | ||
try { | ||
return statSync(filePath).mtimeMs | ||
return fs.statSync(filePath).mtimeMs | ||
} catch { | ||
@@ -86,4 +86,4 @@ return null | ||
api.cache.using(() => mtime(options.path)) | ||
api.cache.using(() => mtime(modeFilePath)) | ||
api.cache.using(() => mtime(localFilePath)) | ||
api.cache.using(() => mtime(modeFilePath)) | ||
api.cache.using(() => mtime(modeLocalFilePath)) | ||
@@ -96,8 +96,8 @@ | ||
const modeLocalParsed = parseDotenvFile(modeLocalFilePath, options.verbose) | ||
env = (options.safe) ? safeObjectAssign(undefObjectAssign(undefObjectAssign(undefObjectAssign(parsed, localParsed), modeParsed), modeLocalParsed), dotenvTemporary, ['NODE_ENV', 'BABEL_ENV', options.envName]) | ||
: undefObjectAssign(undefObjectAssign(undefObjectAssign(undefObjectAssign(parsed, localParsed), modeParsed), modeLocalParsed), dotenvTemporary) | ||
env = (options.safe) ? safeObjectAssign(undefObjectAssign(undefObjectAssign(undefObjectAssign(parsed, modeParsed), localParsed), modeLocalParsed), dotenvTemporary, ['NODE_ENV', 'BABEL_ENV', options.envName]) | ||
: undefObjectAssign(undefObjectAssign(undefObjectAssign(undefObjectAssign(parsed, modeParsed), localParsed), modeLocalParsed), dotenvTemporary) | ||
api.addExternalDependency(path.resolve(options.path)) | ||
api.addExternalDependency(path.resolve(modeFilePath)) | ||
api.addExternalDependency(path.resolve(localFilePath)) | ||
api.addExternalDependency(path.resolve(modeFilePath)) | ||
api.addExternalDependency(path.resolve(modeLocalFilePath)) | ||
@@ -104,0 +104,0 @@ |
{ | ||
"name": "react-native-dotenv", | ||
"version": "3.4.7", | ||
"version": "3.4.8", | ||
"description": "Load environment variables using import statements.", | ||
@@ -29,2 +29,3 @@ "repository": "github:goatandsheep/react-native-dotenv", | ||
"devDependencies": { | ||
"@babel/core": "^7.20.5", | ||
"codecov": "^3.8.3", | ||
@@ -37,2 +38,5 @@ "jest": "29.3.1", | ||
"license": "MIT", | ||
"files": [ | ||
"index.js" | ||
], | ||
"jest": { | ||
@@ -63,3 +67,2 @@ "testEnvironment": "node", | ||
"peerDependencies": { | ||
"@babel/core": "^7.20.5", | ||
"@babel/runtime": "^7.20.6" | ||
@@ -66,0 +69,0 @@ }, |
@@ -18,2 +18,8 @@ # react-native-dotenv [![CircleCI](https://circleci.com/gh/goatandsheep/react-native-dotenv.svg?style=svg)](https://circleci.com/gh/goatandsheep/react-native-dotenv) | ||
If you are using Yarn: | ||
```sh | ||
$ yarn add -D react-native-dotenv | ||
``` | ||
**Breaking changes**: moving from `v0.x` to `v2.x` changes both the setup and usage of this package. Please see the [migration guide](https://github.com/goatandsheep/react-native-dotenv/wiki/Migration-Guide). | ||
@@ -20,0 +26,0 @@ |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 4 instances in 1 package
2
341
10
21428
5
4
138