MCPcopy
hub / github.com/webpack/webpack / extname

Function extname

lib/ManifestPlugin.js:35–43  ·  view source on GitHub ↗
(filename)

Source from the content-addressed store, hash-verified

33 * @returns {string} extname
34 */
35const extname = (filename) => {
36 const replaced = filename.replace(/\?.*/, "");
37 const split = replaced.split(".");
38 const last = split.pop();
39 if (!last) return "";
40 return last && /^(?:gz|br|map)$/i.test(last)
41 ? `${split.pop()}.${last}`
42 : last;
43};
44
45const DEFAULT_PREFIX = "[publicpath]";
46const DEFAULT_FILENAME = "manifest.json";

Callers 5

applyMethod · 0.85
interpolateFunction · 0.85
lookupFunction · 0.85
_getCacheKeyMethod · 0.85
applyMethod · 0.85

Calls 4

splitMethod · 0.80
popMethod · 0.80
replaceMethod · 0.45
testMethod · 0.45

Tested by

no test coverage detected