(declaration, key, result, options)
| 60 | } |
| 61 | |
| 62 | function parseDeclaration(declaration, key, result, options) { |
| 63 | if (!needParseDeclaration.test(declaration[key])) { |
| 64 | return; |
| 65 | } |
| 66 | |
| 67 | const parsed = valueParser( |
| 68 | declaration.raws && declaration.raws.value && declaration.raws.value.raw |
| 69 | ? declaration.raws.value.raw |
| 70 | : declaration[key], |
| 71 | ); |
| 72 | |
| 73 | let inBetween; |
| 74 | |
| 75 | if (declaration.raws && declaration.raws.between) { |
| 76 | const lastCommentIndex = declaration.raws.between.lastIndexOf("/*"); |
| 77 | |
| 78 | const matched = declaration.raws.between |
| 79 | .slice(lastCommentIndex) |
| 80 | .match(WEBPACK_IGNORE_COMMENT_REGEXP); |
| 81 | |
| 82 | if (matched) { |
| 83 | inBetween = matched[2] === "true"; |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | let isIgnoreOnDeclaration = false; |
| 88 | |
| 89 | const prevNode = declaration.prev(); |
| 90 | |
| 91 | if (prevNode && prevNode.type === "comment") { |
| 92 | const matched = prevNode.text.match(WEBPACK_IGNORE_COMMENT_REGEXP); |
| 93 | |
| 94 | if (matched) { |
| 95 | isIgnoreOnDeclaration = matched[2] === "true"; |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | let needIgnore; |
| 100 | |
| 101 | const parsedURLs = []; |
| 102 | |
| 103 | parsed.walk((valueNode, index, valueNodes) => { |
| 104 | if (valueNode.type !== "function") { |
| 105 | return; |
| 106 | } |
| 107 | |
| 108 | if (isUrlFunc.test(valueNode.value)) { |
| 109 | needIgnore = getWebpackIgnoreCommentValue(index, valueNodes, inBetween); |
| 110 | |
| 111 | if ( |
| 112 | (isIgnoreOnDeclaration && typeof needIgnore === "undefined") || |
| 113 | needIgnore |
| 114 | ) { |
| 115 | if (needIgnore) { |
| 116 | // eslint-disable-next-line no-undefined |
| 117 | needIgnore = undefined; |
| 118 | } |
| 119 |
no test coverage detected
searching dependent graphs…