Closed ussuri closed 9 years ago
lgtm
Nit: I would prefer avoiding the runCommand_
function, leaving path validation inside each method, and composing promises in a more natural way, so that each function looks more "self-explanatory".
For example, the version of the stat
function below looks cleaner imho:
GDriveFileSystem.prototype.stat = function(path) {
if (!this.isValidPath_(path))
return Promise.reject(new AxiomError.Invalid('path', path.originalSpec));
return this.refreshOnline().then(function() {
return gdrivefsUtil.statEntry(path);
});
};
As we've discussed, this is the gray area of generic vs. concrete. My other pending PRs depend on the code as it is here, so I'll land all of them, and then maybe redo the code to be somewhere in the middle between the two approaches.
@rpaquay
Includes a small refactoring that makes the above easier to use.