Skip to content

Commit

Permalink
platform: correct vars
Browse files Browse the repository at this point in the history
  • Loading branch information
thetarnav committed Sep 6, 2023
1 parent 1b286ba commit 1e3258c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/platform/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const isOpera: boolean =

/** Browser is Safari */
export const isSafari: boolean =
n.vendor && n.vendor.includes("Apple") && ua && !ua.includes("CriOS") && !ua.includes("FxiOS");
!!n.vendor && n.vendor.includes("Apple") && ua && !ua.includes("CriOS") && !ua.includes("FxiOS");

/** Browser is Internet Explorer 6-11 */
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
Expand All @@ -64,7 +64,7 @@ export const isEdge: boolean = /*#__PURE__*/ /Edg/.test(ua) && isChromium;
export const isChrome: boolean = isChromium && n.vendor === "Google Inc." && !isOpera && !isEdge;

/** Browser is Brave */
export const isBrave: boolean = n.brave && n.brave.isBrave && n.brave.isBrave.name === "isBrave";
export const isBrave: boolean = !!n.brave && n.brave.isBrave && n.brave.isBrave.name === "isBrave";

//
// Rendering Engines
Expand Down
1 change: 1 addition & 0 deletions packages/platform/test/server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ describe("platform", () => {
expect(platform.isChromium).toBe(false);
expect(platform.isEdge).toBe(false);
expect(platform.isChrome).toBe(false);
expect(platform.isBrave).toBe(false);

//
// Rendering Engines
Expand Down

0 comments on commit 1e3258c

Please sign in to comment.