From 1c42deb610cc4287fbd306de5cca19e3527ccf1f Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Tue, 2 Feb 2021 00:22:05 +0000 Subject: [PATCH 1/2] fix(util-user-agent-browser): use default import from bowser --- packages/util-user-agent-browser/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/util-user-agent-browser/src/index.ts b/packages/util-user-agent-browser/src/index.ts index 201989c887c1..f0ece42e4bf6 100644 --- a/packages/util-user-agent-browser/src/index.ts +++ b/packages/util-user-agent-browser/src/index.ts @@ -1,5 +1,5 @@ import { Provider, UserAgent } from "@aws-sdk/types"; -import { parse } from "bowser"; +import * as bowser from "bowser"; import { DefaultUserAgentOptions } from "./configurations"; @@ -11,7 +11,7 @@ export const defaultUserAgent = ({ serviceId, clientVersion, }: DefaultUserAgentOptions): Provider => async () => { - const parsedUA = window?.navigator?.userAgent ? parse(window.navigator.userAgent) : undefined; + const parsedUA = window?.navigator?.userAgent ? bowser.parse(window.navigator.userAgent) : undefined; const sections: UserAgent = [ // sdk-metadata ["aws-sdk-js", clientVersion], From bf9467f3dcb716e85da40cbb8e6185e43dbe1960 Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Tue, 2 Feb 2021 00:36:41 +0000 Subject: [PATCH 2/2] fix: use default import for bowser Reason: esModuleInterop is enabled in tsconfig. Refs: https://github.com/lancedikson/bowser/pull/284 --- packages/util-user-agent-browser/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/util-user-agent-browser/src/index.ts b/packages/util-user-agent-browser/src/index.ts index f0ece42e4bf6..e3501ba86640 100644 --- a/packages/util-user-agent-browser/src/index.ts +++ b/packages/util-user-agent-browser/src/index.ts @@ -1,5 +1,5 @@ import { Provider, UserAgent } from "@aws-sdk/types"; -import * as bowser from "bowser"; +import bowser from "bowser"; import { DefaultUserAgentOptions } from "./configurations";