MCPcopy Create free account
hub / github.com/Rich-Harris/magic-string / replace

Method replace

src/MagicString.js:878–884  ·  view source on GitHub ↗
(searchValue, replacement)

Source from the content-addressed store, hash-verified

876 }
877
878 replace(searchValue, replacement) {
879 if (typeof searchValue === 'string') {
880 return this._replaceString(searchValue, replacement);
881 }
882
883 return this._replaceRegexp(searchValue, replacement);
884 }
885
886 _replaceAllString(string, replacement) {
887 const { original } = this;

Callers 9

indentMethod · 0.45
trimEndAbortedMethod · 0.45
trimStartAbortedMethod · 0.45
getReplacementMethod · 0.45
indentMethod · 0.45
trimStartMethod · 0.45
trimEndMethod · 0.45
trimEndMethod · 0.45
trimStartMethod · 0.45

Calls 2

_replaceStringMethod · 0.95
_replaceRegexpMethod · 0.95

Tested by

no test coverage detected