Skip to content

Commit

Permalink
Simplify newline node condition with includes
Browse files Browse the repository at this point in the history
  • Loading branch information
Siilwyn committed Sep 6, 2021
1 parent 1702a4e commit 528be4a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function processCss ({ css, comparator }) {

if (type === 'comment') {
// Don't do anything to root comments or the last newline comment
const isNewlineNode = node.raws.before && ~node.raws.before.indexOf('\n');
const isNewlineNode = node.raws.before.includes('\n');
const lastNewlineNode = isNewlineNode && !node.next();
const onlyNode = !node.prev() && !node.next();

Expand Down

0 comments on commit 528be4a

Please sign in to comment.