(str: string, substr: string | RegExp, newSubstr: string | StringReplacer)
| 35 | * Replace string |
| 36 | */ |
| 37 | export 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 | /** |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…