febs-browser
Advanced tools
Comparing version 1.2.3 to 1.2.5
@@ -45,3 +45,3 @@ 'use strict'; | ||
{ | ||
if (v.length > 22 || v.length < 1) | ||
if (v.length > 100 || v.length < 1) | ||
return false; | ||
@@ -48,0 +48,0 @@ |
@@ -140,4 +140,48 @@ 'use strict'; | ||
/** | ||
* @desc: the browser is safari. | ||
* @param userAgent: the browser user agent string. | ||
*/ | ||
exports.browserIsSafari = function(userAgent) { | ||
if (!userAgent) { | ||
if (typeof Window !== undefined) { | ||
userAgent = Window.navigator.userAgent | ||
} | ||
} | ||
var agent = userAgent.toLowerCase(); | ||
return agent.match(/version\/([\d.]+).*safari/); | ||
} | ||
/** | ||
* @desc: the browser is opera. | ||
* @param userAgent: the browser user agent string. | ||
*/ | ||
exports.browserIsOpera = function(userAgent) { | ||
if (!userAgent) { | ||
if (typeof Window !== undefined) { | ||
userAgent = Window.navigator.userAgent | ||
} | ||
} | ||
var agent = userAgent.toLowerCase(); | ||
return agent.match(/opera.([\d.]+)/); | ||
} | ||
/** | ||
* @desc: the browser is firefox. | ||
* @param userAgent: the browser user agent string. | ||
*/ | ||
exports.browserIsFirefox = function(userAgent) { | ||
if (!userAgent) { | ||
if (typeof Window !== undefined) { | ||
userAgent = Window.navigator.userAgent | ||
} | ||
} | ||
var agent = userAgent.toLowerCase(); | ||
return agent.match(/firefox\/([\d.]+)/); | ||
} | ||
/** | ||
* @desc: the browser is weixin. | ||
@@ -144,0 +188,0 @@ */ |
@@ -129,4 +129,22 @@ 'use strict'; | ||
/** | ||
* @desc: the browser is safari. | ||
* @param userAgent: the browser user agent string. | ||
*/ | ||
exports.browserIsSafari = utilsBrowser.browserIsSafari; | ||
/** | ||
* @desc: the browser is opera. | ||
* @param userAgent: the browser user agent string. | ||
*/ | ||
exports.browserIsOpera = utilsBrowser.browserIsOpera; | ||
/** | ||
* @desc: the browser is firefox. | ||
* @param userAgent: the browser user agent string. | ||
*/ | ||
exports.browserIsFirefox = utilsBrowser.browserIsFirefox; | ||
/** | ||
* @desc: the browser is weixin. | ||
@@ -133,0 +151,0 @@ */ |
{ | ||
"description": "febs is a useful utilities set in browser", | ||
"dependencies": {}, | ||
"devDependencies": { | ||
@@ -42,3 +41,3 @@ "@babel/cli": "^7.8.4", | ||
"webpack": "^2.6.1", | ||
"webpack-bundle-analyzer": "^2.11.1" | ||
"webpack-bundle-analyzer": ">=3.3.2" | ||
}, | ||
@@ -97,3 +96,3 @@ "directories": {}, | ||
"name": "febs-browser", | ||
"version": "1.2.3" | ||
"version": "1.2.5" | ||
} |
@@ -600,2 +600,5 @@ | ||
function browserIEVer(): boolean; | ||
function browserIsSafari(): boolean; | ||
function browserIsOpera(): boolean; | ||
function browserIsFirefox(): boolean; | ||
@@ -1064,3 +1067,3 @@ /** | ||
*/ | ||
css(name: string, value: string): string; | ||
css(name: string, value?: string): string; | ||
@@ -1067,0 +1070,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 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 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 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 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 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
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
7188862
66612