caniuse-support
Advanced tools
Comparing version 0.4.4 to 1.0.0
@@ -0,1 +1,5 @@ | ||
## 1.0.0 (March 21, 2019) | ||
- Deprecated `currentBrowser` | ||
## 0.4.4 (March 21, 2019) | ||
@@ -2,0 +6,0 @@ |
@@ -29,5 +29,2 @@ "use strict"; | ||
function detectBrowser(ua) { | ||
if (!ua) { | ||
return; | ||
} | ||
var bowserInst = Bowser.getParser(ua); | ||
@@ -61,4 +58,3 @@ var version = bowserInst.getBrowserVersion().toString(); | ||
exports.detectBrowser = detectBrowser; | ||
exports.currentBrowser = detectBrowser(); | ||
//# sourceMappingURL=browser.js.map |
@@ -10,4 +10,2 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/* tslint:disable: no-var-requires */ | ||
var browser_1 = require("./browser"); | ||
var lite = require("caniuse-lite"); | ||
@@ -21,3 +19,2 @@ /** | ||
function getSupport(feature, browser) { | ||
if (browser === void 0) { browser = browser_1.currentBrowser; } | ||
var support = { level: "unknown", needPrefix: false, notes: [] }; | ||
@@ -24,0 +21,0 @@ var stats = lite.feature(require("caniuse-lite/data/features/" + feature + ".js")).stats[browser.id]; |
@@ -16,3 +16,2 @@ /** | ||
*/ | ||
export declare function detectBrowser(ua?: string): Browser; | ||
export declare const currentBrowser: Browser; | ||
export declare function detectBrowser(ua: string): Browser; |
@@ -27,5 +27,2 @@ /** | ||
export function detectBrowser(ua) { | ||
if (!ua) { | ||
return; | ||
} | ||
var bowserInst = Bowser.getParser(ua); | ||
@@ -58,4 +55,3 @@ var version = bowserInst.getBrowserVersion().toString(); | ||
} | ||
export var currentBrowser = detectBrowser(); | ||
//# sourceMappingURL=browser.js.map |
@@ -20,3 +20,3 @@ /** | ||
*/ | ||
export declare function getSupport(feature: string, browser?: Browser): Support; | ||
export declare function getSupport(feature: string, browser: Browser): Support; | ||
/** | ||
@@ -23,0 +23,0 @@ * Get matching browser version index of the caniuse db. |
@@ -8,4 +8,2 @@ /** | ||
*/ | ||
/* tslint:disable: no-var-requires */ | ||
import { currentBrowser } from "./browser"; | ||
import * as lite from "caniuse-lite"; | ||
@@ -19,3 +17,2 @@ /** | ||
export function getSupport(feature, browser) { | ||
if (browser === void 0) { browser = currentBrowser; } | ||
var support = { level: "unknown", needPrefix: false, notes: [] }; | ||
@@ -22,0 +19,0 @@ var stats = lite.feature(require("caniuse-lite/data/features/" + feature + ".js")).stats[browser.id]; |
{ | ||
"name": "caniuse-support", | ||
"version": "0.4.4", | ||
"version": "1.0.0", | ||
"description": "Query the caniuse offline database for feature support.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/wikiwi/caniuse-support", |
@@ -13,7 +13,4 @@ # caniuse-support | ||
```javascript | ||
import { getSupport, detectBrowser, currentBrowser } from "caniuse-support"; | ||
import { getSupport, detectBrowser } from "caniuse-support"; | ||
// Get feature support of current browser. | ||
getSupport("transforms2d"); // { level: "none", needPrefix: false, notes: [] } | ||
// Get feature support of specific browser. | ||
@@ -28,5 +25,2 @@ getSupport("flexbox", { id: "chrome", version: "6.0" }); // { level: "partial", needPrefix: true, notes: [1] } | ||
getVersionIndex(detectBrowser(userAgent)); // "26" | ||
// For convenience, get current browser. | ||
console.log(`${currentBrowser.id} ${currentBrowser.version}`); | ||
``` | ||
@@ -33,0 +27,0 @@ |
Sorry, the diff of this file is not supported yet
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 not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
2093588
6904
31