pick-from-lodash
v1.0.2
Published
For destructuring directly into a new object
Downloads
1
Readme
This is a joke but not the "haha" type
Tired of writting things like these?
const {
REACT_APP_API_KEY,
REACT_APP_AUTH_DOMAIN,
REACT_APP_DATABASE_URL,
REACT_APP_PROJECT_ID,
REACT_APP_STORAGE_BUCKET,
REACT_APP_MESSAGING_SENDER_ID
} = process.env
const config = {
apiKey: REACT_APP_API_KEY,
authDomain: REACT_APP_AUTH_DOMAIN,
databaseURL: REACT_APP_DATABASE_URL,
projectId: REACT_APP_PROJECT_ID,
storageBucket: REACT_APP_STORAGE_BUCKET,
messagingSenderId: REACT_APP_MESSAGING_SENDER_ID
}
Write like this!
const pick = require('./index')
const config = pick(process.env,
'REACT_APP_API_KEY',
'REACT_APP_AUTH_DOMAIN',
'REACT_APP_DATABASE_URL',
'REACT_APP_PROJECT_ID',
'REACT_APP_STORAGE_BUCKET',
'REACT_APP_MESSAGING_SENDER_ID'
)
The original name was different but NPM is smart and didn't allow me to publish that