Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 840 Bytes

README.md

File metadata and controls

19 lines (14 loc) · 840 Bytes

Mapped Replace

build status Coverage Status npm version

Given a string and an object, will replace all the keys of the object found in the string with the values of the object. TypeScript definitions are shipped with the package.

Examples

mappedReplace('test string', {}) // -> 'test string'

mappedReplace('foo', { 'foo': 'bar' }) // -> 'bar'

mappedReplace('foo bar baz', {
    'foo': 'a',
    'bar': 'b',
    'baz': 'c'
}) // -> 'a b c'

mappedReplace('hello', { 'l': 'w', 'o': 'o uwu' }) // -> 'hewwo uwu'