Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

detect-browser

Package Overview
Dependencies
Maintainers
3
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

detect-browser - npm Package Compare versions

Comparing version 4.0.1 to 4.0.2

19

index.js

@@ -116,12 +116,12 @@ "use strict";

}
var version = match[1] && match[1].split(/[._]/).slice(0, 3);
if (version) {
if (version.length < REQUIRED_VERSION_PARTS) {
version = version.concat(new Array(REQUIRED_VERSION_PARTS - version.length).fill('0'));
var versionParts = match[1] && match[1].split(/[._]/).slice(0, 3);
if (versionParts) {
if (versionParts.length < REQUIRED_VERSION_PARTS) {
versionParts = versionParts.concat(createVersionParts(REQUIRED_VERSION_PARTS - versionParts.length));
}
}
else {
version = [];
versionParts = [];
}
return new BrowserInfo(name, version.join('.'), detectOS(ua));
return new BrowserInfo(name, versionParts.join('.'), detectOS(ua));
}

@@ -142,1 +142,8 @@ exports.parseUserAgent = parseUserAgent;

exports.getNodeVersion = getNodeVersion;
function createVersionParts(count) {
var output = [];
for (var ii = 0; ii < count; ii++) {
output.push('0');
}
return output;
}
{
"name": "detect-browser",
"version": "4.0.1",
"version": "4.0.2",
"description": "Unpack a browser type and version from the useragent string",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc