Use Prettier JS (#5017)

* Adds prettier

* Run lint before tests
This commit is contained in:
Florent Vilmart
2018-09-01 13:58:06 -04:00
committed by GitHub
parent 189cd259ee
commit d83a0b6808
240 changed files with 41098 additions and 29020 deletions

View File

@@ -8,7 +8,7 @@ export function randomHexString(size: number): string {
throw new Error('Zero-length randomHexString is useless.');
}
if (size % 2 !== 0) {
throw new Error('randomHexString size must be divisible by 2.')
throw new Error('randomHexString size must be divisible by 2.');
}
return randomBytes(size / 2).toString('hex');
}
@@ -23,9 +23,8 @@ export function randomString(size: number): string {
if (size === 0) {
throw new Error('Zero-length randomString is useless.');
}
const chars = ('ABCDEFGHIJKLMNOPQRSTUVWXYZ' +
'abcdefghijklmnopqrstuvwxyz' +
'0123456789');
const chars =
'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + 'abcdefghijklmnopqrstuvwxyz' + '0123456789';
let objectId = '';
const bytes = randomBytes(size);
for (let i = 0; i < bytes.length; ++i) {
@@ -45,5 +44,7 @@ export function newToken(): string {
}
export function md5Hash(string: string): string {
return createHash('md5').update(string).digest('hex');
return createHash('md5')
.update(string)
.digest('hex');
}