bowser-castle
Advanced tools
Comparing version 0.2.3 to 0.2.4
@@ -1,5 +0,8 @@ | ||
import * as Bowser from "bowser"; | ||
export interface IBowserCastle extends Bowser.Parser.Details { | ||
export interface IBowserCastle { | ||
mobile: boolean; | ||
tablet: boolean; | ||
name: string; | ||
version: string; | ||
} | ||
declare const bowserCastle: IBowserCastle; | ||
export default bowserCastle; |
@@ -1,20 +0,13 @@ | ||
import * as Bowser from "bowser"; | ||
import Bowser from "bowser"; | ||
const detect = (userAgent) => { | ||
const browserInfo = Bowser.getParser(userAgent !== null && userAgent !== void 0 ? userAgent : ''); | ||
const bowserCastle = Object.assign(Object.assign({}, browserInfo), { mobile: browserInfo.getPlatformType(true) === "mobile", tablet: browserInfo.getPlatformType(true) === "tablet" }); | ||
return bowserCastle; | ||
return { | ||
mobile: browserInfo.getPlatformType(true) === "mobile", | ||
tablet: browserInfo.getPlatformType(true) === "tablet", | ||
name: browserInfo.getBrowserName(), | ||
version: browserInfo.getBrowserVersion(), | ||
}; | ||
}; | ||
(function (root, name, definition) { | ||
if (typeof module !== 'undefined' && module.exports) { | ||
module.exports = definition(); | ||
} | ||
else if (typeof define === 'function' && define.amd) { | ||
define(name, definition); | ||
} | ||
else { | ||
root[name] = definition(); | ||
} | ||
})(this, 'bowserCastle', () => { | ||
return detect(typeof navigator !== 'undefined' ? navigator.userAgent : ''); | ||
}); | ||
const bowserCastle = detect(typeof navigator !== 'undefined' ? navigator.userAgent : ''); | ||
export default bowserCastle; | ||
//# sourceMappingURL=bowserCastle.js.map |
{ | ||
"name": "bowser-castle", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/bowserCastle.js", |
@@ -1,28 +0,22 @@ | ||
import * as Bowser from "bowser"; | ||
import Bowser from "bowser"; | ||
export interface IBowserCastle extends Bowser.Parser.Details { | ||
export interface IBowserCastle { | ||
mobile: boolean; | ||
tablet: boolean; | ||
name: string; | ||
version: string; | ||
} | ||
const detect = (userAgent: string): Bowser.Parser.Details & { mobile: boolean; tablet: boolean; } => { | ||
const detect = (userAgent: string): IBowserCastle => { | ||
const browserInfo = Bowser.getParser(userAgent ?? ''); | ||
const bowserCastle = { | ||
...browserInfo, | ||
return { | ||
mobile: browserInfo.getPlatformType(true) === "mobile", | ||
tablet: browserInfo.getPlatformType(true) === "tablet", | ||
name: browserInfo.getBrowserName(), | ||
version: browserInfo.getBrowserVersion(), | ||
}; | ||
return bowserCastle as Bowser.Parser.Details & { mobile: boolean; tablet: boolean; }; | ||
} | ||
(function(root: any, name: string, definition: () => Bowser.Parser.Details & { mobile: boolean; tablet: boolean; }) { | ||
if (typeof module !== 'undefined' && module.exports) { | ||
module.exports = definition(); | ||
} else if (typeof define === 'function' && define.amd) { | ||
define(name, definition); | ||
} else { | ||
root[name] = definition(); | ||
} | ||
})(this, 'bowserCastle', () => { | ||
return detect(typeof navigator !== 'undefined' ? navigator.userAgent : '') as Bowser.Parser.Details & { mobile: boolean; tablet: boolean; }; | ||
}); | ||
const bowserCastle: IBowserCastle = detect(typeof navigator !== 'undefined' ? navigator.userAgent : ''); | ||
export default bowserCastle; |
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
4730
67