bowser-castle
Advanced tools
Comparing version 0.2.8 to 0.3.0
@@ -7,3 +7,2 @@ export interface IBowserCastle { | ||
} | ||
declare const bowserCastle: IBowserCastle; | ||
export default bowserCastle; | ||
export declare const bowserCastle: (userAgent?: string) => IBowserCastle; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const Bowser = require("bowser"); | ||
const detect = (userAgent) => { | ||
const browserInfo = Bowser.getParser(userAgent !== null && userAgent !== void 0 ? userAgent : ''); | ||
exports.bowserCastle = void 0; | ||
const bowser = require("bowser"); | ||
const bowserCastle = (userAgent) => { | ||
if (!userAgent && typeof navigator !== "undefined") { | ||
userAgent = navigator.userAgent; | ||
} | ||
const browserInfo = bowser.getParser(userAgent !== null && userAgent !== void 0 ? userAgent : ''); | ||
return { | ||
@@ -13,4 +17,3 @@ mobile: browserInfo.getPlatformType(true) === "mobile", | ||
}; | ||
const bowserCastle = detect(typeof navigator !== 'undefined' ? navigator.userAgent : ''); | ||
exports.default = bowserCastle; | ||
exports.bowserCastle = bowserCastle; | ||
//# sourceMappingURL=bowserCastle.js.map |
{ | ||
"name": "bowser-castle", | ||
"version": "0.2.8", | ||
"version": "0.3.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/bowserCastle.js", |
@@ -1,2 +0,2 @@ | ||
import * as Bowser from "bowser"; | ||
import * as bowser from "bowser"; | ||
@@ -10,4 +10,8 @@ export interface IBowserCastle { | ||
const detect = (userAgent: string): IBowserCastle => { | ||
const browserInfo = Bowser.getParser(userAgent ?? ''); | ||
export const bowserCastle = (userAgent?: string): IBowserCastle => { | ||
if (!userAgent && typeof navigator !== "undefined") { | ||
userAgent = navigator.userAgent; | ||
} | ||
const browserInfo = bowser.getParser(userAgent ?? ''); | ||
return { | ||
@@ -20,5 +24,1 @@ mobile: browserInfo.getPlatformType(true) === "mobile", | ||
} | ||
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
6054
102