MCPcopy
hub / github.com/webpack/webpack / shortenLongString

Function shortenLongString

lib/ids/IdHelpers.js:72–79  ·  view source on GitHub ↗
(string, delimiter, hashFunction)

Source from the content-addressed store, hash-verified

70 * @returns {string} string with limited max length to 100 chars
71 */
72const shortenLongString = (string, delimiter, hashFunction) => {
73 if (string.length < 100) return string;
74 return (
75 string.slice(0, 100 - 6 - delimiter.length) +
76 delimiter +
77 getHash(string, 6, hashFunction)
78 );
79};
80
81/**
82 * Gets short module name.

Callers 2

getShortChunkNameFunction · 0.85
getLongChunkNameFunction · 0.85

Calls 2

sliceMethod · 0.80
getHashFunction · 0.70

Tested by

no test coverage detected