Use create* prefix to clarify curried functions

This commit is contained in:
Daniel Gasienica 2018-04-03 15:25:24 -04:00
parent 6e6b93d917
commit 8474f3cf7f
4 changed files with 25 additions and 23 deletions

View file

@ -24,10 +24,10 @@ exports.ensureDirectory = async (userDataPath) => {
await fse.ensureDir(exports.getPath(userDataPath));
};
// readData :: AttachmentsPath ->
// RelativePath ->
// IO (Promise ArrayBuffer)
exports.readData = (root) => {
// createReader :: AttachmentsPath ->
// RelativePath ->
// IO (Promise ArrayBuffer)
exports.createReader = (root) => {
if (!isString(root)) {
throw new TypeError('`root` must be a path');
}
@ -43,10 +43,10 @@ exports.readData = (root) => {
};
};
// writeData :: AttachmentsPath ->
// ArrayBuffer ->
// IO (Promise RelativePath)
exports.writeData = (root) => {
// createWriter :: AttachmentsPath ->
// ArrayBuffer ->
// IO (Promise RelativePath)
exports.createWriter = (root) => {
if (!isString(root)) {
throw new TypeError('`root` must be a path');
}
@ -66,8 +66,10 @@ exports.writeData = (root) => {
};
};
// deleteData :: AttachmentsPath -> IO Unit
exports.deleteData = (root) => {
// createDeleter :: AttachmentsPath ->
// RelativePath ->
// IO Unit
exports.createDeleter = (root) => {
if (!isString(root)) {
throw new TypeError('`root` must be a path');
}