Socket
Socket
Sign inDemoInstall

custom-device-detect

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

custom-device-detect - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

test/bot.test.js

8

device-detect.js

@@ -14,6 +14,6 @@ module.exports = (userAgent, myCustomUserAgent = "") => {

const currentDevice = mobileAndBotDevices.find((device) => {
const finedDevice = device.deviceRegexes.find((regex) => {
if (userAgent.match(regex)) return true;
const findedDevice = device.deviceRegexes.find((regex) => {
return userAgent.match(regex);
});
return finedDevice;
return findedDevice;
});

@@ -26,4 +26,4 @@

if (currentDevice && currentDevice.name.match(/bot/)) deviceType.isBot = true;
return deviceType;
};

@@ -17,3 +17,9 @@ module.exports = [

/scanner/i,
/(web)crawler/i,
/(web|criteo-)crawler/i,
/Dispatch/i,
/Mediapartners-Google/i,
/AhrefsBot/i,
/service-fetcher/i,
/kube/i,
/thetradedesk/i
],

@@ -20,0 +26,0 @@ },

{
"name": "custom-device-detect",
"version": "1.0.2",
"version": "1.0.3",
"description": "custom-device-detect is a user agent parser. custom-device-detect will pars your custom user agent and detect your device.",
"main": "device-detect.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "mocha"
},

@@ -30,3 +30,6 @@ "repository": {

},
"homepage": "https://github.com/osmanemin/custom-device-detect#readme"
"homepage": "https://github.com/osmanemin/custom-device-detect#readme",
"devDependencies": {
"mocha": "^9.2.2"
}
}
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