diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2026-05-18 23:10:59 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2026-05-18 23:41:44 +0800 |
| commit | fc87c009806dcc98867f6b58efe29b042aa01dee (patch) | |
| tree | 8f59b3f4a5b66e9dfef2d40c8d318e258a521228 /node_modules/autoprefixer/lib/browsers.js | |
| parent | 3336b2356ee6152d9c6ae59bd9b87ccbc0958407 (diff) | |
node: updatemain
Diffstat (limited to 'node_modules/autoprefixer/lib/browsers.js')
| -rw-r--r-- | node_modules/autoprefixer/lib/browsers.js | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/node_modules/autoprefixer/lib/browsers.js b/node_modules/autoprefixer/lib/browsers.js deleted file mode 100644 index b268c84c..00000000 --- a/node_modules/autoprefixer/lib/browsers.js +++ /dev/null @@ -1,79 +0,0 @@ -let browserslist = require('browserslist') -let { agents } = require('caniuse-lite/dist/unpacker/agents') - -let utils = require('./utils') - -class Browsers { - constructor(data, requirements, options, browserslistOpts) { - this.data = data - this.options = options || {} - this.browserslistOpts = browserslistOpts || {} - this.selected = this.parse(requirements) - } - - /** - * Return all prefixes for default browser data - */ - static prefixes() { - if (this.prefixesCache) { - return this.prefixesCache - } - - this.prefixesCache = [] - for (let name in agents) { - this.prefixesCache.push(`-${agents[name].prefix}-`) - } - - this.prefixesCache = utils - .uniq(this.prefixesCache) - .sort((a, b) => b.length - a.length) - - return this.prefixesCache - } - - /** - * Check is value contain any possible prefix - */ - static withPrefix(value) { - if (!this.prefixesRegexp) { - this.prefixesRegexp = new RegExp(this.prefixes().join('|')) - } - - return this.prefixesRegexp.test(value) - } - - /** - * Is browser is selected by requirements - */ - isSelected(browser) { - return this.selected.includes(browser) - } - - /** - * Return browsers selected by requirements - */ - parse(requirements) { - let opts = {} - for (let i in this.browserslistOpts) { - opts[i] = this.browserslistOpts[i] - } - opts.path = this.options.from - return browserslist(requirements, opts) - } - - /** - * Return prefix for selected browser - */ - prefix(browser) { - let [name, version] = browser.split(' ') - let data = this.data[name] - - let prefix = data.prefix_exceptions && data.prefix_exceptions[version] - if (!prefix) { - prefix = data.prefix - } - return `-${prefix}-` - } -} - -module.exports = Browsers |
