Apply Javascript styleguide
This commit is contained in:
parent
752ce964c8
commit
6e0f351093
30 changed files with 364 additions and 375 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue