browserslist 4.3.2 → 4.3.6

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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,18 @@
1
1
  # Change Log
2
2
  This project adheres to [Semantic Versioning](http://semver.org/).
3
3
 
4
+ ## 4.3.6
5
+ * Fix version-less browser support in custom statistics (by Alex Walter).
6
+
7
+ ## 4.3.5
8
+ * Fix `not` query for wrong Can I Use data.
9
+
10
+ ## 4.3.4
11
+ * Allow to update `node-releases` without new Browserslist releases.
12
+
13
+ ## 4.3.3
14
+ * Fix Node.js 11 support.
15
+
4
16
  ## 4.3.2
5
17
  * Fix `Unknown version 11 of Node.js` error (by Dan Onoshko).
6
18
 
package/README.md CHANGED
@@ -111,9 +111,10 @@ from one of this sources:
111
111
  * If you want to change the default set of browsers we recommend to combine
112
112
  `last 1 version`, `not dead` with `> 0.2%` (or `> 1% in US`,
113
113
  `> 1% in my stats`). `last n versions` adds too many dead browsers
114
- and does not add popular old versions. `> 0.2%` make popular browsers
115
- even more popular, so we will have a monopoly and stagnation,
116
- as we had with Internet Explorer 6.
114
+ and does not add popular old versions. Choosing a percentage above `0.2%`
115
+ will in the long run make popular browsers even more popular. We might run
116
+ into a monopoly and stagnation situation, as we had with Internet Explorer 6.
117
+ Please use this setting with caution.
117
118
  * Don’t remove browsers just because you don’t know them. Opera Mini has
118
119
  100 million users in Africa and it is more popular in the global market
119
120
  than Microsoft Edge. Chinese QQ Browsers has more market share than Firefox
package/index.js CHANGED
@@ -154,11 +154,30 @@ function resolve (queries, context) {
154
154
  var args = [context].concat(match.slice(1))
155
155
  var array = type.select.apply(browserslist, args)
156
156
  if (isExclude) {
157
- array = array.concat(array.map(function (j) {
158
- return j.replace(/\s\S+/, ' 0')
159
- }))
157
+ var filter = { }
158
+ var browsers = { }
159
+ var versionLess = { }
160
+ array.forEach(function (j) {
161
+ filter[j] = true
162
+ var browser = j.replace(/\s\S+$/, '')
163
+ browsers[browser] = true
164
+ if (/\s0$/.test(j)) {
165
+ versionLess[browser] = true
166
+ }
167
+ })
160
168
  return result.filter(function (j) {
161
- return array.indexOf(j) === -1
169
+ if (filter[j]) {
170
+ return false
171
+ } else {
172
+ var browser = j.replace(/\s\S+$/, '')
173
+ if (versionLess[browser]) {
174
+ return false
175
+ } else if (/\s0$/.test(j) && browsers[browser]) {
176
+ return false
177
+ } else {
178
+ return true
179
+ }
180
+ }
162
181
  })
163
182
  }
164
183
  return result.concat(array)
package/node.js CHANGED
@@ -156,7 +156,7 @@ module.exports = {
156
156
  if (versions.length === 1 && data[i] && data[i].versions.length === 1) {
157
157
  var normal = Object.keys(data[i].versions)[0]
158
158
  normalized[i] = { }
159
- normalized[i][normal] = stats[i]
159
+ normalized[i][normal] = stats[i][versions[0]]
160
160
  } else {
161
161
  normalized[i] = stats[i]
162
162
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browserslist",
3
- "version": "4.3.2",
3
+ "version": "4.3.6",
4
4
  "description": "Share target browsers between different front-end tools, like Autoprefixer, Stylelint and babel-env-preset",
5
5
  "keywords": [
6
6
  "caniuse",
@@ -11,13 +11,18 @@
11
11
  "license": "MIT",
12
12
  "repository": "browserslist/browserslist",
13
13
  "dependencies": {
14
- "caniuse-lite": "^1.0.30000898",
15
- "electron-to-chromium": "^1.3.80",
16
- "node-releases": "^1.0.0-alpha.14"
14
+ "caniuse-lite": "^1.0.30000921",
15
+ "electron-to-chromium": "^1.3.92",
16
+ "node-releases": "^1.1.1"
17
17
  },
18
18
  "bin": "./cli.js",
19
19
  "browser": {
20
20
  "./node.js": "./browser.js",
21
21
  "path": false
22
+ },
23
+ "husky": {
24
+ "hooks": {
25
+ "pre-commit": "lint-staged"
26
+ }
22
27
  }
23
28
  }