Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bowser-castle

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bowser-castle - npm Package Compare versions

Comparing version 0.2.3 to 0.2.4

7

dist/bowserCastle.d.ts

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc