Skip to content

Commit

Permalink
fix: small optimization from map to forEach (#266)
Browse files Browse the repository at this point in the history
Co-authored-by: Matt Steele <hello@mrsteele.dev>
  • Loading branch information
mrsteele and Matt Steele committed Nov 3, 2020
1 parent 93ff21b commit 00be1f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class Dotenv {

const { env, blueprint } = this.getEnvs()

Object.keys(blueprint).map(key => {
Object.keys(blueprint).forEach(key => {
const value = Object.prototype.hasOwnProperty.call(vars, key) ? vars[key] : env[key]

const isMissing = typeof value === 'undefined' || value === null ||
Expand Down
2 changes: 1 addition & 1 deletion test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ function runTests (Obj, name) {
test('should pass if the systemvar satisfies the requirement', () => {
const PATH = envTest({ safe: envSystemvarsExample, systemvars: true })['process.env.PATH']
expect(typeof PATH).toEqual('string')
expect(PATH.indexOf('/') !== -1).toEqual(true)
expect(PATH.indexOf('/') !== -1 || PATH.indexOf('\\') !== -1).toEqual(true)
})

test('should not allow local variables to override systemvars', () => {
Expand Down

0 comments on commit 00be1f5

Please sign in to comment.