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

@cainiaofe/cn-utils

Package Overview
Dependencies
Maintainers
21
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cainiaofe/cn-utils - npm Package Compare versions

Comparing version 0.1.5 to 0.1.9

8

es/utils/browser/index.d.ts

@@ -6,1 +6,9 @@ export declare const ua: string;

export declare const getBrowserVersion: () => "";
/**
* 获取客户端/浏览器信息
*/
export declare const getClientInfo: () => {
isMobile: boolean;
isPC: boolean;
userAgent: string;
};

@@ -10,1 +10,14 @@ var _a, _b, _c, _d;

export var getBrowserVersion = browser.getBrowserVersion.bind(browser);
/**
* 获取客户端/浏览器信息
*/
export var getClientInfo = function () {
var _a, _b;
var userAgent = ((_a = window.navigator) === null || _a === void 0 ? void 0 : _a.userAgent) || '';
var isMobile = ((_b = window._GATEWAY_UA) === null || _b === void 0 ? void 0 : _b.loadMobile) || userAgent.toLocaleLowerCase().indexOf('mobile') > -1;
return {
isMobile: isMobile,
isPC: !isMobile,
userAgent: userAgent,
};
};

16

lib/utils/browser/index.js
"use strict";
var _a, _b, _c, _d;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getBrowserVersion = exports.getBrowserName = exports.isPC = exports.isMobile = exports.ua = void 0;
exports.getClientInfo = exports.getBrowserVersion = exports.getBrowserName = exports.isPC = exports.isMobile = exports.ua = void 0;
var parser_1 = require("./parser");

@@ -13,1 +13,15 @@ exports.ua = window.navigator.userAgent;

exports.getBrowserVersion = browser.getBrowserVersion.bind(browser);
/**
* 获取客户端/浏览器信息
*/
var getClientInfo = function () {
var _a, _b;
var userAgent = ((_a = window.navigator) === null || _a === void 0 ? void 0 : _a.userAgent) || '';
var isMobile = ((_b = window._GATEWAY_UA) === null || _b === void 0 ? void 0 : _b.loadMobile) || userAgent.toLocaleLowerCase().indexOf('mobile') > -1;
return {
isMobile: isMobile,
isPC: !isMobile,
userAgent: userAgent,
};
};
exports.getClientInfo = getClientInfo;

4

package.json
{
"name": "@cainiaofe/cn-utils",
"version": "0.1.5",
"version": "0.1.9",
"description": "菜鸟前端基础工具库",

@@ -25,3 +25,3 @@ "main": "lib/index.js",

"pub:beta": "npm publish --tag beta --registry=https://registry.npmjs.org --access=public && tnpm sync @cainiaofe/cn-utils",
"pub:docs": "npm run build-storybook && cone cdn upload docs.tgz --namespace cn-utils -d docs",
"pub:docs": "npm run build-storybook && cone cdn upload docs.tgz --namespace cn-utils -d docs --env prod",
"build-storybook": "storybook build --docs -o docs"

@@ -28,0 +28,0 @@ },

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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