Skip to content
This repository has been archived by the owner on Feb 15, 2021. It is now read-only.

Commit

Permalink
addEnv() should re-use add()
Browse files Browse the repository at this point in the history
Just good OOP practice.  This way, the npmconf module can
override ConfigChain.add(), without having to *also* override
ConfigChain.addEnv().
  • Loading branch information
isaacs committed Aug 15, 2012
1 parent e6fdc84 commit b4e5099
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,10 @@ ConfigChain.prototype.addFile = function (file, type, name) {
}

ConfigChain.prototype.addEnv = function (prefix, env, name) {
this._await()
name = name || 'env'
this.sources[name] = { data: env, source: env, prefix: prefix }
this.push(exports.env(prefix, env))
process.nextTick(this._resolve.bind(this))
return this
var data = exports.env(prefix, env)
this.sources[name] = { data: data, source: env, prefix: prefix }
return this.add(data, name)
}

ConfigChain.prototype.addUrl = function (req, type, name) {
Expand Down

0 comments on commit b4e5099

Please sign in to comment.