MCPcopy
hub / github.com/webpack/webpack / getBefore

Function getBefore

lib/ModuleFilenameHelpers.js:71–75  ·  view source on GitHub ↗
(strFn, token)

Source from the content-addressed store, hash-verified

69 * @returns {ReturnStringCallback} a function that returns the part of the string before the token
70 */
71const getBefore = (strFn, token) => () => {
72 const str = strFn();
73 const idx = str.lastIndexOf(token);
74 return idx < 0 ? "" : str.slice(0, idx);
75};
76
77/**
78 * Returns a function that returns a hash of the string

Callers 1

Calls 1

sliceMethod · 0.80

Tested by

no test coverage detected