source:
node_modules/es-toolkit/dist/compat/string/replace.mjs
| Last change on this file was a762898, checked in by , 5 months ago | |
|---|---|
|
|
| File size: 252 bytes | |
| Rev | Line | |
|---|---|---|
| [a762898] | 1 | import { toString } from '../util/toString.mjs'; |
| 2 | ||
| 3 | function replace(target, pattern, replacement) { | |
| 4 | if (arguments.length < 3) { | |
| 5 | return toString(target); | |
| 6 | } | |
| 7 | return toString(target).replace(pattern, replacement); | |
| 8 | } | |
| 9 | ||
| 10 | export { replace }; |
Note:
See TracBrowser
for help on using the repository browser.
