MCPcopy
hub / github.com/webpack/webpack / updateHashFromSource

Function updateHashFromSource

lib/util/source.js:74–82  ·  view source on GitHub ↗
(hash, source)

Source from the content-addressed store, hash-verified

72 * @returns {void}
73 */
74const updateHashFromSource = (hash, source) => {
75 // TODO webpack 6: drop the `buffers` check, require webpack-sources >= 3.4
76 // and call `source.buffers()` unconditionally.
77 if (typeof source.buffers === "function") {
78 for (const buf of source.buffers()) hash.update(buf);
79 } else {
80 hash.update(source.buffer());
81 }
82};
83
84module.exports.isSourceEqual = isSourceEqual;
85module.exports.updateHashFromSource = updateHashFromSource;

Callers 2

getFullContentHashMethod · 0.85
getLocalIdentFunction · 0.85

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected