Apply Javascript styleguide

This commit is contained in:
Jonathan Cremin 2015-08-23 22:12:32 +01:00
parent 752ce964c8
commit 6e0f351093
30 changed files with 364 additions and 375 deletions

View file

@ -13,14 +13,12 @@ function* checkId(Files, fileId, attempts) {
return false;
}
const file = yield Files.findOne({'_id': fileId});
if(file === null) {
if (file === null) {
return fileId;
} else {
return checkId(randomID(), attempts++);
}
return checkId(randomID(), ++attempts); // eslint-disable-line no-param-reassign
}
export default function* (Files) {
let attempts = 0;
return yield checkId(Files, randomID(), attempts);
return yield checkId(Files, randomID(), 0);
}