(definitions, prefix)
| 866 | * @returns {void} |
| 867 | */ |
| 868 | const walkDefinitionsForValues = (definitions, prefix) => { |
| 869 | for (const key of Object.keys(definitions)) { |
| 870 | const code = definitions[key]; |
| 871 | const version = /** @type {string} */ (toCacheVersion(code)); |
| 872 | const name = VALUE_DEP_PREFIX + prefix + key; |
| 873 | mainHash.update(`|${prefix}${key}`); |
| 874 | const oldVersion = compilation.valueCacheVersions.get(name); |
| 875 | if (oldVersion === undefined) { |
| 876 | compilation.valueCacheVersions.set(name, version); |
| 877 | } else if (oldVersion !== version) { |
| 878 | const warning = new WebpackError( |
| 879 | `${PLUGIN_NAME}\nConflicting values for '${prefix + key}'` |
| 880 | ); |
| 881 | warning.details = `'${oldVersion}' !== '${version}'`; |
| 882 | warning.hideStack = true; |
| 883 | compilation.warnings.push(warning); |
| 884 | } |
| 885 | if (isObjectDefinition(code)) { |
| 886 | walkDefinitionsForValues( |
| 887 | /** @type {Definitions} */ (code), |
| 888 | `${prefix + key}.` |
| 889 | ); |
| 890 | } |
| 891 | } |
| 892 | }; |
| 893 | |
| 894 | /** |
| 895 | * Walk definitions for keys. |
nothing calls this directly
no test coverage detected