Socket
Socket
Sign inDemoInstall

rtc-core

Package Overview
Dependencies
Maintainers
2
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rtc-core - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0

54

detect.js

@@ -7,17 +7,3 @@ /* jshint node: true */

var semver = require('semver');
var browsers = {
chrome: [
/Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/
],
firefox: [
/Firefox\/([0-9\.]+)(?:\s|$)/
],
opera: [
/Opera\/([0-9\.]+)(?:\s|$)/
],
ie: [
/Trident\/7\.0.*rv\:([0-9\.]+)\).*Gecko$/ // IE11
]
};
var browser = require('detect-browser');

@@ -84,36 +70,4 @@ /**

// time to do some useragent sniffing - it feels dirty because it is :/
if (typeof navigator != 'undefined') {
Object.keys(browsers).forEach(function(key) {
// get the first matching regex
var match = browsers[key].map(function(regex) {
return regex.exec(navigator.userAgent);
}).filter(Boolean)[0];
if (match) {
detect.browser = key;
detect.browserVersion = detect.version = parseVersion(match[1]);
}
});
// if the browser has not been detected, then set the browser to unknown
detect.browser = detect.browser || 'unknown';
}
else {
detect.browser = 'node';
detect.browserVersion = detect.version = parseVersion(process.version.substr(1));
}
function parseVersion(version) {
// get the version parts
var versionParts = version.split('.').slice(0, 3);
// while we don't have enough parts for the semver spec, add more zeros
while (versionParts.length < 3) {
versionParts.push('0');
}
// return the version cleaned version (hopefully)
// falling back to the provided version if required
return semver.clean(versionParts.join('.')) || version;
}
// set the browser and browser version
detect.browser = browser.name;
detect.browserVersion = detect.version = browser.version;

4

package.json
{
"name": "rtc-core",
"description": "Core definitions and functions for the rtc.io suite",
"version": "2.0.0",
"version": "3.0.0",
"dependencies": {
"semver": "^2"
"detect-browser": "^1.0.0"
},

@@ -8,0 +8,0 @@ "devDependencies": {

require('./detect');
require('./detect-browser');
require('./match');
require('./plugin');
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