@zcorky/device
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -27,4 +27,53 @@ export interface IDevice { | ||
language(): string; | ||
geolocation(): Promise<Position>; | ||
getGeolocation(): Promise<Position>; | ||
getConnection(): Promise<IConnection>; | ||
getBattery(): Promise<IBattery>; | ||
getClipboard(): Promise<IClipboard | undefined>; | ||
getUserMedia(options?: MediaStreamConstraints): Promise<MediaStream>; | ||
} | ||
export interface IConnection { | ||
/** | ||
* 网络下行速度 | ||
*/ | ||
readonly downlink: number; | ||
/** | ||
* 网络类型 | ||
*/ | ||
readonly effectiveType: '4g'; | ||
/** | ||
* 有值代表网络状态变更 | ||
*/ | ||
onchange: null | Function; | ||
/** | ||
* 打开请求数据保护模式 | ||
*/ | ||
readonly saveData: boolean; | ||
} | ||
export interface IBattery { | ||
/** | ||
* 是否正在充电 | ||
*/ | ||
readonly charging: boolean; | ||
/** | ||
* 距离充电完毕还需要多长时间,如果为0则充电完毕 | ||
* 单位秒 | ||
*/ | ||
readonly chargingTime: number; | ||
/** | ||
* 电池剩余使用时间,单位秒 | ||
*/ | ||
readonly dischargingTime: number; | ||
/** | ||
* 代表电量百分比, 值为 0.0 - 1.0 | ||
*/ | ||
readonly level: number; | ||
onchargingchange: null | Function; | ||
onchargingtimechange: null | Function; | ||
ondischaringtimechange: null | Function; | ||
onlevelchange: null | Function; | ||
} | ||
export interface IClipboard { | ||
readText(): Promise<string>; | ||
writeText(text: string): Promise<void>; | ||
} | ||
export interface IOS { | ||
@@ -68,3 +117,7 @@ name: string; | ||
language(): string; | ||
geolocation(): Promise<Position>; | ||
getGeolocation(): Promise<Position>; | ||
getConnection(): Promise<IConnection>; | ||
getBattery(): Promise<IBattery>; | ||
getClipboard(): Promise<IClipboard>; | ||
getUserMedia(options?: MediaStreamConstraints): Promise<MediaStream>; | ||
windowSize(): { | ||
@@ -71,0 +124,0 @@ screenWidth: any; |
@@ -1,1 +0,1 @@ | ||
this["lib/index"]=this["lib/index"]||{},this["lib/index"].iife=this["lib/index"].iife||{},this["lib/index"].iife.js=function(i){"use strict";function t(i){var t,e;t=Array.prototype.forEach,e=Array.prototype.map,this.each=function(i,e,n){if(null!==i)if(t&&i.forEach===t)i.forEach(e,n);else if(i.length===+i.length){for(var o=0,r=i.length;o<r;o++)if(e.call(n,i[o],o,i)==={})return}else for(var s in i)if(i.hasOwnProperty(s)&&e.call(n,i[s],s,i)==={})return},this.map=function(i,t,n){var o=[];return null==i?o:e&&i.map===e?i.map(t,n):(this.each(i,function(i,e,r){o[o.length]=t.call(n,i,e,r)}),o)},"object"==typeof i?(this.hasher=i.hasher,this.screen_resolution=i.screen_resolution,this.screen_orientation=i.screen_orientation,this.canvas=i.canvas,this.ie_activex=i.ie_activex):"function"==typeof i&&(this.hasher=i)}t.prototype={get:function(){var i=[];if(i.push(navigator.userAgent),i.push(navigator.language),i.push(screen.colorDepth),this.screen_resolution){var t=this.getScreenResolution();void 0!==t&&i.push(t.join("x"))}return i.push((new Date).getTimezoneOffset()),i.push(this.hasSessionStorage()),i.push(this.hasLocalStorage()),i.push(this.hasIndexDb()),document.body?i.push(typeof document.body.addBehavior):i.push("undefined"),i.push(typeof window.openDatabase),i.push(navigator.cpuClass),i.push(navigator.platform),i.push(navigator.doNotTrack),i.push(this.getPluginsString()),this.canvas&&this.isCanvasSupported()&&i.push(this.getCanvasFingerprint()),this.hasher?this.hasher(i.join("###"),31):this.murmurhash3_32_gc(i.join("###"),31)},murmurhash3_32_gc:function(i,t){var e,n,o,r,s,u,a,h;for(e=3&i.length,n=i.length-e,o=t,s=3432918353,u=461845907,h=0;h<n;)a=255&i.charCodeAt(h)|(255&i.charCodeAt(++h))<<8|(255&i.charCodeAt(++h))<<16|(255&i.charCodeAt(++h))<<24,++h,o=27492+(65535&(r=5*(65535&(o=(o^=a=(65535&(a=(a=(65535&a)*s+(((a>>>16)*s&65535)<<16)&4294967295)<<15|a>>>17))*u+(((a>>>16)*u&65535)<<16)&4294967295)<<13|o>>>19))+((5*(o>>>16)&65535)<<16)&4294967295))+((58964+(r>>>16)&65535)<<16);switch(a=0,e){case 3:a^=(255&i.charCodeAt(h+2))<<16;case 2:a^=(255&i.charCodeAt(h+1))<<8;case 1:o^=a=(65535&(a=(a=(65535&(a^=255&i.charCodeAt(h)))*s+(((a>>>16)*s&65535)<<16)&4294967295)<<15|a>>>17))*u+(((a>>>16)*u&65535)<<16)&4294967295}return o^=i.length,o=2246822507*(65535&(o^=o>>>16))+((2246822507*(o>>>16)&65535)<<16)&4294967295,o=3266489909*(65535&(o^=o>>>13))+((3266489909*(o>>>16)&65535)<<16)&4294967295,(o^=o>>>16)>>>0},hasLocalStorage:function(){try{return!!window.localStorage}catch(i){return!0}},hasSessionStorage:function(){try{return!!window.sessionStorage}catch(i){return!0}},hasIndexDb:function(){try{return!!window.indexedDB}catch(i){return!0}},isCanvasSupported:function(){var i=document.createElement("canvas");return!(!i.getContext||!i.getContext("2d"))},isIE:function(){return"Microsoft Internet Explorer"===navigator.appName||!("Netscape"!==navigator.appName||!/Trident/.test(navigator.userAgent))},getPluginsString:function(){return this.isIE()&&this.ie_activex?this.getIEPluginsString():this.getRegularPluginsString()},getRegularPluginsString:function(){return this.map(navigator.plugins,function(i){var t=this.map(i,function(i){return[i.type,i.suffixes].join("~")}).join(",");return[i.name,i.description,t].join("::")},this).join(";")},getIEPluginsString:function(){if(window.ActiveXObject){var i=["ShockwaveFlash.ShockwaveFlash","AcroPDF.PDF","PDF.PdfCtrl","QuickTime.QuickTime","rmocx.RealPlayer G2 Control","rmocx.RealPlayer G2 Control.1","RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)","RealVideo.RealVideo(tm) ActiveX Control (32-bit)","RealPlayer","SWCtl.SWCtl","WMPlayer.OCX","AgControl.AgControl","Skype.Detection"];return this.map(i,function(i){try{return new window.ActiveXObject(i),i}catch(i){return null}}).join(";")}return""},getScreenResolution:function(){return this.screen_orientation?screen.height>screen.width?[screen.height,screen.width]:[screen.width,screen.height]:[screen.height,screen.width]},getCanvasFingerprint:function(){var i=document.createElement("canvas"),t=i.getContext("2d"),e="http://valve.github.io";return t.textBaseline="top",t.font="14px 'Arial'",t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(125,1,62,20),t.fillStyle="#069",t.fillText(e,2,15),t.fillStyle="rgba(102, 204, 0, 0.7)",t.fillText(e,4,17),i.toDataURL()}};var e=require("global"),n=function(){function i(i){void 0===i&&(i=null===(t=null===e||void 0===e?void 0:e.navigator)||void 0===t?void 0:t.userAgent);var t;this.ua=i}return i.prototype.userAgent=function(){return this.ua},i.prototype.os=function(){return{name:this.osName(),version:this.osVersion()}},i.prototype.browser=function(){return{name:this.browserName(),version:this.browserVersion()}},i.prototype.platform=function(){var i;return null===(i=null===e||void 0===e?void 0:e.navigator)||void 0===i?void 0:i.platform},i.prototype.isWindows=function(){return this.is(/windows/i)},i.prototype.isMac=function(){return this.is(/macintosh/i)},i.prototype.isLinux=function(){return this.is(/linux/i)},i.prototype.isAndroid=function(){return this.is(/Android/i)},i.prototype.isiOS=function(){return this.is(/iPhone|iPad|iPod/i)},i.prototype.isChrome=function(){return this.is(/chrome/i)},i.prototype.isFirefox=function(){return this.is(/firefox/i)},i.prototype.isSafari=function(){return this.is(/Safari\/([\d\.]+)/i)},i.prototype.isIE=function(){return this.is(/msie (\d+\.\d+)/i)},i.prototype.isQQBrowser=function(){return this.is(/MQQBrowser/i)},i.prototype.isWeixin=function(){return this.is(/MicroMessenger/i)},i.prototype.isQQ=function(){return this.is(/\ QQ\//i)},i.prototype.isWeibo=function(){return this.is(/Weibo/i)},i.prototype.isWebview=function(){return!this.isiOS()&&!!this.is(/.*AppleWebKit(?!.*Safari)/i)},i.prototype.isMobile=function(){return this.is(/mobile/i)},i.prototype.isiPhone=function(){return this.is(/iPhone/i)},i.prototype.isOnline=function(){var i;return!!(null===(i=null===e||void 0===e?void 0:e.navigator)||void 0===i?void 0:i.onLine)},i.prototype.language=function(){var i;return null===(i=null===e||void 0===e?void 0:e.navigator)||void 0===i?void 0:i.language},i.prototype.geolocation=function(){return i=this,t=void 0,n=Promise,o=function(){return __generator(this,function(i){return[2,new Promise(function(i,t){e.navigator.geolocation.getCurrentPosition(i,t)})]})},new(n||(n=Promise))(function(e,r){function s(i){try{a(o.next(i))}catch(i){r(i)}}function u(i){try{a(o.throw(i))}catch(i){r(i)}}function a(i){i.done?e(i.value):new n(function(t){t(i.value)}).then(s,u)}a((o=o.apply(i,t)).next())});var i,t,n,o},i.prototype.windowSize=function(){var i,t,n,o,r,s,u,a;return{screenWidth:null!==(t=null===(i=null===e||void 0===e?void 0:e.screen)||void 0===i?void 0:i.width)&&void 0!==t?t:-1,screenHeight:null!==(o=null===(n=null===e||void 0===e?void 0:e.screen)||void 0===n?void 0:n.height)&&void 0!==o?o:-1,outerWidth:null===e||void 0===e?void 0:e.outerWidth,outerHeight:null===e||void 0===e?void 0:e.outerHeight,width:(null===e||void 0===e?void 0:e.innerWidth)||(null===(s=null===(r=null===e||void 0===e?void 0:e.document)||void 0===r?void 0:r.documentElement)||void 0===s?void 0:s.width),height:(null===e||void 0===e?void 0:e.innerHeight)||(null===(a=null===(u=null===e||void 0===e?void 0:e.document)||void 0===u?void 0:u.documentElement)||void 0===a?void 0:a.height)}},i.prototype.devicePixelRatio=function(){var i;return null!==(i=null===e||void 0===e?void 0:e.devicePixelRatio)&&void 0!==i?i:1},i.prototype.fingerprint=function(){return new t(void 0).get()},i.prototype.osName=function(){return this.isAndroid()?"Android":this.isiOS()?"iOS":this.isMac()?"MacOS":this.isWindows()?"Windows":this.isLinux()?"Linux":""},i.prototype.osVersion=function(){if(this.isAndroid())return this.v(/Android\s(\d+\.\d+)/i);if(this.isiOS())return this.v(/iPhone\sOS\s([\d_]+)|iPad.*OS\s([\d_]+)/i);if(this.isMac()){var i=this.v(/Mac\sOS\sX\s((\d+_\d+_\d+)|(\d+\.\d+))/i);return i&&i.replace(/_/g,".")}return this.isWindows()?this.v(/windows\snt\s([\d\.]+)/i):(this.isLinux(),"")},i.prototype.browserName=function(){return this.isChrome()?"Chrome":this.isFirefox()?"Firefox":this.isSafari()?"Safari":this.isIE()?"IE":this.isQQBrowser()?"QQBrowser":"unknown"},i.prototype.browserVersion=function(){return this.isChrome()?this.v(/chrome\/(\d+\.\d+\.\d+\.\d+)/i):this.isFirefox()?this.v(/firefox\/(\d+\.\d+)/i):this.isSafari()?this.v(/Safari\/([\d\.]+)/i):this.isIE()?this.v(/MSIE ([0-9]{1,}[\.0-9]{0,})/i):this.isQQBrowser()?this.v(/\ MQQBrowser\/([^\s]+)/i):"unknown"},i.prototype.is=function(i){return i.test(this.ua)},i.prototype.v=function(i){var t,e;return null!==(e=null===(t=i.exec(this.ua))||void 0===t?void 0:t[1])&&void 0!==e?e:""},i}();return i.default=n,i.Device=n,i}({}); | ||
this["lib/index"]=this["lib/index"]||{},this["lib/index"].iife=this["lib/index"].iife||{},this["lib/index"].iife.js=function(i){"use strict";function t(i,t,e,n){return new(e||(e=Promise))(function(o,r){function s(i){try{a(n.next(i))}catch(i){r(i)}}function u(i){try{a(n.throw(i))}catch(i){r(i)}}function a(i){i.done?o(i.value):new e(function(t){t(i.value)}).then(s,u)}a((n=n.apply(i,t)).next())})}function e(i){var t,e;t=Array.prototype.forEach,e=Array.prototype.map,this.each=function(i,e,n){if(null!==i)if(t&&i.forEach===t)i.forEach(e,n);else if(i.length===+i.length){for(var o=0,r=i.length;o<r;o++)if(e.call(n,i[o],o,i)==={})return}else for(var s in i)if(i.hasOwnProperty(s)&&e.call(n,i[s],s,i)==={})return},this.map=function(i,t,n){var o=[];return null==i?o:e&&i.map===e?i.map(t,n):(this.each(i,function(i,e,r){o[o.length]=t.call(n,i,e,r)}),o)},"object"==typeof i?(this.hasher=i.hasher,this.screen_resolution=i.screen_resolution,this.screen_orientation=i.screen_orientation,this.canvas=i.canvas,this.ie_activex=i.ie_activex):"function"==typeof i&&(this.hasher=i)}e.prototype={get:function(){var i=[];if(i.push(navigator.userAgent),i.push(navigator.language),i.push(screen.colorDepth),this.screen_resolution){var t=this.getScreenResolution();void 0!==t&&i.push(t.join("x"))}return i.push((new Date).getTimezoneOffset()),i.push(this.hasSessionStorage()),i.push(this.hasLocalStorage()),i.push(this.hasIndexDb()),document.body?i.push(typeof document.body.addBehavior):i.push("undefined"),i.push(typeof window.openDatabase),i.push(navigator.cpuClass),i.push(navigator.platform),i.push(navigator.doNotTrack),i.push(this.getPluginsString()),this.canvas&&this.isCanvasSupported()&&i.push(this.getCanvasFingerprint()),this.hasher?this.hasher(i.join("###"),31):this.murmurhash3_32_gc(i.join("###"),31)},murmurhash3_32_gc:function(i,t){var e,n,o,r,s,u,a,h;for(e=3&i.length,n=i.length-e,o=t,s=3432918353,u=461845907,h=0;h<n;)a=255&i.charCodeAt(h)|(255&i.charCodeAt(++h))<<8|(255&i.charCodeAt(++h))<<16|(255&i.charCodeAt(++h))<<24,++h,o=27492+(65535&(r=5*(65535&(o=(o^=a=(65535&(a=(a=(65535&a)*s+(((a>>>16)*s&65535)<<16)&4294967295)<<15|a>>>17))*u+(((a>>>16)*u&65535)<<16)&4294967295)<<13|o>>>19))+((5*(o>>>16)&65535)<<16)&4294967295))+((58964+(r>>>16)&65535)<<16);switch(a=0,e){case 3:a^=(255&i.charCodeAt(h+2))<<16;case 2:a^=(255&i.charCodeAt(h+1))<<8;case 1:o^=a=(65535&(a=(a=(65535&(a^=255&i.charCodeAt(h)))*s+(((a>>>16)*s&65535)<<16)&4294967295)<<15|a>>>17))*u+(((a>>>16)*u&65535)<<16)&4294967295}return o^=i.length,o=2246822507*(65535&(o^=o>>>16))+((2246822507*(o>>>16)&65535)<<16)&4294967295,o=3266489909*(65535&(o^=o>>>13))+((3266489909*(o>>>16)&65535)<<16)&4294967295,(o^=o>>>16)>>>0},hasLocalStorage:function(){try{return!!window.localStorage}catch(i){return!0}},hasSessionStorage:function(){try{return!!window.sessionStorage}catch(i){return!0}},hasIndexDb:function(){try{return!!window.indexedDB}catch(i){return!0}},isCanvasSupported:function(){var i=document.createElement("canvas");return!(!i.getContext||!i.getContext("2d"))},isIE:function(){return"Microsoft Internet Explorer"===navigator.appName||!("Netscape"!==navigator.appName||!/Trident/.test(navigator.userAgent))},getPluginsString:function(){return this.isIE()&&this.ie_activex?this.getIEPluginsString():this.getRegularPluginsString()},getRegularPluginsString:function(){return this.map(navigator.plugins,function(i){var t=this.map(i,function(i){return[i.type,i.suffixes].join("~")}).join(",");return[i.name,i.description,t].join("::")},this).join(";")},getIEPluginsString:function(){if(window.ActiveXObject){var i=["ShockwaveFlash.ShockwaveFlash","AcroPDF.PDF","PDF.PdfCtrl","QuickTime.QuickTime","rmocx.RealPlayer G2 Control","rmocx.RealPlayer G2 Control.1","RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)","RealVideo.RealVideo(tm) ActiveX Control (32-bit)","RealPlayer","SWCtl.SWCtl","WMPlayer.OCX","AgControl.AgControl","Skype.Detection"];return this.map(i,function(i){try{return new window.ActiveXObject(i),i}catch(i){return null}}).join(";")}return""},getScreenResolution:function(){return this.screen_orientation?screen.height>screen.width?[screen.height,screen.width]:[screen.width,screen.height]:[screen.height,screen.width]},getCanvasFingerprint:function(){var i=document.createElement("canvas"),t=i.getContext("2d"),e="http://valve.github.io";return t.textBaseline="top",t.font="14px 'Arial'",t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(125,1,62,20),t.fillStyle="#069",t.fillText(e,2,15),t.fillStyle="rgba(102, 204, 0, 0.7)",t.fillText(e,4,17),i.toDataURL()}};var n=require("global"),o=function(){function i(i){void 0===i&&(i=null===(t=null===n||void 0===n?void 0:n.navigator)||void 0===t?void 0:t.userAgent);var t;this.ua=i}return i.prototype.userAgent=function(){return this.ua},i.prototype.os=function(){return{name:this.osName(),version:this.osVersion()}},i.prototype.browser=function(){return{name:this.browserName(),version:this.browserVersion()}},i.prototype.platform=function(){var i;return null===(i=null===n||void 0===n?void 0:n.navigator)||void 0===i?void 0:i.platform},i.prototype.isWindows=function(){return this.is(/windows/i)},i.prototype.isMac=function(){return this.is(/macintosh/i)},i.prototype.isLinux=function(){return this.is(/linux/i)},i.prototype.isAndroid=function(){return this.is(/Android/i)},i.prototype.isiOS=function(){return this.is(/iPhone|iPad|iPod/i)},i.prototype.isChrome=function(){return this.is(/chrome/i)},i.prototype.isFirefox=function(){return this.is(/firefox/i)},i.prototype.isSafari=function(){return this.is(/Safari\/([\d\.]+)/i)},i.prototype.isIE=function(){return this.is(/msie (\d+\.\d+)/i)},i.prototype.isQQBrowser=function(){return this.is(/MQQBrowser/i)},i.prototype.isWeixin=function(){return this.is(/MicroMessenger/i)},i.prototype.isQQ=function(){return this.is(/\ QQ\//i)},i.prototype.isWeibo=function(){return this.is(/Weibo/i)},i.prototype.isWebview=function(){return!this.isiOS()&&!!this.is(/.*AppleWebKit(?!.*Safari)/i)},i.prototype.isMobile=function(){return this.is(/mobile/i)},i.prototype.isiPhone=function(){return this.is(/iPhone/i)},i.prototype.isOnline=function(){var i;return!!(null===(i=null===n||void 0===n?void 0:n.navigator)||void 0===i?void 0:i.onLine)},i.prototype.language=function(){var i;return null===(i=null===n||void 0===n?void 0:n.navigator)||void 0===i?void 0:i.language},i.prototype.getGeolocation=function(){return t(this,void 0,Promise,function(){return __generator(this,function(i){return[2,new Promise(function(i,t){n.navigator.geolocation.getCurrentPosition(i,t)})]})})},i.prototype.getConnection=function(){var i;return t(this,void 0,Promise,function(){return __generator(this,function(t){return[2,(null===(i=n.navigator)||void 0===i?void 0:i.connection)||{}]})})},i.prototype.getBattery=function(){var i,e;return t(this,void 0,Promise,function(){return __generator(this,function(t){return[2,null===(e=null===(i=n.navigator)||void 0===i?void 0:i.getBattery)||void 0===e?void 0:e.call(i)]})})},i.prototype.getClipboard=function(){var i;return t(this,void 0,Promise,function(){return __generator(this,function(t){return[2,null===(i=n.navigator)||void 0===i?void 0:i.clipboard]})})},i.prototype.getUserMedia=function(i){return void 0===i&&(i={audio:!0,video:!0}),t(this,void 0,Promise,function(){return __generator(this,function(t){return[2,navigator.mediaDevices.getUserMedia(i)]})})},i.prototype.windowSize=function(){var i,t,e,o,r,s,u,a;return{screenWidth:null!==(t=null===(i=null===n||void 0===n?void 0:n.screen)||void 0===i?void 0:i.width)&&void 0!==t?t:-1,screenHeight:null!==(o=null===(e=null===n||void 0===n?void 0:n.screen)||void 0===e?void 0:e.height)&&void 0!==o?o:-1,outerWidth:null===n||void 0===n?void 0:n.outerWidth,outerHeight:null===n||void 0===n?void 0:n.outerHeight,width:(null===n||void 0===n?void 0:n.innerWidth)||(null===(s=null===(r=null===n||void 0===n?void 0:n.document)||void 0===r?void 0:r.documentElement)||void 0===s?void 0:s.width),height:(null===n||void 0===n?void 0:n.innerHeight)||(null===(a=null===(u=null===n||void 0===n?void 0:n.document)||void 0===u?void 0:u.documentElement)||void 0===a?void 0:a.height)}},i.prototype.devicePixelRatio=function(){var i;return null!==(i=null===n||void 0===n?void 0:n.devicePixelRatio)&&void 0!==i?i:1},i.prototype.fingerprint=function(){return new e(void 0).get()},i.prototype.osName=function(){return this.isAndroid()?"Android":this.isiOS()?"iOS":this.isMac()?"MacOS":this.isWindows()?"Windows":this.isLinux()?"Linux":""},i.prototype.osVersion=function(){if(this.isAndroid())return this.v(/Android\s(\d+\.\d+)/i);if(this.isiOS())return this.v(/iPhone\sOS\s([\d_]+)|iPad.*OS\s([\d_]+)/i);if(this.isMac()){var i=this.v(/Mac\sOS\sX\s((\d+_\d+_\d+)|(\d+\.\d+))/i);return i&&i.replace(/_/g,".")}return this.isWindows()?this.v(/windows\snt\s([\d\.]+)/i):(this.isLinux(),"")},i.prototype.browserName=function(){return this.isChrome()?"Chrome":this.isFirefox()?"Firefox":this.isSafari()?"Safari":this.isIE()?"IE":this.isQQBrowser()?"QQBrowser":"unknown"},i.prototype.browserVersion=function(){return this.isChrome()?this.v(/chrome\/(\d+\.\d+\.\d+\.\d+)/i):this.isFirefox()?this.v(/firefox\/(\d+\.\d+)/i):this.isSafari()?this.v(/Safari\/([\d\.]+)/i):this.isIE()?this.v(/MSIE ([0-9]{1,}[\.0-9]{0,})/i):this.isQQBrowser()?this.v(/\ MQQBrowser\/([^\s]+)/i):"unknown"},i.prototype.is=function(i){return i.test(this.ua)},i.prototype.v=function(i){var t,e;return null!==(e=null===(t=i.exec(this.ua))||void 0===t?void 0:t[1])&&void 0!==e?e:""},i}();return i.default=o,i.Device=o,i}({}); |
@@ -128,3 +128,3 @@ "use strict"; | ||
}; | ||
Device.prototype.geolocation = function () { | ||
Device.prototype.getGeolocation = function () { | ||
return __awaiter(this, void 0, void 0, function () { | ||
@@ -138,2 +138,34 @@ return __generator(this, function (_a) { | ||
}; | ||
Device.prototype.getConnection = function () { | ||
var _a; | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_b) { | ||
return [2 /*return*/, ((_a = window.navigator) === null || _a === void 0 ? void 0 : _a.connection) || {}]; | ||
}); | ||
}); | ||
}; | ||
Device.prototype.getBattery = function () { | ||
var _a, _b; | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_c) { | ||
return [2 /*return*/, (_b = (_a = window.navigator) === null || _a === void 0 ? void 0 : _a.getBattery) === null || _b === void 0 ? void 0 : _b.call(_a)]; | ||
}); | ||
}); | ||
}; | ||
Device.prototype.getClipboard = function () { | ||
var _a; | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_b) { | ||
return [2 /*return*/, (_a = window.navigator) === null || _a === void 0 ? void 0 : _a.clipboard]; | ||
}); | ||
}); | ||
}; | ||
Device.prototype.getUserMedia = function (options) { | ||
if (options === void 0) { options = { audio: true, video: true }; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, navigator.mediaDevices.getUserMedia(options)]; | ||
}); | ||
}); | ||
}; | ||
Device.prototype.windowSize = function () { | ||
@@ -140,0 +172,0 @@ var _a, _b, _c, _d, _e, _f, _g, _h; |
@@ -1,1 +0,1 @@ | ||
!function(i,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((i["lib/index"]=i["lib/index"]||{},i["lib/index"].umd=i["lib/index"].umd||{},i["lib/index"].umd.js={}))}(this,function(i){"use strict";function t(i){var t,e;t=Array.prototype.forEach,e=Array.prototype.map,this.each=function(i,e,n){if(null!==i)if(t&&i.forEach===t)i.forEach(e,n);else if(i.length===+i.length){for(var o=0,r=i.length;o<r;o++)if(e.call(n,i[o],o,i)==={})return}else for(var s in i)if(i.hasOwnProperty(s)&&e.call(n,i[s],s,i)==={})return},this.map=function(i,t,n){var o=[];return null==i?o:e&&i.map===e?i.map(t,n):(this.each(i,function(i,e,r){o[o.length]=t.call(n,i,e,r)}),o)},"object"==typeof i?(this.hasher=i.hasher,this.screen_resolution=i.screen_resolution,this.screen_orientation=i.screen_orientation,this.canvas=i.canvas,this.ie_activex=i.ie_activex):"function"==typeof i&&(this.hasher=i)}t.prototype={get:function(){var i=[];if(i.push(navigator.userAgent),i.push(navigator.language),i.push(screen.colorDepth),this.screen_resolution){var t=this.getScreenResolution();void 0!==t&&i.push(t.join("x"))}return i.push((new Date).getTimezoneOffset()),i.push(this.hasSessionStorage()),i.push(this.hasLocalStorage()),i.push(this.hasIndexDb()),document.body?i.push(typeof document.body.addBehavior):i.push("undefined"),i.push(typeof window.openDatabase),i.push(navigator.cpuClass),i.push(navigator.platform),i.push(navigator.doNotTrack),i.push(this.getPluginsString()),this.canvas&&this.isCanvasSupported()&&i.push(this.getCanvasFingerprint()),this.hasher?this.hasher(i.join("###"),31):this.murmurhash3_32_gc(i.join("###"),31)},murmurhash3_32_gc:function(i,t){var e,n,o,r,s,u,a,h;for(e=3&i.length,n=i.length-e,o=t,s=3432918353,u=461845907,h=0;h<n;)a=255&i.charCodeAt(h)|(255&i.charCodeAt(++h))<<8|(255&i.charCodeAt(++h))<<16|(255&i.charCodeAt(++h))<<24,++h,o=27492+(65535&(r=5*(65535&(o=(o^=a=(65535&(a=(a=(65535&a)*s+(((a>>>16)*s&65535)<<16)&4294967295)<<15|a>>>17))*u+(((a>>>16)*u&65535)<<16)&4294967295)<<13|o>>>19))+((5*(o>>>16)&65535)<<16)&4294967295))+((58964+(r>>>16)&65535)<<16);switch(a=0,e){case 3:a^=(255&i.charCodeAt(h+2))<<16;case 2:a^=(255&i.charCodeAt(h+1))<<8;case 1:o^=a=(65535&(a=(a=(65535&(a^=255&i.charCodeAt(h)))*s+(((a>>>16)*s&65535)<<16)&4294967295)<<15|a>>>17))*u+(((a>>>16)*u&65535)<<16)&4294967295}return o^=i.length,o=2246822507*(65535&(o^=o>>>16))+((2246822507*(o>>>16)&65535)<<16)&4294967295,o=3266489909*(65535&(o^=o>>>13))+((3266489909*(o>>>16)&65535)<<16)&4294967295,(o^=o>>>16)>>>0},hasLocalStorage:function(){try{return!!window.localStorage}catch(i){return!0}},hasSessionStorage:function(){try{return!!window.sessionStorage}catch(i){return!0}},hasIndexDb:function(){try{return!!window.indexedDB}catch(i){return!0}},isCanvasSupported:function(){var i=document.createElement("canvas");return!(!i.getContext||!i.getContext("2d"))},isIE:function(){return"Microsoft Internet Explorer"===navigator.appName||!("Netscape"!==navigator.appName||!/Trident/.test(navigator.userAgent))},getPluginsString:function(){return this.isIE()&&this.ie_activex?this.getIEPluginsString():this.getRegularPluginsString()},getRegularPluginsString:function(){return this.map(navigator.plugins,function(i){var t=this.map(i,function(i){return[i.type,i.suffixes].join("~")}).join(",");return[i.name,i.description,t].join("::")},this).join(";")},getIEPluginsString:function(){if(window.ActiveXObject){var i=["ShockwaveFlash.ShockwaveFlash","AcroPDF.PDF","PDF.PdfCtrl","QuickTime.QuickTime","rmocx.RealPlayer G2 Control","rmocx.RealPlayer G2 Control.1","RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)","RealVideo.RealVideo(tm) ActiveX Control (32-bit)","RealPlayer","SWCtl.SWCtl","WMPlayer.OCX","AgControl.AgControl","Skype.Detection"];return this.map(i,function(i){try{return new window.ActiveXObject(i),i}catch(i){return null}}).join(";")}return""},getScreenResolution:function(){return this.screen_orientation?screen.height>screen.width?[screen.height,screen.width]:[screen.width,screen.height]:[screen.height,screen.width]},getCanvasFingerprint:function(){var i=document.createElement("canvas"),t=i.getContext("2d"),e="http://valve.github.io";return t.textBaseline="top",t.font="14px 'Arial'",t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(125,1,62,20),t.fillStyle="#069",t.fillText(e,2,15),t.fillStyle="rgba(102, 204, 0, 0.7)",t.fillText(e,4,17),i.toDataURL()}};var e=require("global"),n=function(){function i(i){void 0===i&&(i=null===(t=null===e||void 0===e?void 0:e.navigator)||void 0===t?void 0:t.userAgent);var t;this.ua=i}return i.prototype.userAgent=function(){return this.ua},i.prototype.os=function(){return{name:this.osName(),version:this.osVersion()}},i.prototype.browser=function(){return{name:this.browserName(),version:this.browserVersion()}},i.prototype.platform=function(){var i;return null===(i=null===e||void 0===e?void 0:e.navigator)||void 0===i?void 0:i.platform},i.prototype.isWindows=function(){return this.is(/windows/i)},i.prototype.isMac=function(){return this.is(/macintosh/i)},i.prototype.isLinux=function(){return this.is(/linux/i)},i.prototype.isAndroid=function(){return this.is(/Android/i)},i.prototype.isiOS=function(){return this.is(/iPhone|iPad|iPod/i)},i.prototype.isChrome=function(){return this.is(/chrome/i)},i.prototype.isFirefox=function(){return this.is(/firefox/i)},i.prototype.isSafari=function(){return this.is(/Safari\/([\d\.]+)/i)},i.prototype.isIE=function(){return this.is(/msie (\d+\.\d+)/i)},i.prototype.isQQBrowser=function(){return this.is(/MQQBrowser/i)},i.prototype.isWeixin=function(){return this.is(/MicroMessenger/i)},i.prototype.isQQ=function(){return this.is(/\ QQ\//i)},i.prototype.isWeibo=function(){return this.is(/Weibo/i)},i.prototype.isWebview=function(){return!this.isiOS()&&!!this.is(/.*AppleWebKit(?!.*Safari)/i)},i.prototype.isMobile=function(){return this.is(/mobile/i)},i.prototype.isiPhone=function(){return this.is(/iPhone/i)},i.prototype.isOnline=function(){var i;return!!(null===(i=null===e||void 0===e?void 0:e.navigator)||void 0===i?void 0:i.onLine)},i.prototype.language=function(){var i;return null===(i=null===e||void 0===e?void 0:e.navigator)||void 0===i?void 0:i.language},i.prototype.geolocation=function(){return i=this,t=void 0,n=Promise,o=function(){return __generator(this,function(i){return[2,new Promise(function(i,t){e.navigator.geolocation.getCurrentPosition(i,t)})]})},new(n||(n=Promise))(function(e,r){function s(i){try{a(o.next(i))}catch(i){r(i)}}function u(i){try{a(o.throw(i))}catch(i){r(i)}}function a(i){i.done?e(i.value):new n(function(t){t(i.value)}).then(s,u)}a((o=o.apply(i,t)).next())});var i,t,n,o},i.prototype.windowSize=function(){var i,t,n,o,r,s,u,a;return{screenWidth:null!==(t=null===(i=null===e||void 0===e?void 0:e.screen)||void 0===i?void 0:i.width)&&void 0!==t?t:-1,screenHeight:null!==(o=null===(n=null===e||void 0===e?void 0:e.screen)||void 0===n?void 0:n.height)&&void 0!==o?o:-1,outerWidth:null===e||void 0===e?void 0:e.outerWidth,outerHeight:null===e||void 0===e?void 0:e.outerHeight,width:(null===e||void 0===e?void 0:e.innerWidth)||(null===(s=null===(r=null===e||void 0===e?void 0:e.document)||void 0===r?void 0:r.documentElement)||void 0===s?void 0:s.width),height:(null===e||void 0===e?void 0:e.innerHeight)||(null===(a=null===(u=null===e||void 0===e?void 0:e.document)||void 0===u?void 0:u.documentElement)||void 0===a?void 0:a.height)}},i.prototype.devicePixelRatio=function(){var i;return null!==(i=null===e||void 0===e?void 0:e.devicePixelRatio)&&void 0!==i?i:1},i.prototype.fingerprint=function(){return new t(void 0).get()},i.prototype.osName=function(){return this.isAndroid()?"Android":this.isiOS()?"iOS":this.isMac()?"MacOS":this.isWindows()?"Windows":this.isLinux()?"Linux":""},i.prototype.osVersion=function(){if(this.isAndroid())return this.v(/Android\s(\d+\.\d+)/i);if(this.isiOS())return this.v(/iPhone\sOS\s([\d_]+)|iPad.*OS\s([\d_]+)/i);if(this.isMac()){var i=this.v(/Mac\sOS\sX\s((\d+_\d+_\d+)|(\d+\.\d+))/i);return i&&i.replace(/_/g,".")}return this.isWindows()?this.v(/windows\snt\s([\d\.]+)/i):(this.isLinux(),"")},i.prototype.browserName=function(){return this.isChrome()?"Chrome":this.isFirefox()?"Firefox":this.isSafari()?"Safari":this.isIE()?"IE":this.isQQBrowser()?"QQBrowser":"unknown"},i.prototype.browserVersion=function(){return this.isChrome()?this.v(/chrome\/(\d+\.\d+\.\d+\.\d+)/i):this.isFirefox()?this.v(/firefox\/(\d+\.\d+)/i):this.isSafari()?this.v(/Safari\/([\d\.]+)/i):this.isIE()?this.v(/MSIE ([0-9]{1,}[\.0-9]{0,})/i):this.isQQBrowser()?this.v(/\ MQQBrowser\/([^\s]+)/i):"unknown"},i.prototype.is=function(i){return i.test(this.ua)},i.prototype.v=function(i){var t,e;return null!==(e=null===(t=i.exec(this.ua))||void 0===t?void 0:t[1])&&void 0!==e?e:""},i}();i.default=n,i.Device=n,Object.defineProperty(i,"__esModule",{value:!0})}); | ||
!function(i,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((i["lib/index"]=i["lib/index"]||{},i["lib/index"].umd=i["lib/index"].umd||{},i["lib/index"].umd.js={}))}(this,function(i){"use strict";function t(i,t,e,n){return new(e||(e=Promise))(function(o,r){function s(i){try{a(n.next(i))}catch(i){r(i)}}function u(i){try{a(n.throw(i))}catch(i){r(i)}}function a(i){i.done?o(i.value):new e(function(t){t(i.value)}).then(s,u)}a((n=n.apply(i,t)).next())})}function e(i){var t,e;t=Array.prototype.forEach,e=Array.prototype.map,this.each=function(i,e,n){if(null!==i)if(t&&i.forEach===t)i.forEach(e,n);else if(i.length===+i.length){for(var o=0,r=i.length;o<r;o++)if(e.call(n,i[o],o,i)==={})return}else for(var s in i)if(i.hasOwnProperty(s)&&e.call(n,i[s],s,i)==={})return},this.map=function(i,t,n){var o=[];return null==i?o:e&&i.map===e?i.map(t,n):(this.each(i,function(i,e,r){o[o.length]=t.call(n,i,e,r)}),o)},"object"==typeof i?(this.hasher=i.hasher,this.screen_resolution=i.screen_resolution,this.screen_orientation=i.screen_orientation,this.canvas=i.canvas,this.ie_activex=i.ie_activex):"function"==typeof i&&(this.hasher=i)}e.prototype={get:function(){var i=[];if(i.push(navigator.userAgent),i.push(navigator.language),i.push(screen.colorDepth),this.screen_resolution){var t=this.getScreenResolution();void 0!==t&&i.push(t.join("x"))}return i.push((new Date).getTimezoneOffset()),i.push(this.hasSessionStorage()),i.push(this.hasLocalStorage()),i.push(this.hasIndexDb()),document.body?i.push(typeof document.body.addBehavior):i.push("undefined"),i.push(typeof window.openDatabase),i.push(navigator.cpuClass),i.push(navigator.platform),i.push(navigator.doNotTrack),i.push(this.getPluginsString()),this.canvas&&this.isCanvasSupported()&&i.push(this.getCanvasFingerprint()),this.hasher?this.hasher(i.join("###"),31):this.murmurhash3_32_gc(i.join("###"),31)},murmurhash3_32_gc:function(i,t){var e,n,o,r,s,u,a,h;for(e=3&i.length,n=i.length-e,o=t,s=3432918353,u=461845907,h=0;h<n;)a=255&i.charCodeAt(h)|(255&i.charCodeAt(++h))<<8|(255&i.charCodeAt(++h))<<16|(255&i.charCodeAt(++h))<<24,++h,o=27492+(65535&(r=5*(65535&(o=(o^=a=(65535&(a=(a=(65535&a)*s+(((a>>>16)*s&65535)<<16)&4294967295)<<15|a>>>17))*u+(((a>>>16)*u&65535)<<16)&4294967295)<<13|o>>>19))+((5*(o>>>16)&65535)<<16)&4294967295))+((58964+(r>>>16)&65535)<<16);switch(a=0,e){case 3:a^=(255&i.charCodeAt(h+2))<<16;case 2:a^=(255&i.charCodeAt(h+1))<<8;case 1:o^=a=(65535&(a=(a=(65535&(a^=255&i.charCodeAt(h)))*s+(((a>>>16)*s&65535)<<16)&4294967295)<<15|a>>>17))*u+(((a>>>16)*u&65535)<<16)&4294967295}return o^=i.length,o=2246822507*(65535&(o^=o>>>16))+((2246822507*(o>>>16)&65535)<<16)&4294967295,o=3266489909*(65535&(o^=o>>>13))+((3266489909*(o>>>16)&65535)<<16)&4294967295,(o^=o>>>16)>>>0},hasLocalStorage:function(){try{return!!window.localStorage}catch(i){return!0}},hasSessionStorage:function(){try{return!!window.sessionStorage}catch(i){return!0}},hasIndexDb:function(){try{return!!window.indexedDB}catch(i){return!0}},isCanvasSupported:function(){var i=document.createElement("canvas");return!(!i.getContext||!i.getContext("2d"))},isIE:function(){return"Microsoft Internet Explorer"===navigator.appName||!("Netscape"!==navigator.appName||!/Trident/.test(navigator.userAgent))},getPluginsString:function(){return this.isIE()&&this.ie_activex?this.getIEPluginsString():this.getRegularPluginsString()},getRegularPluginsString:function(){return this.map(navigator.plugins,function(i){var t=this.map(i,function(i){return[i.type,i.suffixes].join("~")}).join(",");return[i.name,i.description,t].join("::")},this).join(";")},getIEPluginsString:function(){if(window.ActiveXObject){var i=["ShockwaveFlash.ShockwaveFlash","AcroPDF.PDF","PDF.PdfCtrl","QuickTime.QuickTime","rmocx.RealPlayer G2 Control","rmocx.RealPlayer G2 Control.1","RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)","RealVideo.RealVideo(tm) ActiveX Control (32-bit)","RealPlayer","SWCtl.SWCtl","WMPlayer.OCX","AgControl.AgControl","Skype.Detection"];return this.map(i,function(i){try{return new window.ActiveXObject(i),i}catch(i){return null}}).join(";")}return""},getScreenResolution:function(){return this.screen_orientation?screen.height>screen.width?[screen.height,screen.width]:[screen.width,screen.height]:[screen.height,screen.width]},getCanvasFingerprint:function(){var i=document.createElement("canvas"),t=i.getContext("2d"),e="http://valve.github.io";return t.textBaseline="top",t.font="14px 'Arial'",t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(125,1,62,20),t.fillStyle="#069",t.fillText(e,2,15),t.fillStyle="rgba(102, 204, 0, 0.7)",t.fillText(e,4,17),i.toDataURL()}};var n=require("global"),o=function(){function i(i){void 0===i&&(i=null===(t=null===n||void 0===n?void 0:n.navigator)||void 0===t?void 0:t.userAgent);var t;this.ua=i}return i.prototype.userAgent=function(){return this.ua},i.prototype.os=function(){return{name:this.osName(),version:this.osVersion()}},i.prototype.browser=function(){return{name:this.browserName(),version:this.browserVersion()}},i.prototype.platform=function(){var i;return null===(i=null===n||void 0===n?void 0:n.navigator)||void 0===i?void 0:i.platform},i.prototype.isWindows=function(){return this.is(/windows/i)},i.prototype.isMac=function(){return this.is(/macintosh/i)},i.prototype.isLinux=function(){return this.is(/linux/i)},i.prototype.isAndroid=function(){return this.is(/Android/i)},i.prototype.isiOS=function(){return this.is(/iPhone|iPad|iPod/i)},i.prototype.isChrome=function(){return this.is(/chrome/i)},i.prototype.isFirefox=function(){return this.is(/firefox/i)},i.prototype.isSafari=function(){return this.is(/Safari\/([\d\.]+)/i)},i.prototype.isIE=function(){return this.is(/msie (\d+\.\d+)/i)},i.prototype.isQQBrowser=function(){return this.is(/MQQBrowser/i)},i.prototype.isWeixin=function(){return this.is(/MicroMessenger/i)},i.prototype.isQQ=function(){return this.is(/\ QQ\//i)},i.prototype.isWeibo=function(){return this.is(/Weibo/i)},i.prototype.isWebview=function(){return!this.isiOS()&&!!this.is(/.*AppleWebKit(?!.*Safari)/i)},i.prototype.isMobile=function(){return this.is(/mobile/i)},i.prototype.isiPhone=function(){return this.is(/iPhone/i)},i.prototype.isOnline=function(){var i;return!!(null===(i=null===n||void 0===n?void 0:n.navigator)||void 0===i?void 0:i.onLine)},i.prototype.language=function(){var i;return null===(i=null===n||void 0===n?void 0:n.navigator)||void 0===i?void 0:i.language},i.prototype.getGeolocation=function(){return t(this,void 0,Promise,function(){return __generator(this,function(i){return[2,new Promise(function(i,t){n.navigator.geolocation.getCurrentPosition(i,t)})]})})},i.prototype.getConnection=function(){var i;return t(this,void 0,Promise,function(){return __generator(this,function(t){return[2,(null===(i=n.navigator)||void 0===i?void 0:i.connection)||{}]})})},i.prototype.getBattery=function(){var i,e;return t(this,void 0,Promise,function(){return __generator(this,function(t){return[2,null===(e=null===(i=n.navigator)||void 0===i?void 0:i.getBattery)||void 0===e?void 0:e.call(i)]})})},i.prototype.getClipboard=function(){var i;return t(this,void 0,Promise,function(){return __generator(this,function(t){return[2,null===(i=n.navigator)||void 0===i?void 0:i.clipboard]})})},i.prototype.getUserMedia=function(i){return void 0===i&&(i={audio:!0,video:!0}),t(this,void 0,Promise,function(){return __generator(this,function(t){return[2,navigator.mediaDevices.getUserMedia(i)]})})},i.prototype.windowSize=function(){var i,t,e,o,r,s,u,a;return{screenWidth:null!==(t=null===(i=null===n||void 0===n?void 0:n.screen)||void 0===i?void 0:i.width)&&void 0!==t?t:-1,screenHeight:null!==(o=null===(e=null===n||void 0===n?void 0:n.screen)||void 0===e?void 0:e.height)&&void 0!==o?o:-1,outerWidth:null===n||void 0===n?void 0:n.outerWidth,outerHeight:null===n||void 0===n?void 0:n.outerHeight,width:(null===n||void 0===n?void 0:n.innerWidth)||(null===(s=null===(r=null===n||void 0===n?void 0:n.document)||void 0===r?void 0:r.documentElement)||void 0===s?void 0:s.width),height:(null===n||void 0===n?void 0:n.innerHeight)||(null===(a=null===(u=null===n||void 0===n?void 0:n.document)||void 0===u?void 0:u.documentElement)||void 0===a?void 0:a.height)}},i.prototype.devicePixelRatio=function(){var i;return null!==(i=null===n||void 0===n?void 0:n.devicePixelRatio)&&void 0!==i?i:1},i.prototype.fingerprint=function(){return new e(void 0).get()},i.prototype.osName=function(){return this.isAndroid()?"Android":this.isiOS()?"iOS":this.isMac()?"MacOS":this.isWindows()?"Windows":this.isLinux()?"Linux":""},i.prototype.osVersion=function(){if(this.isAndroid())return this.v(/Android\s(\d+\.\d+)/i);if(this.isiOS())return this.v(/iPhone\sOS\s([\d_]+)|iPad.*OS\s([\d_]+)/i);if(this.isMac()){var i=this.v(/Mac\sOS\sX\s((\d+_\d+_\d+)|(\d+\.\d+))/i);return i&&i.replace(/_/g,".")}return this.isWindows()?this.v(/windows\snt\s([\d\.]+)/i):(this.isLinux(),"")},i.prototype.browserName=function(){return this.isChrome()?"Chrome":this.isFirefox()?"Firefox":this.isSafari()?"Safari":this.isIE()?"IE":this.isQQBrowser()?"QQBrowser":"unknown"},i.prototype.browserVersion=function(){return this.isChrome()?this.v(/chrome\/(\d+\.\d+\.\d+\.\d+)/i):this.isFirefox()?this.v(/firefox\/(\d+\.\d+)/i):this.isSafari()?this.v(/Safari\/([\d\.]+)/i):this.isIE()?this.v(/MSIE ([0-9]{1,}[\.0-9]{0,})/i):this.isQQBrowser()?this.v(/\ MQQBrowser\/([^\s]+)/i):"unknown"},i.prototype.is=function(i){return i.test(this.ua)},i.prototype.v=function(i){var t,e;return null!==(e=null===(t=i.exec(this.ua))||void 0===t?void 0:t[1])&&void 0!==e?e:""},i}();i.default=o,i.Device=o,Object.defineProperty(i,"__esModule",{value:!0})}); |
{ | ||
"name": "@zcorky/device", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
44546
755