chain-replace
To install:
npm install @karmaniverous/chain-replace
To import:
import { chainReplace } from '@karmaniverous/chain-replace`;
See tests for examples of usage!
API Documentation
string
chainReplace(input, [replacements]) ⇒ Apply a chain of replacements to a string.
Kind: global function
Returns: string
- String result of chained replacements.
Param | Type | Description |
---|---|---|
input | string |
Input string. |
[replacements] | Array.<Array.<(string|Object), string>> |
Replacements array of [pattern: string|RegExp, replacement: string]. |
See more great templates and other tools on my GitHub Profile!