@pixeleye/cli-devices
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -1,1 +0,32 @@ | ||
import{devices as r}from"playwright-core";var t={chromium:"chrome",firefox:"firefox",webkit:"safari"},c=e=>["Desktop Edge","Desktop Edge HiDPI"].includes(e.name)?"edge":t[e.defaultBrowserType],D=Object.keys(r).reduce((e,i)=>{e[i]={...r[i],name:i};let o=c(e[i]);return e[i].icon=o,e},{});export{D as devices,c as getDeviceIcon}; | ||
// src/devices.ts | ||
import { devices as playwrightDevices } from "playwright-core"; | ||
var icons = { | ||
chromium: "chrome", | ||
firefox: "firefox", | ||
webkit: "safari" | ||
}; | ||
var getDeviceIcon = (device) => { | ||
if (["Desktop Edge", "Desktop Edge HiDPI"].includes(device.name)) { | ||
return "edge"; | ||
} | ||
const icon = icons[device.defaultBrowserType]; | ||
return icon; | ||
}; | ||
var devices = Object.keys( | ||
playwrightDevices | ||
).reduce( | ||
(acc, name) => { | ||
acc[name] = { | ||
...playwrightDevices[name], | ||
name | ||
}; | ||
const icon = getDeviceIcon(acc[name]); | ||
acc[name].icon = icon; | ||
return acc; | ||
}, | ||
{} | ||
); | ||
export { | ||
devices, | ||
getDeviceIcon | ||
}; |
{ | ||
"name": "@pixeleye/cli-devices", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "license": "AGPL-3.0", |
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
38855
101
2