@operato/utils
Advanced tools
Comparing version 0.3.9 to 0.3.13
@@ -6,2 +6,35 @@ # Change Log | ||
### [0.3.13](https://github.com/hatiolab/operato/compare/v0.3.12...v0.3.13) (2022-01-15) | ||
**Note:** Version bump only for package @operato/utils | ||
### [0.3.12](https://github.com/hatiolab/operato/compare/v0.3.11...v0.3.12) (2022-01-15) | ||
**Note:** Version bump only for package @operato/utils | ||
### [0.3.11](https://github.com/hatiolab/operato/compare/v0.3.10...v0.3.11) (2022-01-15) | ||
**Note:** Version bump only for package @operato/utils | ||
### [0.3.10](https://github.com/hatiolab/operato/compare/v0.3.9...v0.3.10) (2022-01-15) | ||
### :bug: Bug Fix | ||
* data-grist record-view ([aa71ec5](https://github.com/hatiolab/operato/commit/aa71ec5600f4dbccd05fcbc249445c73a41d2168)) | ||
### [0.3.9](https://github.com/hatiolab/operato/compare/v0.3.8...v0.3.9) (2022-01-15) | ||
@@ -8,0 +41,0 @@ |
@@ -7,1 +7,3 @@ export * from './sleep.js'; | ||
export * from './fullscreen.js'; | ||
export * from './parse-jwt.js'; | ||
export * from './password-pattern.js'; |
@@ -7,2 +7,4 @@ export * from './sleep.js'; | ||
export * from './fullscreen.js'; | ||
export * from './parse-jwt.js'; | ||
export * from './password-pattern.js'; | ||
//# sourceMappingURL=index.js.map |
/** | ||
* method to get operating system of running browser | ||
* @returns {string} name of OS : 'Windows | 'Mac' | 'Android' | 'iOS' | ||
*/ | ||
export declare function getOS(): string; | ||
/** | ||
* method to tell if platform of running browser is kind of mobile device | ||
@@ -8,0 +3,0 @@ * @returns {boolean} |
@@ -1,21 +0,2 @@ | ||
var os = 'Unknown OS'; | ||
if (navigator.userAgent.indexOf('Win') != -1) | ||
os = 'Windows'; | ||
else if (navigator.userAgent.indexOf('Mac') != -1) | ||
os = 'Mac'; | ||
else if (navigator.userAgent.indexOf('Linux') != -1) | ||
os = 'Linux'; | ||
else if (navigator.userAgent.indexOf('Android') != -1) | ||
os = 'Android'; | ||
else if (navigator.userAgent.indexOf('like Mac') != -1) | ||
os = 'iOS'; | ||
var mobile = os === 'iOS' || os === 'Android'; | ||
/** | ||
* method to get operating system of running browser | ||
* @returns {string} name of OS : 'Windows | 'Mac' | 'Android' | 'iOS' | ||
*/ | ||
export function getOS() { | ||
return os; | ||
} | ||
/** | ||
* method to tell if platform of running browser is kind of mobile device | ||
@@ -25,3 +6,3 @@ * @returns {boolean} | ||
export function isMobileDevice() { | ||
return mobile; | ||
return window.matchMedia('(max-width: 767px)').matches; | ||
} | ||
@@ -33,3 +14,4 @@ /** | ||
export function isIOS() { | ||
return os === 'iOS'; | ||
//@ts-ignore | ||
return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream; | ||
} | ||
@@ -41,3 +23,3 @@ /** | ||
export function isMacOS() { | ||
return os === 'Mac'; | ||
return navigator.userAgent.indexOf('Mac') != -1; | ||
} | ||
@@ -44,0 +26,0 @@ export function isSafari() { |
@@ -6,3 +6,3 @@ { | ||
"author": "heartyoh", | ||
"version": "0.3.9", | ||
"version": "0.3.13", | ||
"main": "dist/src/index.js", | ||
@@ -76,3 +76,3 @@ "module": "dist/src/index.js", | ||
}, | ||
"gitHead": "d63971adcea045ccd788ff4ae5b9e2ca561bb754" | ||
"gitHead": "1c655a621af7ea9981bd2b9c9d1bbabe71305e63" | ||
} |
@@ -7,1 +7,3 @@ export * from './sleep.js' | ||
export * from './fullscreen.js' | ||
export * from './parse-jwt.js' | ||
export * from './password-pattern.js' |
@@ -1,20 +0,2 @@ | ||
var os = 'Unknown OS' | ||
if (navigator.userAgent.indexOf('Win') != -1) os = 'Windows' | ||
else if (navigator.userAgent.indexOf('Mac') != -1) os = 'Mac' | ||
else if (navigator.userAgent.indexOf('Linux') != -1) os = 'Linux' | ||
else if (navigator.userAgent.indexOf('Android') != -1) os = 'Android' | ||
else if (navigator.userAgent.indexOf('like Mac') != -1) os = 'iOS' | ||
var mobile = os === 'iOS' || os === 'Android' | ||
/** | ||
* method to get operating system of running browser | ||
* @returns {string} name of OS : 'Windows | 'Mac' | 'Android' | 'iOS' | ||
*/ | ||
export function getOS() { | ||
return os | ||
} | ||
/** | ||
* method to tell if platform of running browser is kind of mobile device | ||
@@ -24,3 +6,3 @@ * @returns {boolean} | ||
export function isMobileDevice() { | ||
return mobile | ||
return window.matchMedia('(max-width: 767px)').matches | ||
} | ||
@@ -33,3 +15,4 @@ | ||
export function isIOS() { | ||
return os === 'iOS' | ||
//@ts-ignore | ||
return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream | ||
} | ||
@@ -42,3 +25,3 @@ | ||
export function isMacOS() { | ||
return os === 'Mac' | ||
return navigator.userAgent.indexOf('Mac') != -1 | ||
} | ||
@@ -45,0 +28,0 @@ |
Sorry, the diff of this file is not supported yet
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
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
105818
52
1226
0