Skip to content

Commit

Permalink
Merge pull request #1908 from ahmdammarr/refactor/safe-check-for-NoWo…
Browse files Browse the repository at this point in the history
…rkResult

refactor: check all falsy conditions of plugins and opts before returning NoWorkResult in process()
  • Loading branch information
ai committed Jan 4, 2024
2 parents c751e11 + c37346d commit f2e7a9f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/processor.js
Expand Up @@ -43,10 +43,10 @@ class Processor {

process(css, opts = {}) {
if (
this.plugins.length === 0 &&
typeof opts.parser === 'undefined' &&
typeof opts.stringifier === 'undefined' &&
typeof opts.syntax === 'undefined'
!this.plugins.length &&
!opts.parser &&
!opts.stringifier &&
!opts.syntax
) {
return new NoWorkResult(this, css, opts)
} else {
Expand Down

0 comments on commit f2e7a9f

Please sign in to comment.