Skip to content

Commit

Permalink
fixup! Replace callbacks with promises
Browse files Browse the repository at this point in the history
  • Loading branch information
SemenchenkoVitaliy committed May 16, 2019
1 parent ccbfc31 commit 59bceb0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/filestorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class FileStorage {
}

// Write file to storage
// id - <Uint64>, id of file
// id - <common.Uint64> | <number> | <BigInt>, id of file
// data - <string> | <Buffer> | <Uint8Array>, data to be written
// opts - <Object>
// checksum - <string>, checksum type
Expand All @@ -41,7 +41,7 @@ class FileStorage {
}

// Update file in the storage
// id - <Uint64>, id of file
// id - <common.Uint64> | <number> | <BigInt>, id of file
// data - <string> | <Buffer> | <Uint8Array>, data to be written
// opts - <Object>
// checksum - <string>, checksum type
Expand All @@ -63,15 +63,15 @@ class FileStorage {
}

// Get information about file
// id - <Uint64>, id of file
// id - <common.Uint64> | <number> | <BigInt>, id of file
// Returns: <fs.Stats>
async stat(id) {
const file = this[getFilepath](id);
return fs.stat(file);
}

// Read file from storage
// id - <Uint64>, id of file
// id - <common.Uint64> | <number> | <BigInt>, id of file
// opts - <Object>
// encoding - <string>
// compression - <string>
Expand All @@ -83,14 +83,14 @@ class FileStorage {
}

// Delete file from storage
// id - <Uint64>, id of file
// id - <common.Uint64> | <number> | <BigInt>, id of file
async rm(id) {
const file = this[getFilepath](id);
await fs.unlink(file);
}

// Compress file in storage
// id - <Uint64>, id of file
// id - <common.Uint64> | <number> | <BigInt>, id of file
// compression - <string>, compression type
// Returns: <boolean>, whether file was compressed
// Throws: <TypeError>, if compression is incorrect
Expand Down

0 comments on commit 59bceb0

Please sign in to comment.