We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a406395 commit 3d860d3Copy full SHA for 3d860d3
1 file changed
README.md
@@ -62,11 +62,11 @@ const isChrome = (x: Navigator): boolean => "vendor" in x && /Google Inc/.test(x
62
const isIe = (x: Navigator): boolean => /Trident/.test(x.userAgent);
63
64
export const getCurrentBrowser = (navigator: Navigator): TBrowser =>
65
- Switch<Navigator, TBrowser>(navigator)
66
- .case(isEdge, "edge")
67
- .case(isChrome, "chrome")
68
- .case(isIe, "ie")
69
- .default("firefox");
+ Switch(navigator)
+ .case(isEdge, "edge" as const)
+ .case(isChrome, "chrome" as const)
+ .case(isIe, "ie" as const)
+ .default("firefox" as const);
70
71
const browser = getCurrentBrowser(navigator);
72
```
0 commit comments