mac npm-packages

This commit is contained in:
onvia
2023-09-06 09:51:55 +08:00
parent 037e598d81
commit ad27fa6bae
441 changed files with 255551 additions and 263062 deletions

View File

@@ -7,28 +7,10 @@ let Root = require('./root')
class Processor {
constructor(plugins = []) {
this.version = '8.4.20'
this.version = '8.4.29'
this.plugins = this.normalize(plugins)
}
use(plugin) {
this.plugins = this.plugins.concat(this.normalize([plugin]))
return this
}
process(css, opts = {}) {
if (
this.plugins.length === 0 &&
typeof opts.parser === 'undefined' &&
typeof opts.stringifier === 'undefined' &&
typeof opts.syntax === 'undefined'
) {
return new NoWorkResult(this, css, opts)
} else {
return new LazyResult(this, css, opts)
}
}
normalize(plugins) {
let normalized = []
for (let i of plugins) {
@@ -58,6 +40,24 @@ class Processor {
}
return normalized
}
process(css, opts = {}) {
if (
this.plugins.length === 0 &&
typeof opts.parser === 'undefined' &&
typeof opts.stringifier === 'undefined' &&
typeof opts.syntax === 'undefined'
) {
return new NoWorkResult(this, css, opts)
} else {
return new LazyResult(this, css, opts)
}
}
use(plugin) {
this.plugins = this.plugins.concat(this.normalize([plugin]))
return this
}
}
module.exports = Processor