* @param {Module} rootModule the root module of the concatenation * @param {Set<Module>} modules all modules in the concatenation (including the root module) * @param {AssociatedObjectForCache=} associatedObjectForCache object for caching * @param {HashFunction=} hashFunction hash function to
( rootModule, modules, associatedObjectForCache, hashFunction = DEFAULTS.HASH_FUNCTION )
| 1349 | * @returns {string} the identifier |
| 1350 | */ |
| 1351 | static _createIdentifier( |
| 1352 | rootModule, |
| 1353 | modules, |
| 1354 | associatedObjectForCache, |
| 1355 | hashFunction = DEFAULTS.HASH_FUNCTION |
| 1356 | ) { |
| 1357 | const cachedMakePathsRelative = makePathsRelative.bindContextCache( |
| 1358 | /** @type {string} */ (rootModule.context), |
| 1359 | associatedObjectForCache |
| 1360 | ); |
| 1361 | /** @type {string[]} */ |
| 1362 | const identifiers = []; |
| 1363 | for (const module of modules) { |
| 1364 | identifiers.push(cachedMakePathsRelative(module.identifier())); |
| 1365 | } |
| 1366 | identifiers.sort(); |
| 1367 | const hash = createHash(hashFunction); |
| 1368 | hash.update(identifiers.join(" ")); |
| 1369 | return `${rootModule.identifier()}|${hash.digest("hex")}`; |
| 1370 | } |
| 1371 | |
| 1372 | /** |
| 1373 | * Adds the provided file dependencies to the module. |
no test coverage detected