diff --git a/lib/Authority.ts b/lib/Authority.ts index 54c063b..2bd5a2a 100644 --- a/lib/Authority.ts +++ b/lib/Authority.ts @@ -14,7 +14,7 @@ import keystore from './KeyStore'; import blacklist from './Blacklist'; // eslint-disable-next-line no-shadow -type TokenType = 'access_token'|'refresh_token'|'part_token'|'none' +type TokenType = 'access_token' | 'none' | 'part_token' | 'refresh_token' interface VerificationResult { authorized: boolean; diff --git a/lib/Blacklist.ts b/lib/Blacklist.ts index 4d5ee61..6ca0ff0 100644 --- a/lib/Blacklist.ts +++ b/lib/Blacklist.ts @@ -17,25 +17,25 @@ class Blacklist { this._signatures = []; } - public clear (before: number = Number.POSITIVE_INFINITY):void { + public clear (before: number = Number.POSITIVE_INFINITY): void { for (let i = this._signatures.length - 1; i >= 0; i--) { if (this._signatures[i].iat < before) this._signatures.splice (i, 1); } } - public add_signature (hash: string):void { + public add_signature (hash: string): void { this._signatures.push ({ iat: Date.now (), hash }); } - public remove_signature (hash:string):void { + public remove_signature (hash: string): void { for (let i = this._signatures.length - 1; i >= 0; i--) { if (this._signatures[i].hash === hash) this._signatures.splice (i, 1); } } - public is_valid (hash: string):boolean { + public is_valid (hash: string): boolean { for (const sig of this._signatures) { if (sig.hash === hash) return false; diff --git a/test/Helper.ts b/test/Helper.ts index 5237f8a..0bb6481 100644 --- a/test/Helper.ts +++ b/test/Helper.ts @@ -59,7 +59,7 @@ export function assert_keystore_state (): void { } /* eslint-enable dot-notation */ -export function clock_setup ():void { +export function clock_setup (): void { assert_keystore_state (); const date = (new Date); @@ -70,7 +70,7 @@ export function clock_setup ():void { .mockDate (date); } -export function clock_finalize ():void { +export function clock_finalize (): void { jasmine.clock () .tick (30 * 24 * 60 * 60 * 1000); // eslint-disable-next-line dot-notation diff --git a/test/spec/KeyStore.ts b/test/spec/KeyStore.ts index fdf4627..14141da 100644 --- a/test/spec/KeyStore.ts +++ b/test/spec/KeyStore.ts @@ -20,7 +20,7 @@ describe ('key store', () => { clock_finalize (); }); - const keys: {key:string, sign:string, iat:number}[] = []; + const keys: {key: string, sign: string, iat: number}[] = []; it ('should generate a new key', async () => { const iat = (new Date)