From 56b2a624924d1dc69926498995c380a6e95f0560 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vesa=20Poikaj=C3=A4rvi?= Date: Mon, 15 May 2017 16:05:20 +0300 Subject: [PATCH 1/4] [basic-auth] Add auth.parse --- types/basic-auth/basic-auth-tests.ts | 2 ++ types/basic-auth/index.d.ts | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/types/basic-auth/basic-auth-tests.ts b/types/basic-auth/basic-auth-tests.ts index 1fab9c10e2..fee30eb32b 100644 --- a/types/basic-auth/basic-auth-tests.ts +++ b/types/basic-auth/basic-auth-tests.ts @@ -2,3 +2,5 @@ import auth = require('basic-auth'); auth(null); + +auth.parse('QmFzaWM6QXV0aA=='); diff --git a/types/basic-auth/index.d.ts b/types/basic-auth/index.d.ts index 51ada3b0c7..be8dcb1f01 100644 --- a/types/basic-auth/index.d.ts +++ b/types/basic-auth/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for basic-auth +// Type definitions for basic-auth v1.1.0 // Project: https://github.com/jshttp/basic-auth -// Definitions by: Clément Bourgeois +// Definitions by: Clément Bourgeois , Vesa Poikajärvi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -14,6 +14,9 @@ declare namespace auth { name: string; pass: string; } + + // See https://github.com/jshttp/basic-auth/blob/v1.1.0/index.js#L87-L95 + function parse(authorizationHeader: string): auth.BasicAuthResult; } export = auth; From 99f3e10a1db60ab71c45489a05064888ad861046 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vesa=20Poikaj=C3=A4rvi?= Date: Thu, 18 May 2017 20:31:09 +0300 Subject: [PATCH 2/4] {basic-auth] auth.parse can return undefined In reference to #16607 add undefined also to parse return value --- types/basic-auth/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/basic-auth/index.d.ts b/types/basic-auth/index.d.ts index be8dcb1f01..ac5f4cdafb 100644 --- a/types/basic-auth/index.d.ts +++ b/types/basic-auth/index.d.ts @@ -16,7 +16,7 @@ declare namespace auth { } // See https://github.com/jshttp/basic-auth/blob/v1.1.0/index.js#L87-L95 - function parse(authorizationHeader: string): auth.BasicAuthResult; + function parse(authorizationHeader: string): auth.BasicAuthResult | undefined; } export = auth; From bb60981e527c3c25ba99fcab3d05a4b8cf03cb8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vesa=20Poikaj=C3=A4rvi?= Date: Sun, 21 May 2017 18:48:23 +0300 Subject: [PATCH 3/4] [basic-auth] Copy jsdoc --- types/basic-auth/basic-auth-tests.ts | 2 +- types/basic-auth/index.d.ts | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/types/basic-auth/basic-auth-tests.ts b/types/basic-auth/basic-auth-tests.ts index fee30eb32b..22e27a5a49 100644 --- a/types/basic-auth/basic-auth-tests.ts +++ b/types/basic-auth/basic-auth-tests.ts @@ -3,4 +3,4 @@ import auth = require('basic-auth'); auth(null); -auth.parse('QmFzaWM6QXV0aA=='); +auth.parse('Basic QmFzaWM6QXV0aA=='); diff --git a/types/basic-auth/index.d.ts b/types/basic-auth/index.d.ts index ac5f4cdafb..f5e0499b44 100644 --- a/types/basic-auth/index.d.ts +++ b/types/basic-auth/index.d.ts @@ -15,7 +15,13 @@ declare namespace auth { pass: string; } - // See https://github.com/jshttp/basic-auth/blob/v1.1.0/index.js#L87-L95 + /** + * Parse basic auth to object. + * + * @param {string} string + * @return {object} + * @public + */ function parse(authorizationHeader: string): auth.BasicAuthResult | undefined; } From 3e4702451619a9c6d0cb2a9e1d7dce9650914264 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vesa=20Poikaj=C3=A4rvi?= Date: Tue, 30 May 2017 18:18:18 +0300 Subject: [PATCH 4/4] [basic-auth] removed redundant JSDoc --- types/basic-auth/index.d.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/types/basic-auth/index.d.ts b/types/basic-auth/index.d.ts index f5e0499b44..8292f1349f 100644 --- a/types/basic-auth/index.d.ts +++ b/types/basic-auth/index.d.ts @@ -17,10 +17,6 @@ declare namespace auth { /** * Parse basic auth to object. - * - * @param {string} string - * @return {object} - * @public */ function parse(authorizationHeader: string): auth.BasicAuthResult | undefined; }