MCPcopy
hub / github.com/webpack/webpack / replaceClose

Function replaceClose

lib/cli.js:869–877  ·  view source on GitHub ↗
(
	index,
	string,
	close,
	replace,
	head = string.slice(0, Math.max(0, index)) + replace,
	tail = string.slice(Math.max(0, index + close.length)),
	next = tail.indexOf(close)
)

Source from the content-addressed store, hash-verified

867 * @returns {string} result
868 */
869const replaceClose = (
870 index,
871 string,
872 close,
873 replace,
874 head = string.slice(0, Math.max(0, index)) + replace,
875 tail = string.slice(Math.max(0, index + close.length)),
876 next = tail.indexOf(close)
877) => head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
878
879/**
880 * Returns result.

Callers 1

clearBleedFunction · 0.85

Calls 1

sliceMethod · 0.80

Tested by

no test coverage detected