Skip to content

Commit

Permalink
first half of functional env() works
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed May 13, 2013
1 parent 666395f commit 7a0cf79
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ exports.parse = function parse (s, env) {
});

function getVar (_, pre, key) {
return pre + String(env[key] || '');
if (typeof env === 'function') {
return pre + String(env(key) || '');
}
else return pre + String(env[key] || '');
}
};

0 comments on commit 7a0cf79

Please sign in to comment.