MCPcopy Index your code
hub / github.com/node-modules/utility / replace

Function replace

src/string.ts:37–42  ·  view source on GitHub ↗
(str: string, substr: string | RegExp, newSubstr: string | StringReplacer)

Source from the content-addressed store, hash-verified

35 * Replace string
36 */
37export function replace(str: string, substr: string | RegExp, newSubstr: string | StringReplacer) {
38 if (typeof newSubstr === 'string') {
39 return str.replace(substr, () => { return newSubstr; });
40 }
41 return str.replace(substr, newSubstr);
42}
43
44// original source https://github.com/nodejs/node/blob/v7.5.0/lib/_http_common.js#L300
45/**

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…