Comparing version 0.3.9 to 0.3.10
@@ -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
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 2 instances in 1 package
3467429
66973
4
19
3
+ Addeddiff@>=3.5.0
+ Addedrequest@*
+ Addedyamlparser@*
+ Addedajv@6.12.6(transitive)
+ Addedasn1@0.2.6(transitive)
+ Addedassert-plus@1.0.0(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedaws-sign2@0.7.0(transitive)
+ Addedaws4@1.13.2(transitive)
+ Addedbcrypt-pbkdf@1.0.2(transitive)
+ Addedcaseless@0.12.0(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcore-util-is@1.0.2(transitive)
+ Addeddashdash@1.14.1(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addeddiff@7.0.0(transitive)
+ Addedecc-jsbn@0.1.2(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedextsprintf@1.3.0(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedforever-agent@0.6.1(transitive)
+ Addedform-data@2.3.3(transitive)
+ Addedgetpass@0.1.7(transitive)
+ Addedhar-schema@2.0.0(transitive)
+ Addedhar-validator@5.1.5(transitive)
+ Addedhttp-signature@1.2.0(transitive)
+ Addedis-typedarray@1.0.0(transitive)
+ Addedisstream@0.1.2(transitive)
+ Addedjsbn@0.1.1(transitive)
+ Addedjson-schema@0.4.0(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addedjsprim@1.4.2(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedoauth-sign@0.9.0(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedpsl@1.15.0(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedqs@6.5.3(transitive)
+ Addedrequest@2.88.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsshpk@1.18.0(transitive)
+ Addedtough-cookie@2.5.0(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
+ Addedtweetnacl@0.14.5(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addeduuid@3.4.0(transitive)
+ Addedverror@1.10.0(transitive)
+ Addedyamlparser@0.0.2(transitive)