unreach-util
Advanced tools
Comparing version 0.10.1 to 0.11.0
24
env.js
@@ -1,2 +0,24 @@ | ||
const env = process.env.REACT_APP_ENV || process.env.NODE_ENV || 'development'; | ||
import qs from 'query-string'; | ||
import storage from './storage'; | ||
// try get from url for debug | ||
const query = qs.parse(window.location.search); | ||
const qsenv = query['debug.env']; | ||
if (qsenv !== undefined) { | ||
if (qsenv) { | ||
storage.set('debug.env', qsenv); | ||
} else { | ||
storage.remove('debug.env'); | ||
} | ||
} | ||
const env = storage.get('debug.env') || | ||
process.env.REACT_APP_ENV || | ||
process.env.NODE_ENV || 'development'; | ||
console.log(`LOG: env is ${env}`); // eslint-disable-line | ||
export default env; |
{ | ||
"name": "unreach-util", | ||
"version": "0.10.1", | ||
"version": "0.11.0", | ||
"description": "前端工具基础库", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
14183
453
2