postcss-merge-rules 8.0.0 → 8.0.2

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/LICENSE-MIT CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) Ben Briggs <beneb.info@gmail.com> (http://beneb.info)
1
+ Copyright (c) Ben Briggs <beneb.info@gmail.com> (https://beneb.info)
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person
4
4
  obtaining a copy of this software and associated documentation
package/README.md CHANGED
@@ -100,6 +100,6 @@ See [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTOR
100
100
 
101
101
  ## License
102
102
 
103
- MIT © [Ben Briggs](http://beneb.info)
103
+ MIT © [Ben Briggs](https://beneb.info)
104
104
 
105
105
  [postcss]: https://github.com/postcss/postcss
package/package.json CHANGED
@@ -1,9 +1,25 @@
1
1
  {
2
2
  "name": "postcss-merge-rules",
3
- "version": "8.0.0",
3
+ "version": "8.0.2",
4
4
  "description": "Merge CSS rules with PostCSS.",
5
- "types": "types/index.d.ts",
6
- "main": "src/index.js",
5
+ "exports": {
6
+ ".": {
7
+ "types": "./types/index.d.ts",
8
+ "default": "./src/index.js"
9
+ },
10
+ "./src": "./src/index.js",
11
+ "./src/index": "./src/index.js",
12
+ "./src/index.js": "./src/index.js",
13
+ "./src/lib/ensureCompatibility.js": "./src/lib/ensureCompatibility.js",
14
+ "./src/lib/ensureCompatibility": "./src/lib/ensureCompatibility.js",
15
+ "./package.json": "./package.json"
16
+ },
17
+ "imports": {
18
+ "#getBrowsersList": {
19
+ "node": "./src/lib/computeBrowsersToSupport.js",
20
+ "default": "./src/lib/getBrowsersForWebBuild.js"
21
+ }
22
+ },
7
23
  "files": [
8
24
  "LICENSE-MIT",
9
25
  "src",
@@ -20,14 +36,17 @@
20
36
  "author": {
21
37
  "name": "Ben Briggs",
22
38
  "email": "beneb.info@gmail.com",
23
- "url": "http://beneb.info"
39
+ "url": "https://beneb.info"
40
+ },
41
+ "repository": {
42
+ "type": "git",
43
+ "url": "cssnano/cssnano"
24
44
  },
25
- "repository": "cssnano/cssnano",
26
45
  "dependencies": {
27
- "browserslist": "^4.28.2",
28
- "caniuse-api": "^3.0.0",
29
- "postcss-selector-parser": "^7.1.1",
30
- "cssnano-utils": "^6.0.0"
46
+ "browserslist": "^4.28.7",
47
+ "caniuse-api": "^4.0.0",
48
+ "postcss-selector-parser": "^7.1.4",
49
+ "cssnano-utils": "^6.0.2"
31
50
  },
32
51
  "bugs": {
33
52
  "url": "https://github.com/cssnano/cssnano/issues"
@@ -36,12 +55,11 @@
36
55
  "node": "^22.11.0 || ^24.11.0 || >=26.0"
37
56
  },
38
57
  "devDependencies": {
39
- "@types/caniuse-api": "^3.0.6",
40
- "postcss": "^8.5.14",
58
+ "postcss": "^8.5.25",
41
59
  "postcss-simple-vars": "^7.0.1",
42
- "postcss-discard-comments": "^8.0.0"
60
+ "postcss-discard-comments": "^8.0.2"
43
61
  },
44
62
  "peerDependencies": {
45
- "postcss": "^8.5.14"
63
+ "postcss": "^8.5.25"
46
64
  }
47
65
  }
package/src/index.js CHANGED
@@ -1,16 +1,19 @@
1
1
  'use strict';
2
- const { dirname } = require('path');
3
- const browserslist = require('browserslist');
2
+
3
+ const getBrowsersList = require('#getBrowsersList');
4
+
5
+ /** @import browserslist from 'browserslist' */
6
+
4
7
  const { sameParent } = require('cssnano-utils');
5
8
  const {
6
9
  ensureCompatibility,
7
10
  sameVendor,
8
11
  noVendor,
9
12
  } = require('./lib/ensureCompatibility');
10
-
13
+ /** @import {Declaration, Rule} from 'postcss' */
11
14
  /**
12
- * @param {import('postcss').Declaration} a
13
- * @param {import('postcss').Declaration} b
15
+ * @param {Declaration} a
16
+ * @param {Declaration} b
14
17
  * @return {boolean}
15
18
  */
16
19
  function declarationIsEqual(a, b) {
@@ -20,8 +23,8 @@ function declarationIsEqual(a, b) {
20
23
  }
21
24
 
22
25
  /**
23
- * @param {import('postcss').Declaration[]} array
24
- * @param {import('postcss').Declaration} decl
26
+ * @param {Declaration[]} array
27
+ * @param {Declaration} decl
25
28
  * @return {number}
26
29
  */
27
30
  function indexOfDeclaration(array, decl) {
@@ -30,10 +33,10 @@ function indexOfDeclaration(array, decl) {
30
33
 
31
34
  /**
32
35
  * Returns filtered array of matched or unmatched declarations
33
- * @param {import('postcss').Declaration[]} a
34
- * @param {import('postcss').Declaration[]} b
36
+ * @param {Declaration[]} a
37
+ * @param {Declaration[]} b
35
38
  * @param {boolean} [not=false]
36
- * @return {import('postcss').Declaration[]}
39
+ * @return {Declaration[]}
37
40
  */
38
41
  function intersect(a, b, not) {
39
42
  return a.filter((c) => {
@@ -43,8 +46,8 @@ function intersect(a, b, not) {
43
46
  }
44
47
 
45
48
  /**
46
- * @param {import('postcss').Declaration[]} a
47
- * @param {import('postcss').Declaration[]} b
49
+ * @param {Declaration[]} a
50
+ * @param {Declaration[]} b
48
51
  * @return {boolean}
49
52
  */
50
53
  function sameDeclarationsAndOrder(a, b) {
@@ -60,17 +63,17 @@ function sameDeclarationsAndOrder(a, b) {
60
63
  *
61
64
  * @typedef {Object} RuleMeta
62
65
  * @property {string[]} selectors - Array of selector strings for the rule
63
- * @property {import('postcss').Declaration[]} declarations - Array of declaration nodes for the rule
66
+ * @property {Declaration[]} declarations - Array of declaration nodes for the rule
64
67
  * @property {boolean} dirty - Whether the selectors have been modified and need flushing
65
68
  */
66
69
 
67
70
  /**
68
- * @param {import('postcss').Rule} ruleA
69
- * @param {import('postcss').Rule} ruleB
71
+ * @param {Rule} ruleA
72
+ * @param {Rule} ruleB
70
73
  * @param {string[]} browsers
71
74
  * @param {Map<string, boolean>} compatibilityCache
72
- * @param {WeakSet<import('postcss').Rule>} ruleCache
73
- * @param {WeakMap<import('postcss').Rule, RuleMeta>} ruleMeta
75
+ * @param {WeakSet<Rule>} ruleCache
76
+ * @param {WeakMap<Rule, RuleMeta>} ruleMeta
74
77
  * @return {boolean}
75
78
  */
76
79
  function canMerge(
@@ -131,7 +134,7 @@ function isRuleOrAtRule(node) {
131
134
  }
132
135
  /**
133
136
  * @param {import('postcss').ChildNode} node
134
- * @return {node is import('postcss').Declaration}
137
+ * @return {node is Declaration}
135
138
  */
136
139
  function isDeclaration(node) {
137
140
  return node.type === 'decl';
@@ -143,8 +146,8 @@ function isDeclaration(node) {
143
146
  * This metadata caches selectors and declarations to avoid expensive AST
144
147
  * re-parsing, especially for the selectors.
145
148
  *
146
- * @param {import('postcss').Rule} rule The PostCSS rule to get metadata for.
147
- * @param {WeakMap<import('postcss').Rule, RuleMeta>} [ruleMeta] The metadata cache.
149
+ * @param {Rule} rule The PostCSS rule to get metadata for.
150
+ * @param {WeakMap<Rule, RuleMeta>} [ruleMeta] The metadata cache.
148
151
  * @return {RuleMeta} The rule's virtual metadata.
149
152
  */
150
153
  function getMeta(rule, ruleMeta) {
@@ -170,8 +173,8 @@ function getMeta(rule, ruleMeta) {
170
173
  /**
171
174
  * Commits virtual metadata changes back to the actual PostCSS rule.
172
175
  *
173
- * @param {import('postcss').Rule} rule The PostCSS rule to flush.
174
- * @param {WeakMap<import('postcss').Rule, RuleMeta>} ruleMeta The metadata cache.
176
+ * @param {Rule} rule The PostCSS rule to flush.
177
+ * @param {WeakMap<Rule, RuleMeta>} ruleMeta The metadata cache.
175
178
  */
176
179
  function flush(rule, ruleMeta) {
177
180
  const meta = ruleMeta.get(rule);
@@ -182,15 +185,15 @@ function flush(rule, ruleMeta) {
182
185
  }
183
186
 
184
187
  /**
185
- * @param {import('postcss').Rule} rule
186
- * @return {import('postcss').Declaration[]}
188
+ * @param {Rule} rule
189
+ * @return {Declaration[]}
187
190
  */
188
191
  function getDecls(rule) {
189
192
  return rule.nodes.filter(isDeclaration);
190
193
  }
191
194
 
192
195
  /**
193
- * @param {...import('postcss').Rule} rules
196
+ * @param {...Rule} rules
194
197
  * @return {number}
195
198
  */
196
199
  function ruleLength(...rules) {
@@ -275,8 +278,8 @@ function isConflictingProp(propA, propB) {
275
278
  }
276
279
 
277
280
  /**
278
- * @param {import('postcss').Rule} first
279
- * @param {import('postcss').Rule} second
281
+ * @param {Rule} first
282
+ * @param {Rule} second
280
283
  * @return {boolean} merged
281
284
  */
282
285
  function mergeParents(first, second) {
@@ -298,13 +301,13 @@ function mergeParents(first, second) {
298
301
  }
299
302
 
300
303
  /**
301
- * @param {import('postcss').Rule} first
302
- * @param {import('postcss').Rule} second
304
+ * @param {Rule} first
305
+ * @param {Rule} second
303
306
  * @param {string[]} browsers
304
307
  * @param {Map<string, boolean>} compatibilityCache
305
- * @param {WeakSet<import('postcss').Rule>} ruleCache
306
- * @param {WeakMap<import('postcss').Rule, RuleMeta>} ruleMeta
307
- * @return {import('postcss').Rule} mergedRule
308
+ * @param {WeakSet<Rule>} ruleCache
309
+ * @param {WeakMap<Rule, RuleMeta>} ruleMeta
310
+ * @return {Rule} mergedRule
308
311
  */
309
312
  function partialMerge(
310
313
  first,
@@ -345,7 +348,7 @@ function partialMerge(
345
348
  )
346
349
  ) {
347
350
  const metaNext = getMeta(nextRule, ruleMeta);
348
- let nextIntersection = intersect(
351
+ const nextIntersection = intersect(
349
352
  metaSecond.declarations,
350
353
  metaNext.declarations
351
354
  );
@@ -359,8 +362,8 @@ function partialMerge(
359
362
 
360
363
  const metaFirstActual = getMeta(first, ruleMeta);
361
364
  const metaSecondActual = getMeta(second, ruleMeta);
362
- let firstDecls = [...metaFirstActual.declarations];
363
- let secondDecls = [...metaSecondActual.declarations];
365
+ const firstDecls = [...metaFirstActual.declarations];
366
+ const secondDecls = [...metaSecondActual.declarations];
364
367
 
365
368
  // Filter out intersections with later conflicts in First
366
369
  intersection = intersection.filter((decl, intersectIndex) => {
@@ -426,9 +429,9 @@ function partialMerge(
426
429
  const secondClone = second.clone({ selectors: secondSelectors });
427
430
 
428
431
  /**
429
- * @param {function(import('postcss').Declaration):void} callback
432
+ * @param {(decl: Declaration) => void} callback
430
433
  * @this void
431
- * @return {function(import('postcss').Declaration)}
434
+ * @return {(decl: Declaration) => void}
432
435
  */
433
436
  function moveDecl(callback) {
434
437
  return (decl) => {
@@ -438,10 +441,15 @@ function partialMerge(
438
441
  };
439
442
  }
440
443
  firstClone.walkDecls(
441
- moveDecl((decl) => {
442
- decl.remove();
443
- receivingBlock.append(decl);
444
- })
444
+ moveDecl(
445
+ /**
446
+ * @param {Declaration} decl
447
+ */
448
+ (decl) => {
449
+ decl.remove();
450
+ receivingBlock.append(decl);
451
+ }
452
+ )
445
453
  );
446
454
  secondClone.walkDecls(moveDecl((decl) => decl.remove()));
447
455
 
@@ -479,12 +487,12 @@ function partialMerge(
479
487
  /**
480
488
  * @param {string[]} browsers
481
489
  * @param {Map<string, boolean>} compatibilityCache
482
- * @param {WeakSet<import('postcss').Rule>} ruleCache
483
- * @param {WeakMap<import('postcss').Rule, RuleMeta>} ruleMeta
484
- * @return {{ merger: function(import('postcss').Rule): void, clean: function(): void }}
490
+ * @param {WeakSet<Rule>} ruleCache
491
+ * @param {WeakMap<Rule, RuleMeta>} ruleMeta
492
+ * @return {{ merger: (rule: Rule) => void, clean: () => void }}
485
493
  */
486
494
  function selectorMerger(browsers, compatibilityCache, ruleCache, ruleMeta) {
487
- /** @type {import('postcss').Rule | null} */
495
+ /** @type {Rule | null} */
488
496
  let cache = null;
489
497
  return {
490
498
  merger(rule) {
@@ -550,7 +558,7 @@ function selectorMerger(browsers, compatibilityCache, ruleCache, ruleMeta) {
550
558
  node.remove();
551
559
  return;
552
560
  }
553
- /** @type {import('postcss').Rule} */ (cache).append(node);
561
+ /** @type {Rule} */ (cache).append(node);
554
562
  });
555
563
  getMeta(cache, ruleMeta).declarations = getDecls(cache);
556
564
  rule.remove();
@@ -584,7 +592,6 @@ function selectorMerger(browsers, compatibilityCache, ruleCache, ruleMeta) {
584
592
  */
585
593
 
586
594
  /**
587
- * @type {import('postcss').PluginCreator<Options>}
588
595
  * @param {Options} opts
589
596
  * @return {import('postcss').Plugin}
590
597
  */
@@ -597,11 +604,7 @@ function pluginCreator(opts = {}) {
597
604
  */
598
605
  prepare(result) {
599
606
  const { stats, env, from, file } = result.opts || {};
600
- const browsers = browserslist(opts.overrideBrowserslist, {
601
- stats: opts.stats || stats,
602
- path: opts.path || dirname(from || file || __filename),
603
- env: opts.env || env,
604
- });
607
+ const browsers = getBrowsersList(opts, stats, from, file, env);
605
608
 
606
609
  const compatibilityCache = new Map();
607
610
 
@@ -610,6 +613,9 @@ function pluginCreator(opts = {}) {
610
613
  const ruleMeta = new WeakMap();
611
614
 
612
615
  return {
616
+ /**
617
+ * @param {import('postcss').Root} css
618
+ */
613
619
  OnceExit(css) {
614
620
  const { merger, clean } = selectorMerger(
615
621
  browsers,
@@ -626,4 +632,6 @@ function pluginCreator(opts = {}) {
626
632
  }
627
633
 
628
634
  pluginCreator.postcss = true;
629
- module.exports = pluginCreator;
635
+ module.exports = /** @type {import('postcss').PluginCreator<Options>} */ (
636
+ pluginCreator
637
+ );
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+
3
+ const browserslist = require('browserslist');
4
+ const { dirname } = require('node:path');
5
+
6
+ /**
7
+ *
8
+ * @param {{overrideBrowserslist?: string | string[] | undefined, stats?: browserslist.Options["stats"], path?: browserslist.Options["path"], env?: browserslist.Options["env"]}} options
9
+ * @param {browserslist.Options["stats"]} stats
10
+ * @param {string|undefined} from
11
+ * @param {string} [file]
12
+ * @param {browserslist.Options["env"]} [env]
13
+ * @returns {string[]}
14
+ */
15
+ module.exports = function computeBrowsersToSupport(
16
+ options,
17
+ stats,
18
+ from,
19
+ file,
20
+ env
21
+ ) {
22
+ return browserslist(options.overrideBrowserslist, {
23
+ stats: options.stats || stats,
24
+ path: options.path || dirname(from || file || __filename),
25
+ env: options.env || env,
26
+ });
27
+ };
@@ -26,14 +26,15 @@ function filterPrefixes(selector) {
26
26
  return selector.match(vendorPrefix);
27
27
  }
28
28
 
29
+ const inputPlaceholderRegex = /-ms-input-placeholder/i;
29
30
  /**
30
31
  * Internet Explorer use :-ms-input-placeholder.
31
32
  * Microsoft Edge use ::-ms-input-placeholder.
32
33
  *
33
- * @type {(selector: string) => number}
34
+ * @type {(selector: string) => boolean}
34
35
  */
35
36
  const findMsInputPlaceholder = (selector) =>
36
- ~selector.search(/-ms-input-placeholder/i);
37
+ inputPlaceholderRegex.test(selector);
37
38
 
38
39
  /**
39
40
  * @param {string[]} selectorsA
@@ -42,9 +43,9 @@ const findMsInputPlaceholder = (selector) =>
42
43
  */
43
44
  function sameVendor(selectorsA, selectorsB) {
44
45
  /** @type {(selectors: string[]) => string} */
45
- let same = (selectors) => selectors.map(filterPrefixes).join();
46
+ const same = (selectors) => selectors.map(filterPrefixes).join();
46
47
  /** @type {(selectors: string[]) => string | undefined} */
47
- let findMsVendor = (selectors) => selectors.find(findMsInputPlaceholder);
48
+ const findMsVendor = (selectors) => selectors.find(findMsInputPlaceholder);
48
49
  return (
49
50
  same(selectorsA) === same(selectorsB) &&
50
51
  !(findMsVendor(selectorsA) && findMsVendor(selectorsB))
@@ -177,7 +178,7 @@ function ensureCompatibility(selectors, browsers, compatibilityCache) {
177
178
  const { type, value } = node;
178
179
  if (type === 'pseudo') {
179
180
  const entry =
180
- pseudoElements[/** @type {keyof pseudoElements} */ (value)];
181
+ pseudoElements[/** @type keyof typeof pseudoElements*/ (value)];
181
182
  if (!entry && noVendor(value)) {
182
183
  compatible = false;
183
184
  }
@@ -0,0 +1,35 @@
1
+ 'use strict';
2
+
3
+ module.exports = function () {
4
+ return [
5
+ 'and_chr 150',
6
+ 'and_ff 152',
7
+ 'and_qq 14.9',
8
+ 'and_uc 15.5',
9
+ 'android 150',
10
+ 'chrome 150',
11
+ 'chrome 149',
12
+ 'chrome 148',
13
+ 'chrome 118',
14
+ 'chrome 109',
15
+ 'edge 150',
16
+ 'edge 149',
17
+ 'edge 148',
18
+ 'firefox 152',
19
+ 'firefox 151',
20
+ 'firefox 140',
21
+ 'ios_saf 26.5',
22
+ 'ios_saf 26.4',
23
+ 'ios_saf 26.3',
24
+ 'ios_saf 18.5-18.7',
25
+ 'kaios 3.0-3.1',
26
+ 'op_mob 80',
27
+ 'opera 131',
28
+ 'opera 127',
29
+ 'safari 26.5',
30
+ 'safari 26.4',
31
+ 'safari 26.3',
32
+ 'samsung 30',
33
+ 'samsung 29',
34
+ ];
35
+ };
package/types/index.d.ts CHANGED
@@ -1,24 +1,8 @@
1
- export = pluginCreator;
2
- /**
3
- * @typedef {{ overrideBrowserslist?: string | string[] }} AutoprefixerOptions
4
- * @typedef {Pick<browserslist.Options, 'stats' | 'path' | 'env'>} BrowserslistOptions
5
- * @typedef {AutoprefixerOptions & BrowserslistOptions} Options
6
- */
7
- /**
8
- * @type {import('postcss').PluginCreator<Options>}
9
- * @param {Options} opts
10
- * @return {import('postcss').Plugin}
11
- */
12
- declare function pluginCreator(opts?: Options): import("postcss").Plugin;
13
- declare namespace pluginCreator {
14
- export { postcss, RuleMeta, AutoprefixerOptions, BrowserslistOptions, Options };
15
- }
16
- declare var postcss: true;
17
- /**
18
- * RuleMeta stores metadata about a `Rule` during the merging process.
19
- * It tracks selectors and declarations without re-parsing the AST many times.
20
- */
21
- type RuleMeta = {
1
+ declare const _exports: import("postcss").PluginCreator<Options>;
2
+ export = _exports;
3
+ import type browserslist from 'browserslist';
4
+ import type { Declaration } from 'postcss';
5
+ export type RuleMeta = {
22
6
  /**
23
7
  * - Array of selector strings for the rule
24
8
  */
@@ -26,16 +10,15 @@ type RuleMeta = {
26
10
  /**
27
11
  * - Array of declaration nodes for the rule
28
12
  */
29
- declarations: import("postcss").Declaration[];
13
+ declarations: Declaration[];
30
14
  /**
31
15
  * - Whether the selectors have been modified and need flushing
32
16
  */
33
17
  dirty: boolean;
34
18
  };
35
- type AutoprefixerOptions = {
19
+ export type AutoprefixerOptions = {
36
20
  overrideBrowserslist?: string | string[];
37
21
  };
38
- type BrowserslistOptions = Pick<browserslist.Options, "stats" | "path" | "env">;
39
- type Options = AutoprefixerOptions & BrowserslistOptions;
40
- import browserslist = require("browserslist");
22
+ export type BrowserslistOptions = Pick<browserslist.Options, 'stats' | 'path' | 'env'>;
23
+ export type Options = AutoprefixerOptions & BrowserslistOptions;
41
24
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";AAmkBA;;;;GAIG;AAEH;;;;GAIG;AACH,sCAHW,OAAO,GACN,OAAO,SAAS,EAAE,MAAM,CAqCnC;;;;;;;;;;;;;eApjBa,MAAM,EAAE;;;;kBACR,OAAO,SAAS,EAAE,WAAW,EAAE;;;;WAC/B,OAAO;;2BAqgBR;IAAE,oBAAoB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAAE;2BAC5C,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;eACpD,mBAAmB,GAAG,mBAAmB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";;AAII,OAAQ,KAAA,YAAY,MAAM,cAAc,CAAA;AAQxC,OAAQ,KAAA,EAAC,WAAW,EAAO,MAAM,SAAS,CAAA;AAmD3C,YAAkB,QAAQ,GAC1B;;;;IAAqB,SAAS,EAAnB,MAAM,EAAE,CACnB;;;;IAA0B,YAAY,EAA3B,WAAW,EAAE,CACxB;;;;IAAoB,KAAK,EAAd,OAAO,CACpB;CAAA,CAAA;AAygBE,YAAwD,mBAAmB,GAAjE;IAAE,oBAAoB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAAE,CAAqB;AAC3E,YAAgE,mBAAmB,GAAzE,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC,CAAqB;AACnF,YAAqD,OAAO,GAAlD,mBAAmB,GAAG,mBAAmB,CAAS"}
@@ -0,0 +1,18 @@
1
+ export = computeBrowsersToSupport;
2
+ /**
3
+ *
4
+ * @param {{overrideBrowserslist?: string | string[] | undefined, stats?: browserslist.Options["stats"], path?: browserslist.Options["path"], env?: browserslist.Options["env"]}} options
5
+ * @param {browserslist.Options["stats"]} stats
6
+ * @param {string|undefined} from
7
+ * @param {string} [file]
8
+ * @param {browserslist.Options["env"]} [env]
9
+ * @returns {string[]}
10
+ */
11
+ declare function computeBrowsersToSupport(options: {
12
+ overrideBrowserslist?: string | string[] | undefined;
13
+ stats?: browserslist.Options["stats"];
14
+ path?: browserslist.Options["path"];
15
+ env?: browserslist.Options["env"];
16
+ }, stats: browserslist.Options["stats"], from: string | undefined, file?: string, env?: browserslist.Options["env"]): string[];
17
+ import browserslist = require('browserslist');
18
+ //# sourceMappingURL=computeBrowsersToSupport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computeBrowsersToSupport.d.ts","sourceRoot":"","sources":["../../src/lib/computeBrowsersToSupport.js"],"names":[],"mappings":";AAKA;;;;;;;;GAQG;0CAED,OAAO,EARE;IAAC,oBAAoB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;IAAC,KAAK,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAAC,IAAI,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAAC,GAAG,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;CAQtK,EACP,KAAK,EARI,YAAY,CAAC,OAAO,CAAC,OAAO,CAQhC,EACL,IAAI,EARK,MAAM,GAAC,SAQZ,EACJ,IAAI,AARH,CACA,EADQ,MAQL,EACJ,GAAG,AARF,CACA,EADQ,YAAY,CAAC,OAAO,CAAC,KAAK,CAQhC,GAPQ,MAAM,EAAE;OAVf,YAAY,WAAW,cAAc"}
@@ -1,72 +1,78 @@
1
+ declare const _exports: {
2
+ sameVendor: typeof sameVendor;
3
+ noVendor: typeof noVendor;
4
+ pseudoElements: {
5
+ ':active': string;
6
+ ':after': string;
7
+ ':any-link': string;
8
+ ':before': string;
9
+ ':checked': string;
10
+ ':default': string;
11
+ ':dir': string;
12
+ ':disabled': string;
13
+ ':empty': string;
14
+ ':enabled': string;
15
+ ':first-child': string;
16
+ ':first-letter': string;
17
+ ':first-line': string;
18
+ ':first-of-type': string;
19
+ ':focus': string;
20
+ ':focus-within': string;
21
+ ':focus-visible': string;
22
+ ':has': string;
23
+ ':hover': string;
24
+ ':in-range': string;
25
+ ':indeterminate': string;
26
+ ':invalid': string;
27
+ ':is': string;
28
+ ':lang': string;
29
+ ':last-child': string;
30
+ ':last-of-type': string;
31
+ ':link': string;
32
+ ':matches': string;
33
+ ':not': string;
34
+ ':nth-child': string;
35
+ ':nth-last-child': string;
36
+ ':nth-last-of-type': string;
37
+ ':nth-of-type': string;
38
+ ':only-child': string;
39
+ ':only-of-type': string;
40
+ ':optional': string;
41
+ ':out-of-range': string;
42
+ ':placeholder-shown': string;
43
+ ':required': string;
44
+ ':root': string;
45
+ ':target': string;
46
+ '::after': string;
47
+ '::backdrop': string;
48
+ '::before': string;
49
+ '::first-letter': string;
50
+ '::first-line': string;
51
+ '::marker': string;
52
+ '::placeholder': string;
53
+ '::selection': string;
54
+ ':valid': string;
55
+ ':visited': string;
56
+ };
57
+ ensureCompatibility: typeof ensureCompatibility;
58
+ };
59
+ export = _exports;
1
60
  /**
2
61
  * @param {string[]} selectorsA
3
62
  * @param {string[]} selectorsB
4
63
  * @return {boolean}
5
64
  */
6
- export function sameVendor(selectorsA: string[], selectorsB: string[]): boolean;
65
+ declare function sameVendor(selectorsA: string[], selectorsB: string[]): boolean;
7
66
  /**
8
67
  * @param {string} selector
9
68
  * @return {boolean}
10
69
  */
11
- export function noVendor(selector: string): boolean;
12
- export const pseudoElements: {
13
- ':active': string;
14
- ':after': string;
15
- ':any-link': string;
16
- ':before': string;
17
- ':checked': string;
18
- ':default': string;
19
- ':dir': string;
20
- ':disabled': string;
21
- ':empty': string;
22
- ':enabled': string;
23
- ':first-child': string;
24
- ':first-letter': string;
25
- ':first-line': string;
26
- ':first-of-type': string;
27
- ':focus': string;
28
- ':focus-within': string;
29
- ':focus-visible': string;
30
- ':has': string;
31
- ':hover': string;
32
- ':in-range': string;
33
- ':indeterminate': string;
34
- ':invalid': string;
35
- ':is': string;
36
- ':lang': string;
37
- ':last-child': string;
38
- ':last-of-type': string;
39
- ':link': string;
40
- ':matches': string;
41
- ':not': string;
42
- ':nth-child': string;
43
- ':nth-last-child': string;
44
- ':nth-last-of-type': string;
45
- ':nth-of-type': string;
46
- ':only-child': string;
47
- ':only-of-type': string;
48
- ':optional': string;
49
- ':out-of-range': string;
50
- ':placeholder-shown': string;
51
- ':required': string;
52
- ':root': string;
53
- ':target': string;
54
- '::after': string;
55
- '::backdrop': string;
56
- '::before': string;
57
- '::first-letter': string;
58
- '::first-line': string;
59
- '::marker': string;
60
- '::placeholder': string;
61
- '::selection': string;
62
- ':valid': string;
63
- ':visited': string;
64
- };
70
+ declare function noVendor(selector: string): boolean;
65
71
  /**
66
72
  * @param {string[]} selectors
67
73
  * @param{string[]=} browsers
68
74
  * @param{Map<string,boolean>=} compatibilityCache
69
75
  * @return {boolean}
70
76
  */
71
- export function ensureCompatibility(selectors: string[], browsers?: string[] | undefined, compatibilityCache?: Map<string, boolean> | undefined): boolean;
77
+ declare function ensureCompatibility(selectors: string[], browsers?: string[] | undefined, compatibilityCache?: Map<string, boolean> | undefined): boolean;
72
78
  //# sourceMappingURL=ensureCompatibility.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ensureCompatibility.d.ts","sourceRoot":"","sources":["../../src/lib/ensureCompatibility.js"],"names":[],"mappings":"AAqCA;;;;GAIG;AACH,uCAJW,MAAM,EAAE,cACR,MAAM,EAAE,GACP,OAAO,CAWlB;AAED;;;GAGG;AACH,mCAHW,MAAM,GACL,OAAO,CAIlB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoDE;AAqCF;;;;;GAKG;AACH,+CALW,MAAM,EAAE,aACT,MAAM,EAAE,YAAC,uBACT,GAAG,CAAC,MAAM,EAAC,OAAO,CAAC,YAAC,GAClB,OAAO,CA0ElB"}
1
+ {"version":3,"file":"ensureCompatibility.d.ts","sourceRoot":"","sources":["../../src/lib/ensureCompatibility.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA;;;;GAIG;AACH,iBAAS,UAAU,CAAC,UAAU,EAJnB,MAAM,EAIa,EAAE,UAAU,EAH/B,MAAM,EAGyB,GAF9B,OAAO,CAWlB;AAED;;;GAGG;AACH,iBAAS,QAAQ,CAAC,QAAQ,EAHf,MAGe,GAFd,OAAO,CAIlB;AA2FD;;;;;GAKG;AACH,iBAAS,mBAAmB,CAAC,SAAS,EAL3B,MAAM,EAKqB,EAAE,QAAQ,AAJ7C,CACA,EADO,MAAM,EAAE,YAI8B,EAAE,kBAAkB,AAHjE,CACA,EADO,GAAG,CAAC,MAAM,EAAC,OAAO,CAAC,YAGuC,GAFxD,OAAO,CA0ElB"}
@@ -0,0 +1,3 @@
1
+ export = _exports;
2
+ declare function _exports(): string[];
3
+ //# sourceMappingURL=getBrowsersForWebBuild.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getBrowsersForWebBuild.d.ts","sourceRoot":"","sources":["../../src/lib/getBrowsersForWebBuild.js"],"names":[],"mappings":""}