platform-detect
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -1,1 +0,1 @@ | ||
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports):"function"==typeof define&&define.amd?define("platform-detect",["exports"],o):o(e["platform-detect"]={})}(this,function(e){"use strict";function o(e,o){var n=window.matchMedia(e);o(n.matches);var i=()=>o(n.matches);return n.addListener(i),()=>n.removeListener(i)}function n(e,o){D[e]=D[e]||new Set,D[e].add(o)}function i(e,o){D[e]&&D[e].delete(o)}function t(e,o){D[e]&&D[e].forEach(e=>e(o))}function s(o){e.touch=o,e.mouse=!o,e.inputType=o?"touch":"mouse",e.tabletMode=o,t("inputType",e.inputType),t("tabletMode",e.tabletMode);var n=d();n!==e.formFactor&&(t("formFactor",e.formFactor),e.formFactor=n)}function d(){return c.includes("TV")?"tv":e.touch&&V<600?"phone":e.touch?"tablet":r?"laptop":"desktop"}if(e.hasWindow="undefined"!=typeof navigator&&"undefined"!=typeof window,e.hasWindow&&"undefined"!=typeof nw)try{nw.Window.get()}catch(o){e.hasWindow=!1}var r,a=!e.hasWindow,c=e.hasWindow?navigator.userAgent:void 0,u="undefined"!=typeof process&&!!process.versions&&!!process.versions.node,p=e.hasWindow&&window.matchMedia("(display-mode: standalone)").matches&&null!==document.head.querySelector('[rel="manifest"]'),l="undefined"!=typeof Windows&&"undefined"!=typeof MSApp,f=!(!u||!process.versions.nw),w=!(!u||!process.versions.electron),h=!(!e.hasWindow||!window.cordova),m=l||f||w||h||!1,v=!u&&!m,W=v&&!p,y=!e.hasWindow&&"undefined"!=typeof self&&void 0!==self.importScripts,g=y&&!!navigator.serviceWorker.controller,x=!!e.hasWindow&&c.includes("Android"),M=!!e.hasWindow&&c.includes("CrOS"),b=!!e.hasWindow&&c.includes("Tizen"),k=e.hasWindow&&/iPad|iPhone|iPod/.test(c)&&!window.MSStream||!1,S=x||b,P=u?"win32"===process.platform:c.includes("Windows"),F=u?"darwin"===process.platform:c.includes("Macintosh"),T=u?"linux"===process.platform:c.includes("Linux")&&!S,A=e.hasWindow&&c.includes("Edge/"),E=e.hasWindow&&c.includes("Chrome")&&!A,L=e.hasWindow&&c.includes("Safari")&&!E&&!A,O=e.hasWindow&&c.includes("Opera"),_=e.hasWindow&&c.includes("Firefox"),j=A,C=E,z=C||L,B=_,D={};if(e.hasWindow){e.pixelRatio=parseFloat(window.devicePixelRatio.toFixed(2)),e.touchscreen=navigator.maxTouchPoints>0;var N=window.screen.width,R=window.screen.height,V=Math.min(N,R);o("(orientation: portrait)",o=>{e.portrait=o;e.landscape=!o;e.orientation=o?"portrait":"landscape";t("orientation",e.orientation)}),A?s(e.touchscreen):o("(pointer: coarse)",s)}var q=l||!1;if(e.dev=!1,f)e.dev="sdk"===process.versions["nw-flavor"];else if(w)e.dev=process.execPath.replace(/\\/g,"/").includes("node_modules/electron/");else if(l)e.dev=Windows.ApplicationModel.Package.current.isDevelopmentMode;else if(v){let o=/./;o.toString=(()=>e.dev=!0),console.log("%c",o)}else u&&(e.dev="production"!==process.env.NODE_ENV);e.isConsole=a,e.ua=c,e.registerQuery=o,e.node=u,e.pwa=p,e.uwp=l,e.nwjs=f,e.electron=w,e.cordova=h,e.chromeapp=!1,e.packaged=m,e.web=v,e.website=W,e.worker=y,e.serviceWorker=g,e.android=x,e.chromeos=M,e.tizen=b,e.ios=k,e.linuxBased=S,e.windows=P,e.macosx=F,e.linux=T,e.edge=A,e.chrome=E,e.safari=L,e.opera=O,e.firefox=_,e.edgeHtml=j,e.blink=C,e.webkit=z,e.gecko=B,e.on=n,e.removeListener=i,e.hasBattery=r,e.csp=q,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports):"function"==typeof define&&define.amd?define("platform-detect",["exports"],o):o(e["platform-detect"]={})}(this,function(e){"use strict";function o(e,o){var n=window.matchMedia(e);o(n.matches);var i=()=>o(n.matches);return n.addListener(i),()=>n.removeListener(i)}function n(e,o){D[e]=D[e]||new Set,D[e].add(o)}function i(e,o){D[e]&&D[e].delete(o)}function t(e,o){D[e]&&D[e].forEach(e=>e(o))}function s(o){e.touch=o,e.mouse=!o,e.inputType=o?"touch":"mouse",e.tabletMode=o,t("inputType",e.inputType),t("tabletMode",e.tabletMode);var n=d();n!==e.formFactor&&(t("formFactor",e.formFactor),e.formFactor=n)}function d(){return c.includes("TV")?"tv":e.touch&&V<600?"phone":e.touch?"tablet":r?"laptop":"desktop"}if(e.hasWindow="undefined"!=typeof navigator&&"undefined"!=typeof window,e.hasWindow&&"undefined"!=typeof nw)try{nw.Window.get()}catch(o){e.hasWindow=!1}var r,a=!e.hasWindow,c=e.hasWindow?navigator.userAgent:void 0,u="undefined"!=typeof process&&!!process.versions&&!!process.versions.node,p=e.hasWindow&&window.matchMedia("(display-mode: standalone)").matches&&null!==document.head.querySelector('[rel="manifest"]'),l="undefined"!=typeof Windows&&"undefined"!=typeof MSApp,f=!(!u||!process.versions.nw),w=!(!u||!process.versions.electron),h=!(!e.hasWindow||!window.cordova),m=l||f||w||h||!1,v=!u&&!m,W=v&&!p,y=!e.hasWindow&&"undefined"!=typeof self&&void 0!==self.importScripts,g=y&&!!navigator.serviceWorker.controller,x=!!e.hasWindow&&c.includes("Android"),M=!!e.hasWindow&&c.includes("CrOS"),b=!!e.hasWindow&&c.includes("Tizen"),k=e.hasWindow&&/iPad|iPhone|iPod/.test(c)&&!window.MSStream||!1,S=x||b,P=u?"win32"===process.platform:c.includes("Windows"),F=u?"darwin"===process.platform:c.includes("Macintosh"),T=u?"linux"===process.platform:c.includes("Linux")&&!S,A=e.hasWindow&&c.includes("Edge/"),E=e.hasWindow&&c.includes("Chrome")&&!A,L=e.hasWindow&&c.includes("Safari")&&!E&&!A,O=e.hasWindow&&c.includes("Opera"),_=e.hasWindow&&c.includes("Firefox"),j=A,C=E,z=C||L,B=_,D={};if(e.hasWindow){e.pixelRatio=parseFloat(window.devicePixelRatio.toFixed(2)),e.touchscreen=navigator.maxTouchPoints>0;var N=window.screen.width,R=window.screen.height,V=Math.min(N,R);o("(orientation: portrait)",o=>{e.portrait=o;e.landscape=!o;e.orientation=o?"portrait":"landscape";t("orientation",e.orientation)}),A?s(e.touchscreen):o("(pointer: coarse)",s)}var q=l||!1;if(e.dev=!1,f)e.dev="sdk"===process.versions["nw-flavor"];else if(w)e.dev=process.execPath.replace(/\\/g,"/").includes("node_modules/electron/");else if(l)e.dev=Windows.ApplicationModel.Package.current.isDevelopmentMode;else if(v){let o=/./;o.toString=(()=>e.dev=!0),console.log("%c",o)}else u&&(e.dev="production"!==process.env.NODE_ENV);e.isConsole=a,e.ua=c,e.registerQuery=o,e.node=u,e.pwa=p,e.uwp=l,e.nwjs=f,e.electron=w,e.cordova=h,e.chromeapp=!1,e.packaged=m,e.web=v,e.website=W,e.worker=y,e.serviceWorker=g,e.android=x,e.chromeos=M,e.tizen=b,e.ios=k,e.linuxBased=S,e.windows=P,e.macos=F,e.linux=T,e.edge=A,e.chrome=E,e.safari=L,e.opera=O,e.firefox=_,e.edgeHtml=j,e.blink=C,e.webkit=z,e.gecko=B,e.on=n,e.removeListener=i,e.hasBattery=r,e.csp=q,Object.defineProperty(e,"__esModule",{value:!0})}); |
{ | ||
"name": "platform-detect", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "🃏 Minimalistic isomorphic library for detection of platform, runtime, APIs and more.", | ||
@@ -5,0 +5,0 @@ "author": "Mike Kovarik", |
@@ -23,3 +23,3 @@ # platform-detect | ||
* **Systems**: Windows, Android, MacOsX, iOs, Linux | ||
* **Systems**: Windows, Android, macOS, iOS, Linux | ||
* **Runtime** | ||
@@ -73,3 +73,3 @@ * **general:** Node.js, browser, web worker | ||
```js | ||
import {windows, android, linux, macosx, tizen} from 'platform-detect/os.mjs' | ||
import {windows, android, linux, macos, tizen} from 'platform-detect/os.mjs' | ||
import {chrome, edge, safari} from 'platform-detect/browser.mjs' | ||
@@ -76,0 +76,0 @@ import {inputType, mouse, touch, touchscreen, tabletMode, formFactor} from 'platform-detect/formfactor.mjs' |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
19833