browserslist 4.22.2 → 4.23.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.
package/README.md CHANGED
@@ -46,13 +46,7 @@ You can check how config works at our playground: [`browsersl.ist`](https://brow
46
46
  <br>
47
47
  <br>
48
48
  <div align="center">
49
- <a href="https://evilmartians.com/?utm_source=browserslist">
50
- <img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg"
51
- alt="Sponsored by Evil Martians" width="236" height="54">
52
- </a>  <a href="https://cube.dev/?ref=eco-browserslist-github">
53
- <img src="https://user-images.githubusercontent.com/986756/154330861-d79ab8ec-aacb-4af8-9e17-1b28f1eccb01.svg"
54
- alt="Supported by Cube" width="227" height="46">
55
- </a>
49
+ <a href="https://evilmartians.com/?utm_source=browserslist"><img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg" alt="Sponsored by Evil Martians" width="236" height="54"></a>  <a href="https://cube.dev/?ref=eco-browserslist-github"><img src="https://user-images.githubusercontent.com/986756/154330861-d79ab8ec-aacb-4af8-9e17-1b28f1eccb01.svg" alt="Supported by Cube" width="227" height="46"></a>
56
50
  </div>
57
51
 
58
52
  [stylelint-no-unsupported-browser-features]: https://github.com/ismay/stylelint-no-unsupported-browser-features
package/index.d.ts CHANGED
@@ -193,6 +193,7 @@ declare global {
193
193
  BROWSERSLIST_ENV?: string
194
194
  BROWSERSLIST_IGNORE_OLD_DATA?: string
195
195
  BROWSERSLIST_STATS?: string
196
+ BROWSERSLIST_ROOT_PATH?: string
196
197
  }
197
198
  }
198
199
  }
package/index.js CHANGED
@@ -893,7 +893,7 @@ var QUERIES = {
893
893
  },
894
894
  supports: {
895
895
  matches: ['supportType', 'feature'],
896
- regexp: /^(?:(fully|partially) )?supports\s+([\w-]+)$/,
896
+ regexp: /^(?:(fully|partially)\s+)?supports\s+([\w-]+)$/,
897
897
  select: function (context, node) {
898
898
  env.loadFeature(browserslist.cache, node.feature)
899
899
  var withPartial = node.supportType !== 'fully'
package/node.js CHANGED
@@ -7,7 +7,7 @@ var BrowserslistError = require('./error')
7
7
 
8
8
  var IS_SECTION = /^\s*\[(.+)]\s*$/
9
9
  var CONFIG_PATTERN = /^browserslist-config-/
10
- var SCOPED_CONFIG__PATTERN = /@[^/]+\/browserslist-config(-|$|\/)/
10
+ var SCOPED_CONFIG__PATTERN = /@[^/]+(?:\/[^/]+)?\/browserslist-config(?:-|$|\/)/
11
11
  var TIME_TO_UPDATE_CANIUSE = 6 * 30 * 24 * 60 * 60 * 1000
12
12
  var FORMAT =
13
13
  'Browserslist config should be a string or an array ' +
@@ -50,12 +50,22 @@ function eachParent(file, callback) {
50
50
  var dir = isFile(file) ? path.dirname(file) : file
51
51
  var loc = path.resolve(dir)
52
52
  do {
53
+ if (!pathInRoot(loc)) break;
53
54
  var result = callback(loc)
54
55
  if (typeof result !== 'undefined') return result
55
56
  } while (loc !== (loc = path.dirname(loc)))
56
57
  return undefined
57
58
  }
58
59
 
60
+ function pathInRoot(p) {
61
+ if (!process.env.BROWSERSLIST_ROOT_PATH) return true
62
+ var rootPath = path.resolve(process.env.BROWSERSLIST_ROOT_PATH);
63
+ if (path.relative(rootPath, p).substring(0,2) === '..') {
64
+ return false;
65
+ }
66
+ return true
67
+ }
68
+
59
69
  function check(section) {
60
70
  if (Array.isArray(section)) {
61
71
  for (var i = 0; i < section.length; i++) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browserslist",
3
- "version": "4.22.2",
3
+ "version": "4.23.0",
4
4
  "description": "Share target browsers between different front-end tools, like Autoprefixer, Stylelint and babel-env-preset",
5
5
  "keywords": [
6
6
  "caniuse",
@@ -25,8 +25,8 @@
25
25
  "license": "MIT",
26
26
  "repository": "browserslist/browserslist",
27
27
  "dependencies": {
28
- "caniuse-lite": "^1.0.30001565",
29
- "electron-to-chromium": "^1.4.601",
28
+ "caniuse-lite": "^1.0.30001587",
29
+ "electron-to-chromium": "^1.4.668",
30
30
  "node-releases": "^2.0.14",
31
31
  "update-browserslist-db": "^1.0.13"
32
32
  },