Skip to content

Commit

Permalink
refactor(browser-detector): fix eslint warning
Browse files Browse the repository at this point in the history
```
/home/runner/work/opentelemetry-js/opentelemetry-js/experimental/packages/opentelemetry-browser-detector/src/BrowserDetector.ts
  66:66  warning  Unexpected any. Specify a different type  @typescript-eslint/no-explicit-any
```

Ref open-telemetry#5365
  • Loading branch information
chancancode committed Jan 27, 2025
1 parent 199fd8d commit ad57536
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ class BrowserDetector implements Detector {
// Add Browser related attributes to resources
function getBrowserAttributes(): Attributes {
const browserAttribs: Attributes = {};
const userAgentData: UserAgentData | undefined = (navigator as any)
.userAgentData;
const userAgentData = (
navigator as Navigator & { userAgentData?: UserAgentData }
).userAgentData;
if (userAgentData) {
browserAttribs[BROWSER_ATTRIBUTES.PLATFORM] = userAgentData.platform;
browserAttribs[BROWSER_ATTRIBUTES.BRANDS] = userAgentData.brands.map(
Expand Down

0 comments on commit ad57536

Please sign in to comment.