@cainiaofe/cn-utils
Advanced tools
Comparing version 0.1.5 to 0.1.9
@@ -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, | ||
}; | ||
}; |
"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; |
{ | ||
"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
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
971101
5513
0