@solid-primitives/platform
Advanced tools
Comparing version 0.0.101 to 0.0.102
// src/index.ts | ||
var ua = navigator.userAgent; | ||
var w = window; | ||
var n = w.navigator; | ||
var ua = n.userAgent; | ||
var isAndroid = /* @__PURE__ */ /Android/.test(ua); | ||
@@ -8,3 +9,3 @@ var isWindows = /* @__PURE__ */ /(win32|win64|windows|wince)/i.test(ua); | ||
var isIPhone = /* @__PURE__ */ /iphone/i.test(ua); | ||
var isIPad = /* @__PURE__ */ /ipad/i.test(ua) && navigator.maxTouchPoints > 1; | ||
var isIPad = /* @__PURE__ */ /ipad/i.test(ua) && n.maxTouchPoints > 1; | ||
var isIPod = /* @__PURE__ */ /ipod/i.test(ua); | ||
@@ -18,6 +19,6 @@ var isIOS = isIPhone || isIPad || isIPod; | ||
var isSafari = /* @__PURE__ */ /constructor/i.test(w.HTMLElement) || ((_a = w.safari) == null ? void 0 : _a.pushNotification) + "" === "[object SafariRemoteNotification]"; | ||
var isIE = !!document.documentMode; | ||
var isIE = !!w.document.documentMode; | ||
var isChromium = !!w.chrome; | ||
var isEdge = /* @__PURE__ */ /Edg/.test(ua) && isChromium; | ||
var isChrome = isChromium && navigator.vendor === "Google Inc." && !isOpera && !isEdge; | ||
var isChrome = isChromium && n.vendor === "Google Inc." && !isOpera && !isEdge; | ||
var isGecko = /* @__PURE__ */ /Gecko\/[0-9.]+/.test(ua); | ||
@@ -29,25 +30,3 @@ var isBlink = /* @__PURE__ */ /Chrome\/[0-9.]+/.test(ua); | ||
var isEdgeHTML = /* @__PURE__ */ /Edge\/[0-9.]+/.test(ua); | ||
export { | ||
isAndroid, | ||
isAppleDevice, | ||
isBlink, | ||
isChrome, | ||
isChromium, | ||
isEdge, | ||
isEdgeHTML, | ||
isFirefox, | ||
isGecko, | ||
isIE, | ||
isIOS, | ||
isIPad, | ||
isIPhone, | ||
isIPod, | ||
isMac, | ||
isMobile, | ||
isOpera, | ||
isPresto, | ||
isSafari, | ||
isTrident, | ||
isWebKit, | ||
isWindows | ||
}; | ||
export { isAndroid, isAppleDevice, isBlink, isChrome, isChromium, isEdge, isEdgeHTML, isFirefox, isGecko, isIE, isIOS, isIPad, isIPhone, isIPod, isMac, isMobile, isOpera, isPresto, isSafari, isTrident, isWebKit, isWindows }; |
@@ -1,47 +0,29 @@ | ||
// src/server.ts | ||
var isAndroid = false; | ||
var isWindows = false; | ||
var isMac = false; | ||
var isIPhone = false; | ||
var isIPad = false; | ||
var isIPod = false; | ||
var isIOS = false; | ||
var isAppleDevice = false; | ||
var isMobile = false; | ||
var isFirefox = false; | ||
var isOpera = false; | ||
var isSafari = false; | ||
var isIE = false; | ||
var isChromium = false; | ||
var isEdge = false; | ||
var isChrome = false; | ||
var isGecko = false; | ||
var isBlink = false; | ||
var isWebKit = false; | ||
var isPresto = false; | ||
var isTrident = false; | ||
var isEdgeHTML = false; | ||
export { | ||
isAndroid, | ||
isAppleDevice, | ||
isBlink, | ||
isChrome, | ||
isChromium, | ||
isEdge, | ||
isEdgeHTML, | ||
isFirefox, | ||
isGecko, | ||
isIE, | ||
isIOS, | ||
isIPad, | ||
isIPhone, | ||
isIPod, | ||
isMac, | ||
isMobile, | ||
isOpera, | ||
isPresto, | ||
isSafari, | ||
isTrident, | ||
isWebKit, | ||
isWindows | ||
}; | ||
// src/index.ts | ||
var w = { document: {}, navigator: { userAgent: "" } } ; | ||
var n = w.navigator; | ||
var ua = "" ; | ||
var isAndroid = /* @__PURE__ */ /Android/.test(ua); | ||
var isWindows = /* @__PURE__ */ /(win32|win64|windows|wince)/i.test(ua); | ||
var isMac = /* @__PURE__ */ /(macintosh|macintel|macppc|mac68k|macos)/i.test(ua); | ||
var isIPhone = /* @__PURE__ */ /iphone/i.test(ua); | ||
var isIPad = /* @__PURE__ */ /ipad/i.test(ua) && n.maxTouchPoints > 1; | ||
var isIPod = /* @__PURE__ */ /ipod/i.test(ua); | ||
var isIOS = isIPhone || isIPad || isIPod; | ||
var isAppleDevice = isIOS || isMac; | ||
var isMobile = /* @__PURE__ */ /Mobi/.test(ua); | ||
var isFirefox = /* @__PURE__ */ /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(ua); | ||
var isOpera = !!w.opr && !!w.opr.addons || !!w.opera || /* @__PURE__ */ / OPR\//.test(ua); | ||
var _a; | ||
var isSafari = /* @__PURE__ */ /constructor/i.test(w.HTMLElement) || ((_a = w.safari) == null ? void 0 : _a.pushNotification) + "" === "[object SafariRemoteNotification]"; | ||
var isIE = !!w.document.documentMode; | ||
var isChromium = !!w.chrome; | ||
var isEdge = /* @__PURE__ */ /Edg/.test(ua) && isChromium; | ||
var isChrome = isChromium && n.vendor === "Google Inc." && !isOpera && !isEdge; | ||
var isGecko = /* @__PURE__ */ /Gecko\/[0-9.]+/.test(ua); | ||
var isBlink = /* @__PURE__ */ /Chrome\/[0-9.]+/.test(ua); | ||
var isWebKit = /* @__PURE__ */ /AppleWebKit\/[0-9.]+/.test(ua) && !isBlink; | ||
var isPresto = /* @__PURE__ */ /Opera\/[0-9.]+/.test(ua); | ||
var isTrident = /* @__PURE__ */ /Trident\/[0-9.]+/.test(ua); | ||
var isEdgeHTML = /* @__PURE__ */ /Edge\/[0-9.]+/.test(ua); | ||
export { isAndroid, isAppleDevice, isBlink, isChrome, isChromium, isEdge, isEdgeHTML, isFirefox, isGecko, isIE, isIOS, isIPad, isIPhone, isIPod, isMac, isMobile, isOpera, isPresto, isSafari, isTrident, isWebKit, isWindows }; |
{ | ||
"name": "@solid-primitives/platform", | ||
"version": "0.0.101", | ||
"version": "0.0.102", | ||
"description": "A set of const boolean variables identifying device and browser type.", | ||
@@ -18,3 +18,3 @@ "author": "Damian Tarnawski <gthetarnav@gmail.com>", | ||
"name": "platform", | ||
"stage": 0, | ||
"stage": 1, | ||
"list": [ | ||
@@ -25,9 +25,35 @@ "List of variables" | ||
}, | ||
"keywords": [ | ||
"solid", | ||
"primitives", | ||
"platform", | ||
"device", | ||
"browser" | ||
], | ||
"private": false, | ||
"sideEffects": false, | ||
"files": [ | ||
"dist" | ||
], | ||
"type": "module", | ||
"main": "./dist/server.cjs", | ||
"module": "./dist/index.js", | ||
"module": "./dist/server.js", | ||
"types": "./dist/index.d.ts", | ||
"browser": { | ||
"./dist/server.cjs": "./dist/index.cjs", | ||
"./dist/server.js": "./dist/index.js" | ||
}, | ||
"exports": { | ||
"worker": { | ||
"import": "./dist/server.js", | ||
"require": "./dist/server.cjs" | ||
}, | ||
"browser": { | ||
"import": "./dist/index.js", | ||
"require": "./dist/index.cjs" | ||
}, | ||
"deno": { | ||
"import": "./dist/server.js", | ||
"require": "./dist/server.cjs" | ||
}, | ||
"node": { | ||
@@ -40,32 +66,14 @@ "import": "./dist/server.js", | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"keywords": [ | ||
"solid", | ||
"primitives", | ||
"platform", | ||
"device", | ||
"browser" | ||
], | ||
"devDependencies": { | ||
"jsdom": "^20.0.0", | ||
"prettier": "^2.7.1", | ||
"solid-js": "^1.5.1", | ||
"tslib": "^2.4.0", | ||
"tsup": "^6.2.2", | ||
"typescript": "^4.7.4", | ||
"unocss": "^0.44.7", | ||
"vite": "^3.0.7", | ||
"vite-plugin-solid": "^2.3.0", | ||
"watchlist": "^0.3.1" | ||
"solid-js": "^1.5.0" | ||
}, | ||
"peerDependencies": { | ||
"solid-js": "^1.4.0" | ||
"solid-js": "^1.5.0" | ||
}, | ||
"scripts": { | ||
"start": "vite serve dev --host", | ||
"dev": "npm run start", | ||
"build": "tsup" | ||
"build": "jiti ../../scripts/build.ts --ssr", | ||
"test": "vitest -c ../../configs/vitest.config.ts", | ||
"test:ssr": "pnpm run test --mode ssr" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
1
14853
203