diff --git a/types/basic-auth/basic-auth-tests.ts b/types/basic-auth/basic-auth-tests.ts index 1fab9c10e2..22e27a5a49 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('Basic QmFzaWM6QXV0aA=='); diff --git a/types/basic-auth/index.d.ts b/types/basic-auth/index.d.ts index 51ada3b0c7..8292f1349f 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,11 @@ declare namespace auth { name: string; pass: string; } + + /** + * Parse basic auth to object. + */ + function parse(authorizationHeader: string): auth.BasicAuthResult | undefined; } export = auth;