node-device-detector
Advanced tools
Comparing version 1.3.5 to 1.3.6
CHANGELOG | ||
- | ||
* v1.3.6 | ||
* Update fixtures from the motamo-org/device-detect `version#4.2.3` (update to 2021/05/19) | ||
* fix import helper and set correct name and create test; | ||
* v1.3.5 | ||
@@ -4,0 +7,0 @@ * Update fixtures from the motamo-org/device-detect `version#4.2.3` (update to 2021/05/12) |
@@ -19,3 +19,2 @@ const Brands = Object.values(require('./../parser/device/brand-short')); | ||
let deviceInfoData = {}; | ||
@@ -54,4 +53,6 @@ let deviceAliasCount = 0; | ||
let tableRows = []; | ||
tableRows.push('| Brand | Device count | Alias count | - | Brand | Device count | Alias count |') | ||
tableRows.push('|----|----|----|----|----|----|----|') | ||
tableRows.push( | ||
'| Brand | Device count | Alias count | - | Brand | Device count | Alias count |' | ||
); | ||
tableRows.push('|----|----|----|----|----|----|----|'); | ||
const tableColumnStr = (brand, device, alias) => { | ||
@@ -62,6 +63,12 @@ return `| ${brand} | ${device} | ${alias} |`; | ||
for (let brand in deviceInfoData) { | ||
if(row.length < 3 ) { | ||
row.push(tableColumnStr(brand, deviceInfoData[brand].device, deviceInfoData[brand].alias)); | ||
if (row.length < 3) { | ||
row.push( | ||
tableColumnStr( | ||
brand, | ||
deviceInfoData[brand].device, | ||
deviceInfoData[brand].alias | ||
) | ||
); | ||
} | ||
if(row.length === 2) { | ||
if (row.length === 2) { | ||
tableRows.push(row.join(' - ')); | ||
@@ -71,4 +78,4 @@ row = []; | ||
} | ||
if(row.length === 1) { | ||
row.push(tableColumnStr('', '' , '')); | ||
if (row.length === 1) { | ||
row.push(tableColumnStr('', '', '')); | ||
tableRows.push(row.join(' - ')); | ||
@@ -88,3 +95,5 @@ } | ||
/(^#{5} Support detail brands\/models list(?:.*?)<\/details>)/gims, | ||
`##### Support detail brands/models list:\n\n<details>\n<summary>Show details</summary>\n\n${tableRows.join('\n')}\n\n</details>` | ||
`##### Support detail brands/models list:\n\n<details>\n<summary>Show details</summary>\n\n${tableRows.join( | ||
'\n' | ||
)}\n\n</details>` | ||
); | ||
@@ -91,0 +100,0 @@ |
{ | ||
"name": "node-device-detector", | ||
"version": "1.3.5", | ||
"version": "1.3.6", | ||
"description": "Nodejs device detector (port matomo-org/device-detector)", | ||
@@ -22,2 +22,3 @@ "main": "index.js", | ||
"detect os", | ||
"detect browser", | ||
"detect device brand", | ||
@@ -24,0 +25,0 @@ "detect device model" |
# [node-device-detector](https://www.npmjs.com/package/node-device-detector) | ||
_Last update: 12/05/2021_ | ||
_Last update: 19/05/2021_ | ||
@@ -79,3 +79,3 @@ ## Description | ||
const DeviceDetector = require('node-device-detector'); | ||
const DeviceHelper = require('node-device-detector/helpers'); | ||
const DeviceHelper = require('node-device-detector/helper'); | ||
@@ -91,3 +91,3 @@ const detector = new DeviceDetector; | ||
/* check device type is tablet */ | ||
DeviceHelper.isTabled(result); | ||
DeviceHelper.isTablet(result); | ||
/* check device type car (side panel in car) */ | ||
@@ -94,0 +94,0 @@ DeviceHelper.isCar(result); |
Sorry, the diff of this file is not supported yet
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
1034321
3662