Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(http): fix tablet and smarttv in Device.type literal types #6129

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

nonrational
Copy link
Contributor

@nonrational nonrational commented Oct 20, 2024

I believe two of the literal types for Device.type have typos. The const values being returned are correct, but attempting a comparison like device.type === 'tablet' currently errors.

error: TS2367 [ERROR]: This comparison appears to be unintentional because the types '"console" | "mobile" | "table" | "smartv" | "wearable" | "embedded" | undefined' and '"tablet"' have no overlap.
export const isTablet = (device: Device) => device.type === 'tablet'
                                            ~~~~~~~~~~~~~~~~~~~~~~~~

"table" should be "table[t]" and "smartv" should be "smart[t]v".

This PR fixes the two typos, and adjusts the sort order to match the order of the const's above to make it easier to visually compare values as a set.

@nonrational nonrational requested a review from kt3k as a code owner October 20, 2024 04:08
@CLAassistant
Copy link

CLAassistant commented Oct 20, 2024

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the http label Oct 20, 2024
Copy link

codecov bot commented Oct 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.57%. Comparing base (45be5d3) to head (3f633b7).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6129      +/-   ##
==========================================
- Coverage   96.57%   96.57%   -0.01%     
==========================================
  Files         535      535              
  Lines       40583    40583              
  Branches     6094     6094              
==========================================
- Hits        39195    39192       -3     
- Misses       1344     1347       +3     
  Partials       44       44              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Thanks!

@kt3k kt3k merged commit d6b5612 into denoland:main Oct 21, 2024
20 checks passed
@nonrational nonrational deleted the device-type-types-typos branch October 21, 2024 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants