MCPcopy
hub / github.com/webpack/webpack / fakeHash

Function fakeHash

test/nonNumericOnlyHash.unittest.js:37–40  ·  view source on GitHub ↗
(/** @type {string} */ value)

Source from the content-addressed store, hash-verified

35
36describe("nonNumericOnlyHash.digestNonNumericOnly", () => {
37 const fakeHash = (/** @type {string} */ value) =>
38 /** @type {EXPECTED_ANY} */ ({
39 digest: (/** @type {string} */ encoding) => `${value}:${encoding}`
40 });
41
42 it("digests then truncates with a non-numeric first char", () => {
43 expect(digestNonNumericOnly(fakeHash("abcdef"), "hex", 3)).toBe("abc");

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected