(hash, source)
| 72 | * @returns {void} |
| 73 | */ |
| 74 | const 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 | |
| 84 | module.exports.isSourceEqual = isSourceEqual; |
| 85 | module.exports.updateHashFromSource = updateHashFromSource; |
no test coverage detected