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

fix: handle optional key to config.get #3069

Merged
merged 1 commit into from
Jun 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion packages/ipfs/src/core/components/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ const log = require('debug')('ipfs:core:config')

module.exports = ({ repo }) => {
return {
get: withTimeoutOption(repo.config.get),
get: withTimeoutOption((key, options) => {
if (!options && key && typeof key === 'object') {
options = key
key = undefined
}

return repo.config.get(key, options)
}),
set: withTimeoutOption(repo.config.set),
replace: withTimeoutOption(repo.config.replace),
profiles: {
Expand Down