Skip to content

Commit 43e91ee

Browse files
refactor: code
1 parent f503815 commit 43e91ee

File tree

1 file changed

+24
-20
lines changed

1 file changed

+24
-20
lines changed

src/plugins/postcss-url-parser.js

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,15 @@ function visitor(result, parsedResults, node, key) {
107107
if (isUrlFunc.test(valueNode.value)) {
108108
needIgnore = getWebpackIgnoreCommentValue(index, valueNodes, inBetween);
109109

110-
if (isIgnoreOnDeclaration && needIgnore !== false) {
111-
return;
112-
}
110+
if (
111+
(isIgnoreOnDeclaration && typeof needIgnore === "undefined") ||
112+
needIgnore
113+
) {
114+
if (needIgnore) {
115+
// eslint-disable-next-line no-undefined
116+
needIgnore = undefined;
117+
}
113118

114-
if (needIgnore) {
115-
// eslint-disable-next-line no-undefined
116-
needIgnore = undefined;
117119
return;
118120
}
119121

@@ -145,14 +147,15 @@ function visitor(result, parsedResults, node, key) {
145147
valueNode.nodes
146148
);
147149

148-
if (isIgnoreOnDeclaration && needIgnore !== false) {
149-
// eslint-disable-next-line no-continue
150-
continue;
151-
}
150+
if (
151+
(isIgnoreOnDeclaration && typeof needIgnore === "undefined") ||
152+
needIgnore
153+
) {
154+
if (needIgnore) {
155+
// eslint-disable-next-line no-undefined
156+
needIgnore = undefined;
157+
}
152158

153-
if (needIgnore) {
154-
// eslint-disable-next-line no-undefined
155-
needIgnore = undefined;
156159
// eslint-disable-next-line no-continue
157160
continue;
158161
}
@@ -184,14 +187,15 @@ function visitor(result, parsedResults, node, key) {
184187
valueNode.nodes
185188
);
186189

187-
if (isIgnoreOnDeclaration && needIgnore !== false) {
188-
// eslint-disable-next-line no-continue
189-
continue;
190-
}
190+
if (
191+
(isIgnoreOnDeclaration && typeof needIgnore === "undefined") ||
192+
needIgnore
193+
) {
194+
if (needIgnore) {
195+
// eslint-disable-next-line no-undefined
196+
needIgnore = undefined;
197+
}
191198

192-
if (needIgnore) {
193-
// eslint-disable-next-line no-undefined
194-
needIgnore = undefined;
195199
// eslint-disable-next-line no-continue
196200
continue;
197201
}

0 commit comments

Comments
 (0)