MCPcopy Create free account
hub / github.com/webpack/css-loader / getWebpackIgnoreCommentValue

Function getWebpackIgnoreCommentValue

src/plugins/postcss-url-parser.js:19–48  ·  view source on GitHub ↗
(index, nodes, inBetween)

Source from the content-addressed store, hash-verified

17}
18
19function getWebpackIgnoreCommentValue(index, nodes, inBetween) {
20 if (index === 0 && typeof inBetween !== "undefined") {
21 return inBetween;
22 }
23
24 let prevValueNode = nodes[index - 1];
25
26 if (!prevValueNode) {
27 // eslint-disable-next-line consistent-return
28 return;
29 }
30
31 if (prevValueNode.type === "space") {
32 if (!nodes[index - 2]) {
33 // eslint-disable-next-line consistent-return
34 return;
35 }
36
37 prevValueNode = nodes[index - 2];
38 }
39
40 if (prevValueNode.type !== "comment") {
41 // eslint-disable-next-line consistent-return
42 return;
43 }
44
45 const matched = prevValueNode.value.match(WEBPACK_IGNORE_COMMENT_REGEXP);
46
47 return matched && matched[2] === "true";
48}
49
50function shouldHandleURL(url, declaration, result, options) {
51 if (url.length === 0) {

Callers 1

parseDeclarationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…