MCPcopy
hub / github.com/webpack/webpack / getWebpackRoot

Function getWebpackRoot

test/checkArrayExpectation.js:18–21  ·  view source on GitHub ↗
(testDirectory)

Source from the content-addressed store, hash-verified

16 * @returns {string} webpack root path, or empty string if not found
17 */
18const getWebpackRoot = (testDirectory) => {
19 const idx = testDirectory.lastIndexOf(`${path.sep}test${path.sep}`);
20 return idx !== -1 ? testDirectory.slice(0, idx) : "";
21};
22
23/**
24 * Replaces absolute paths in a string with stable placeholders

Callers 1

normalizeStringFunction · 0.85

Calls 1

sliceMethod · 0.80

Tested by

no test coverage detected