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

Add constant output so that users can quickly get all types #325

Merged
merged 1 commit into from
May 26, 2019

Conversation

1615450788
Copy link

@1615450788 1615450788 commented May 20, 2019

Now you can use it like this, and all tests have passed.

import Bowser from 'bowser';

const UA = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36 OPR/43.0.2442.1165';

const parser = new Parser(UA, true);

parser.is(Bowser.OS_MAP.MacOS) === true

Most of the time when using bowser, we need to query alias mapping many times, which can solve this problem very well and make use of IDE's automatic completion.

It's time to say goodbye to the alias.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 575

  • 15 of 15 (100.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 88.902%

Totals Coverage Status
Change from base Build 564: 0.1%
Covered Lines: 503
Relevant Lines: 519

💛 - Coveralls

Copy link
Collaborator

@lancedikson lancedikson left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks for your work! I'll merge it and release a new version soon.

@lancedikson lancedikson merged commit 41bbfc1 into bowser-js:master May 26, 2019
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

Successfully merging this pull request may close these issues.

None yet

3 participants