New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

device

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

device - npm Package Compare versions

Comparing version 0.3.9 to 0.3.10

11

lib/device.js

@@ -80,3 +80,3 @@ /* Based on Categorizr (https://github.com/bjankord/Categorizr) by Brett Jankord (http://www.brettjankord.com) */

return 'tablet';
} else if (ua.match(/BOLT|Fennec|Iris|Maemo|Minimo|Mobi|mowser|NetFront|Novarra|Prism|RX-34|Skyfire|Tear|XV6875|XV6975|Google Wireless Transcoder/i)) {
} else if (ua.match(/BOLT|Fennec|Iris|Maemo|Minimo|Mobi|mowser|NetFront|Novarra|Prism|RX-34|Skyfire|Tear|XV6875|XV6975|Google Wireless Transcoder/i) && !ua.match(/AdsBot-Google-Mobile/i)) {
// if user agent is unique phone User Agent

@@ -87,3 +87,3 @@ return 'phone';

return 'phone';
} else if ((ua.match(/Windows (NT|XP|ME|9)/) && !ua.match(/Phone/i)) && !ua.match(/Bot|Spider|ia_archiver|NewsGator/i) || ua.match(/Win( ?9|NT)/i)) {
} else if ((ua.match(/Windows( )?(NT|XP|ME|9)/) && !ua.match(/Phone/i)) && !ua.match(/Bot|Spider|ia_archiver|NewsGator/i) || ua.match(/Win( ?9|NT)/i) || ua.match(/Go-http-client/i)) {
// if user agent is Windows Desktop

@@ -103,5 +103,8 @@ return 'desktop';

return 'desktop';
} else if (ua.match(/Mozilla\/5\.0 \(\)|jack|Applebot|FlipboardProxy|Go 1.1 package|HTMLParser|simplereach|python-requests|ShowyouBot|MetaURI|nineconnections|(^Java\/[0-9._]*)|Commons-HttpClient|InAGist|HTTP-Java-Client|curl|Wget|Bot|B-O-T|Crawler|Spider|Spyder|Yahoo|ia_archiver|Covario-IDS|findlinks|DataparkSearch|larbin|Mediapartners-Google|NG-Search|Snappy|Teoma|Jeeves|Charlotte|NewsGator|TinEye|Cerberian|SearchSight|Zao|Scrubby|Qseero|PycURL|Pompos|oegp|SBIder|yoogliFetchAgent|yacy|webcollage|VYU2|voyager|updated|truwoGPS|StackRambler|Sqworm|silk|semanticdiscovery|ScoutJet|Nymesis|NetResearchServer|MVAClient|mogimogi|Mnogosearch|Arachmo|Accoona|holmes|htdig|ichiro|webis|LinkWalker|lwp-trivial|facebookexternalhit|monit\/|ELB-HealthChecker\/|JobBot|GoogleCloudMonitoring|GoogleStackdriverMonitoring|gomezagent|apm synthetic agent|ruxitsynthetic|ktxn|khte|ktht|dynatrace/i) && !ua.match(/phone|Playstation/i)) {
} else if (ua.match(/Mozilla\/5\.0 \(\)|AdsBot-Google-Mobile/i) && ua.match(/Phone/i)) {
// if user agent is a BOT/Crawler/Spider
return self.options.botUserAgentDeviceType;
} else if (ua.match(/Mozilla\/5\.0 \(\)|jack|Applebot|FlipboardProxy|Go 1.1 package|HTMLParser|simplereach|python-requests|ShowyouBot|MetaURI|nineconnections|(^Java\/[0-9._]*)|Commons-HttpClient|InAGist|HTTP-Java-Client|curl|Wget|Bot|B-O-T|Crawler|Spider|Spyder|Yahoo|ia_archiver|Covario-IDS|findlinks|DataparkSearch|larbin|Mediapartners-Google|NG-Search|Snappy|Teoma|Jeeves|Charlotte|NewsGator|TinEye|Cerberian|SearchSight|Zao|Scrubby|Qseero|PycURL|Pompos|oegp|SBIder|yoogliFetchAgent|yacy|webcollage|VYU2|voyager|updated|truwoGPS|StackRambler|Sqworm|silk|semanticdiscovery|ScoutJet|Nymesis|NetResearchServer|MVAClient|mogimogi|Mnogosearch|Arachmo|Accoona|holmes|htdig|ichiro|webis|LinkWalker|lwp-trivial|facebookexternalhit|monit\/|ELB-HealthChecker\/|JobBot|GoogleCloudMonitoring|GoogleStackdriverMonitoring|gomezagent|apm synthetic agent|ruxitsynthetic|ktxn|khte|ktht|dynatrace|TrendsmapResolver|WinHTTP/i) && !ua.match(/phone|Playstation/i)) {
// if user agent is a BOT/Crawler/Spider
return self.options.botUserAgentDeviceType;
} else {

@@ -133,3 +136,3 @@ // Otherwise returning the unknown type configured

exports.useragent_is = parse; // for backwards compatibility
exports.version = require('../package').version;
exports.version = require('../package.json').version;
exports.Parser = DeviceParser;

@@ -5,11 +5,28 @@ {

"description": "Device type detection library based on the useragent string. Refactored from express-device.",
"keywords": ["browser","mobile","detection","user-agent","useragent","desktop","phone","tablet","tv","bot","car","parsing","device"],
"version": "0.3.9",
"keywords": [
"browser",
"mobile",
"detection",
"user-agent",
"useragent",
"desktop",
"phone",
"tablet",
"tv",
"bot",
"car",
"parsing",
"device"
],
"version": "0.3.10",
"main": "./index.js",
"private": false,
"engines": {
"node": ">=0.10"
"node": ">=8.x"
},
"dependencies": {
"useragent": "*"
"useragent": "*",
"yamlparser": "*",
"request": "*",
"diff": ">=3.5.0"
},

@@ -16,0 +33,0 @@ "devDependencies": {

@@ -88,3 +88,3 @@ # device [![NPM version](http://img.shields.io/npm/v/device.svg?style=flat)](https://npmjs.org/package/device) [![Downloads](https://img.shields.io/npm/dm/device.svg?style=flat)](https://npmjs.org/package/device) [![Build Status](https://secure.travis-ci.org/rguerreiro/device.png?branch=master)](http://travis-ci.org/rguerreiro/device)

The **device** package is supported on node version 4.* upwards.
The **device** package is supported on node version 8.* upwards.

@@ -118,3 +118,3 @@ ## contributors

Currently, `device` is on **version 0.3.9**. In order to add more features I'm asking anyone to contribute with some ideas. You can do it by making some feature requests on the issues panel, but I prefer that you make your contribution with some pull requests ;)
Currently, `device` is on **version 0.3.10**. In order to add more features I'm asking anyone to contribute with some ideas. You can do it by making some feature requests on the issues panel, but I prefer that you make your contribution with some pull requests ;)

@@ -121,0 +121,0 @@ In case you found a misinterpreted user-agent please open an issue and submit the full string and state what type of device it should return.

@@ -480,2 +480,8 @@ var device = require('../lib/device.js'),

});
describe('80.AdsBot', function () {
it('should get device type bot', function () {
var mydevice = device('Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1 (compatible; AdsBot-Google-Mobile; +http://www.google.com/mobile/adsbot.html)');
assert.equal(mydevice.type, 'bot');
});
});
describe('Bot device type check with is method', function () {

@@ -482,0 +488,0 @@ it('should get true', function () {

@@ -533,2 +533,14 @@ var device = require('../lib/device.js'),

});
describe('88.Golang', function () {
it('should get true', function () {
var mydevice = device('Go-http-client/1.1');
assert.equal(mydevice.is('desktop'), true);
});
});
describe('89.No spaces (issue #28)', function () {
it('should get true', function () {
var mydevice = device('Mozilla/5.0(WindowsNT6.1;rv:31.0)Gecko/20100101Firefox/31.0');
assert.equal(mydevice.is('desktop'), true);
});
});
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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