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

Typescript file should have union of string literal types, not just generic string types #551

Open
neaumusic opened this issue Jun 11, 2024 · 1 comment

Comments

@neaumusic
Copy link

The types via node_modules/bowser/index.d.ts aren't extremely useful

Most variables are just string rather than explaining what the actual values could be (eg 'MacOS' | 'Windows' or 'macos' | 'windows')

I believe the source code probably has explicit values for these, and that the types could be defined better:

  const BROWSER_MAP: Record<string, string>;
  const ENGINE_MAP: Record<string, string>;
  const OS_MAP: Record<string, string>;
  const PLATFORMS_MAP: Record<string, string>;
@lancedikson
Copy link
Collaborator

Hi @neaumusic! Thanks for the feedback! I have an idea to refactor it on Typescript to provide a better and native way to support types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants