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

Commit

Permalink
config argument validation is now entirely delegated to the repo
Browse files Browse the repository at this point in the history
  • Loading branch information
pgte committed Jul 4, 2017
1 parent d188a66 commit 1172e6a
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/core/components/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,9 @@ module.exports = function config (self) {
key = undefined
}

if (!key) {
return self._repo.config.get(callback)
} else {
return self._repo.config.get(key, callback)
}
return self._repo.config.get(key, callback)
}),
set: promisify((key, value, callback) => {
if (!key || typeof key !== 'string') {
return callback(new Error('Invalid key type'))
}

if (value === undefined || Buffer.isBuffer(value)) {
return callback(new Error('Invalid value type'))
}

self._repo.config.set(key, value, callback)
}),
replace: promisify((config, callback) => {
Expand Down

0 comments on commit 1172e6a

Please sign in to comment.