From 5b4a89b42a77e948cf6469a3afd3d791cf801c6f Mon Sep 17 00:00:00 2001 From: Joan Claret Date: Mon, 13 Nov 2017 09:57:56 +0100 Subject: [PATCH] Add a public .detect() method --- src/bowser.js | 5 +++++ typings.d.ts | 1 + 2 files changed, 6 insertions(+) diff --git a/src/bowser.js b/src/bowser.js index f7bbca7..2ec17fb 100644 --- a/src/bowser.js +++ b/src/bowser.js @@ -611,5 +611,10 @@ */ bowser._detect = detect; + /* + * Set our detect public method to the main bowser object + * This is needed to implement bowser in server side + */ + bowser.detect = detect; return bowser }); diff --git a/typings.d.ts b/typings.d.ts index 051c690..e43bab2 100644 --- a/typings.d.ts +++ b/typings.d.ts @@ -96,6 +96,7 @@ declare namespace bowser { (): IBowserDetection; test(browserList: string[]): boolean; _detect(ua: string): IBowser; + detect(ua: string): IBowser; compareVersions(versions: string[]): number; check(minVersions: IBowserMinVersions, strictMode?: boolean|string, ua?: string): Boolean; isUnsupportedBrowser(minVersions: IBowserMinVersions, strictMode?: boolean|string, ua?: string): boolean;