Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/io.js

Issue 29796555: Issue 6621 (Closed)
Patch Set: Comment improvements and a rename Created June 5, 2018, 7:05 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/ioIndexedDB.js » ('j') | lib/ioIndexedDB.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/io.js
diff --git a/lib/io.js b/lib/io.js
index a919c5dbe6d83e8e4d092b00a85247c0e4fb5620..461b1b6b1734bb443c22f1df78edd7d7b276c75b 100644
--- a/lib/io.js
+++ b/lib/io.js
@@ -81,20 +81,6 @@ exports.IO =
return saveFile(fileName, data);
},
- /**
- * Copies a file.
kzar 2018/06/05 12:38:53 Nice, always good to remove old code where possibl
- * @param {string} fromFile
- * Name of the file to be copied
- * @param {string} toFile
- * Name of the file to be written, will be overwritten if exists
- * @return {Promise}
- * Promise to be resolved or rejected once the operation is completed
- */
- copyFile(fromFile, toFile)
- {
- return loadFile(fromFile).then(entry => saveFile(toFile, entry.content));
- },
-
/**
* Renames a file.
* @param {string} fromFile
@@ -108,19 +94,7 @@ exports.IO =
{
return loadFile(fromFile)
.then(entry => browser.storage.local.set({[fileToKey(newName)]: entry}))
- .then(() => this.removeFile(fromFile));
- },
-
- /**
- * Removes a file.
- * @param {string} fileName
- * Name of the file to be removed
- * @return {Promise}
- * Promise to be resolved or rejected once the operation is completed
- */
- removeFile(fileName)
- {
- return browser.storage.local.remove(fileToKey(fileName));
+ .then(() => browser.storage.local.remove(fileToKey(fromFile)));
},
/**
« no previous file with comments | « no previous file | lib/ioIndexedDB.js » ('j') | lib/ioIndexedDB.js » ('J')

Powered by Google App Engine
This is Rietveld