This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use async/await based ipfs-repo
This is WIP and IPFS doesn't even start properly.
- Loading branch information
Showing
29 changed files
with
332 additions
and
372 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,11 @@ | ||
'use strict' | ||
|
||
const promisify = require('promisify-es6') | ||
const callbackify = require('callbackify') | ||
|
||
module.exports = function config (self) { | ||
return { | ||
get: promisify((key, callback) => { | ||
if (typeof key === 'function') { | ||
callback = key | ||
key = undefined | ||
} | ||
|
||
return self._repo.config.get(key, callback) | ||
}), | ||
set: promisify((key, value, callback) => { | ||
self._repo.config.set(key, value, callback) | ||
}), | ||
replace: promisify((config, callback) => { | ||
self._repo.config.set(config, callback) | ||
}) | ||
get: callbackify(self._repo.config.get), | ||
set: callbackify(self._repo.config.set), | ||
replace: callbackify(self._repo.config.set) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.