Skip to content

Commit

Permalink
do not trust regexp, if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
dominictarr committed Mar 29, 2017
1 parent 874c2e3 commit b6c3d22
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ var env = exports.env = function (prefix, env) {
env = env || process.env
var obj = {}
var l = prefix.length
var regex = new RegExp("^"+prefix, "i");
for(var k in env) {
if(regex.test(k)) {
if(k.toLowerCase().indexOf(prefix) === 0) {

var keypath = k.substring(l).split('__')

Expand Down Expand Up @@ -102,3 +101,4 @@ var find = exports.find = function () {
return find(process.cwd(), rel)
}


0 comments on commit b6c3d22

Please sign in to comment.