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

Improvements and bug fixes. #143

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

VashurkinAnton
Copy link

The following bugs are fixed:

  • The this.Agent will never reseted since the object this.DefaultAgent is used by reference;
  • The iOS 13 iPad detection on browser side: iOS 13 iPad user-agent #129.

The improvements are made:

  • Structure of constructor changed to prototypal inheritance - which makes easy extensions and usage more safety;
  • Now the user agent and request headers can be passed while the instance creation, and it will be automatically parsed and saved to instance;
  • Moved out the regex's from instance data to global module space for save the memory (that are critical since can save big amount of memory within express.js usage);
  • Added the inline jsdoc documentaion;
  • Added support of browser detection by default;
  • Added the webview detection (for browser side on iOS and everywhere for Android);
  • The .parse method moved to static UserAgent.parse (the instance.parse still supported but will emit deprecation message on call);
  • The .testNginxGeoIP accessable as static method too;
  • Removed the constructor call from the end of file (never used and just triggers the garbage collector while first initialization);
  • Express middleware now the same function which optimize the memory usage without any side effects;

@VashurkinAnton VashurkinAnton force-pushed the master branch 2 times, most recently from ecafd76 to fbe015d Compare February 10, 2021 10:57
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.

1 participant