browserslist 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,6 @@
1
+ ## 0.5
2
+ * Add version ranges `IE 6-9` (by Ben Briggs).
3
+
1
4
  ## 0.4
2
5
  * Add `config` option and `BROWSERSLIST_CONFIG` environment variable support.
3
6
  * Add symlink config support.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Browserslist [![Build Status](https://travis-ci.org/ai/browserslist.svg)](https://travis-ci.org/ai/browserslist)
1
+ # Browserslist [![Build Status][ci-img]][ci]
2
2
 
3
3
  Get browser versions that match given criteria.
4
4
  Useful for tools like [Autoprefixer].
@@ -11,8 +11,8 @@ with a usage of over 5% in global usage statistics:
11
11
 
12
12
  ```js
13
13
  browserslist('last 1 version, > 5%');
14
- //=> ['and_chr 41', 'chrome 41', 'chrome 40', 'firefox 37', 'firefox 36',
15
- // 'ie 11', 'ie_mob 11', 'ios_saf 8.1-8.3', 'opera 27', 'safari 8']
14
+ //=> ['and_chr 42', 'and_uc 9.9', 'chrome 43', 'chrome 42', 'firefox 38',
15
+ // 'ie 11', 'ie_mob 11', 'ios_saf 8.1-8.3', 'opera 30', 'safari 8']
16
16
  ```
17
17
 
18
18
  Browserslist will use browsers criterias from:
@@ -28,6 +28,8 @@ Browserslist will use browsers criterias from:
28
28
  </a>
29
29
 
30
30
  [Autoprefixer]: https://github.com/postcss/autoprefixer
31
+ [ci-img]: https://travis-ci.org/ai/browserslist.svg
32
+ [ci]: https://travis-ci.org/ai/browserslist
31
33
 
32
34
  ## Queries
33
35
 
@@ -37,6 +39,7 @@ You can specify the versions by queries (case insensitive):
37
39
  * `last 2 Chrome versions`: the last 2 versions of Chrome browser.
38
40
  * `> 5%`: versions selected by global usage statistics.
39
41
  * `> 5% in US`: uses USA usage statistics. It accepts [two-letter country code].
42
+ * `ie 6-8`: selects an inclusive range of versions.
40
43
  * `Firefox > 20`: versions of Firefox newer than 20.
41
44
  * `Firefox >= 20`: versions of Firefox newer than or equal to 20.
42
45
  * `Firefox < 20`: versions of Firefox less than 20.
@@ -48,7 +51,8 @@ Blackberry and Android WebView will not be used in `last n versions`.
48
51
  You should add them by name.
49
52
 
50
53
  Browserslist works with separated versions of browsers. To use all versions
51
- of some browsers you can use `Firefox > 0`, but it is a very bad way.
54
+ of some browsers you can use for example `Firefox > 0`,
55
+ but it is bad practice.
52
56
 
53
57
  [two-letter country code]: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements
54
58
 
package/index.js CHANGED
@@ -262,6 +262,24 @@ browserslist.queries = {
262
262
  }
263
263
  },
264
264
 
265
+ range: {
266
+ regexp: /^(\w+) ([\d\.]+)-([\d\.]+)/i,
267
+ select: function (name, from, to) {
268
+ var data = browserslist.checkName(name);
269
+ from = parseFloat(normalizeVersion(data, from) || from);
270
+ to = parseFloat(normalizeVersion(data, to) || to);
271
+
272
+ var filter = function (v) {
273
+ var parsed = parseFloat(v);
274
+ return parsed >= from && parsed <= to;
275
+ };
276
+
277
+ return data.released.filter(filter).map(function (v) {
278
+ return data.name + ' ' + v;
279
+ });
280
+ }
281
+ },
282
+
265
283
  versions: {
266
284
  regexp: /^(\w+) (>=?|<=?)\s*([\d\.]+)/,
267
285
  select: function (name, sign, version) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browserslist",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Get browsers versions that matches given criterias like in Autoprefixer",
5
5
  "keywords": ["caniuse", "browsers"],
6
6
  "author": "Andrey Sitnik <andrey@sitnik.ru>",
@@ -10,14 +10,14 @@
10
10
  "url": "https://github.com/ai/browserslist.git"
11
11
  },
12
12
  "dependencies": {
13
- "caniuse-db": "^1.0.30000153"
13
+ "caniuse-db": "^1.0.30000214"
14
14
  },
15
15
  "devDependencies": {
16
- "gulp-eslint": "0.11.1",
17
- "gulp-mocha": "2.0.1",
18
- "mocha": "2.2.4",
19
- "chai": "2.3.0",
20
- "gulp": "3.8.11"
16
+ "gulp-eslint": "0.14.0",
17
+ "gulp-mocha": "2.1.2",
18
+ "mocha": "2.2.5",
19
+ "chai": "3.0.0",
20
+ "gulp": "3.9.0"
21
21
  },
22
22
  "scripts": {
23
23
  "test": "gulp"