Comparing version 0.2.1 to 0.3.0
{ | ||
"name": "date-fns", | ||
"version": "0.1.5", | ||
"name": "sniff-fns", | ||
"version": "0.3.0", | ||
"homepage": "https://github.com/js-fns/sniff-fns", | ||
@@ -5,0 +5,0 @@ "authors": [ |
{ | ||
"name": "sniff-fns", | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"author": "Ivan Shornikov <paraboom@gmail.com>", | ||
@@ -5,0 +5,0 @@ "description": "Browser agent sniffing functions", |
var sniffFns = require('../sniff_fns'); | ||
describe('bundle sniffFns', function(){ | ||
it('returns object with functions', function(){ | ||
var keys = ["isAndroid", "isMobileAndroid", "isBb10", "browser", "isIphone", "isIpad", "isMac", "isWindowsPhone", "isMobile"]; | ||
describe('bundle sniffFns', function () { | ||
it('returns object with functions', function () { | ||
var keys = [ | ||
"isAndroid", | ||
"isMobileAndroid", | ||
"isBb10", | ||
"browser", | ||
"isIphone", | ||
"isIpad", | ||
"isMac", | ||
"isWindows", | ||
"isWindowsPhone", | ||
"isMobile", | ||
"whichOs" | ||
]; | ||
@@ -7,0 +19,0 @@ expect(Object.keys(sniffFns)).is.eql(keys); |
@@ -1,11 +0,7 @@ | ||
var testString = require('./test_string') | ||
var testString = require('./test_string'); | ||
var isAndroid = function(str){ | ||
if (testString(str, 'android')) { | ||
return parseFloat(str.replace(/^.* android (\d+)\.(\d+).*$/, "$1.$2")) || true | ||
} else { | ||
return false | ||
} | ||
var isAndroid = function (str) { | ||
return testString(str, '; android'); | ||
}; | ||
module.exports = isAndroid; |
@@ -0,14 +1,20 @@ | ||
// Browsers | ||
var isChrome = require('./is_browser_chrome'); | ||
var isChromeMobile = require('./is_browser_chrome_mobile'); | ||
var isFF = require('./is_browser_firefox'); | ||
var isOpera = require('./is_browser_opera'); | ||
var isSafari = require('./is_browser_safari'); | ||
var whichBrowser = require('./which_browser'); | ||
// OSes | ||
var isAndroid = require('./is_android'); | ||
var isAndroidMobile = require('./is_android_mobile'); | ||
var isBB = require('./is_blackberry'); | ||
var isFF = require('./is_browser_firefox'); | ||
var isOpera = require('./is_browser_opera'); | ||
var isSafari = require('./is_browser_safari'); | ||
var isIphone = require('./is_iphone'); | ||
var isIpad = require('./is_ipad'); | ||
var isMac = require('./is_mac'); | ||
var isWindows = require('./is_windows'); | ||
var isWP = require('./is_windows_phone'); | ||
var isMobile = require('./is_mobile'); | ||
var whichOs = require('./which_os'); | ||
@@ -24,3 +30,4 @@ var sniffFns = { | ||
isOpera: isOpera, | ||
isSafari: isSafari | ||
isSafari: isSafari, | ||
whichBrowser: whichBrowser | ||
}, | ||
@@ -30,6 +37,8 @@ isIphone: isIphone, | ||
isMac: isMac, | ||
isWindows: isWindows, | ||
isWindowsPhone: isWP, | ||
isMobile: isMobile | ||
isMobile: isMobile, | ||
whichOs: whichOs | ||
} | ||
module.exports = sniffFns; |
49471
52
981