From 6cf6286fb84a878ab106a66fdd5db9df0335f354 Mon Sep 17 00:00:00 2001 From: Timo Hocker Date: Tue, 5 Jan 2021 17:06:35 +0100 Subject: [PATCH] package --- lib/Authority.ts | 1 + lib/Blacklist.ts | 10 ++++++---- package.json | 3 ++- tsconfig.json | 3 ++- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/Authority.ts b/lib/Authority.ts index 58f5532..f32970a 100644 --- a/lib/Authority.ts +++ b/lib/Authority.ts @@ -100,4 +100,5 @@ class Authority { const auth = (new Authority); +export { Authority }; export default auth; diff --git a/lib/Blacklist.ts b/lib/Blacklist.ts index b637f3f..6029b68 100644 --- a/lib/Blacklist.ts +++ b/lib/Blacklist.ts @@ -17,25 +17,25 @@ class Blacklist { this._signatures = []; } - public clear_before (date: Date) { + public clear_before (date: Date):void { for (let i = this._signatures.length - 1; i >= 0; i--) { if (this._signatures[i].iat < date) this._signatures.splice (i, 1); } } - public add_signature (hash: string) { + public add_signature (hash: string):void { this._signatures.push ({ iat: (new Date), hash }); } - public remove_signature (hash:string) { + 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) { + public is_valid (hash: string):boolean { for (const sig of this._signatures) { if (sig.hash === hash) return false; @@ -46,4 +46,6 @@ class Blacklist { } const bl = (new Blacklist); + +export { Blacklist }; export default bl; diff --git a/package.json b/package.json index e44a5d5..3c12237 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,8 @@ "LICENSE", "*.js", "*.ts", - "*.d.ts" + "*.d.ts", + "*.map" ], "keywords": [ "authentication", diff --git a/tsconfig.json b/tsconfig.json index 741983d..67e1e51 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,5 +9,6 @@ "forceConsistentCasingInFileNames": true, "declaration": true, "sourceMap": true - } + }, + "exclude": ["test/**/*.ts"] }