custom-device-detect
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -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" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
7067
5
170
0
1