(range, warnStart, warnEnd)
| 1018 | * @returns {boolean} true when `webpackIgnore: true` |
| 1019 | */ |
| 1020 | const webpackIgnored = (range, warnStart, warnEnd) => { |
| 1021 | const { options, errors } = parseCommentOptions(range); |
| 1022 | if (errors) { |
| 1023 | for (const e of errors) { |
| 1024 | state.module.addWarning( |
| 1025 | new CommentCompilationWarning( |
| 1026 | `Compilation error while processing magic comment(-s): /*${e.comment.value}*/: ${e.message}`, |
| 1027 | rangeLoc(e.comment.range[0], e.comment.range[1]) |
| 1028 | ) |
| 1029 | ); |
| 1030 | } |
| 1031 | } |
| 1032 | if (options && options.webpackIgnore !== undefined) { |
| 1033 | if (typeof options.webpackIgnore !== "boolean") { |
| 1034 | // Loc is computed lazily here — it's only needed for this rare |
| 1035 | // warning, not on every checked `url()` / `@import`. |
| 1036 | state.module.addWarning( |
| 1037 | new UnsupportedFeatureWarning( |
| 1038 | `\`webpackIgnore\` expected a boolean, but received: ${options.webpackIgnore}.`, |
| 1039 | rangeLoc(warnStart, warnEnd) |
| 1040 | ) |
| 1041 | ); |
| 1042 | } else { |
| 1043 | return options.webpackIgnore; |
| 1044 | } |
| 1045 | } |
| 1046 | return false; |
| 1047 | }; |
| 1048 | |
| 1049 | // Closure-scope alias for `source` used by AST-walking helpers for substring extraction. |
| 1050 | const input = source; |
nothing calls this directly
no test coverage detected