File tree 1 file changed +4
-2
lines changed
packages/util-defaults-mode-browser/src
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { memoize } from "@aws-sdk/property-provider" ;
2
2
import type { DefaultsMode , ResolvedDefaultsMode } from "@aws-sdk/smithy-client" ;
3
3
import type { Provider } from "@aws-sdk/types" ;
4
- import { parse } from "bowser" ;
4
+ import bowser from "bowser" ;
5
5
6
6
import { DEFAULTS_MODE_OPTIONS } from "./constants" ;
7
7
@@ -45,7 +45,9 @@ export const resolveDefaultsModeConfig = ({
45
45
46
46
const isMobileBrowser = ( ) : boolean => {
47
47
const parsedUA =
48
- typeof window !== "undefined" && window ?. navigator ?. userAgent ? parse ( window . navigator . userAgent ) : undefined ;
48
+ typeof window !== "undefined" && window ?. navigator ?. userAgent
49
+ ? bowser . parse ( window . navigator . userAgent )
50
+ : undefined ;
49
51
const platform = parsedUA ?. platform ?. type ;
50
52
// Reference: https://github.com/lancedikson/bowser/blob/master/src/constants.js#L86
51
53
return platform === "tablet" || platform === "mobile" ;
You can’t perform that action at this time.
0 commit comments