MCPcopy Create free account
hub / github.com/kentcdodds/kcd-scripts / parseEnv

Function parseEnv

src/utils.js:93–102  ·  view source on GitHub ↗
(name, def)

Source from the content-addressed store, hash-verified

91const ifTypescript = (t, f) => (hasTypescript ? t : f)
92
93function parseEnv(name, def) {
94 if (envIsSet(name)) {
95 try {
96 return JSON.parse(process.env[name])
97 } catch (err) {
98 return process.env[name]
99 }
100 }
101 return def
102}
103
104function envIsSet(name) {
105 return (

Callers 5

getRollupOutputFunction · 0.85
validate.jsFile · 0.85
test.jsFile · 0.85
rollup.config.jsFile · 0.85
babelrc.jsFile · 0.85

Calls 1

envIsSetFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…