Skip to main content
Module

x/rambda/source/replace-spec.ts

Faster and smaller alternative to Ramda
Go to Latest
File
import {replace} from 'rambda'
const str = 'foo bar foo'const replacer = 'bar'
describe('R.replace', () => { it('happy', () => { const result = replace(/foo/g, replacer, str)
result // $ExpectType string }) it('with string as search pattern', () => { const result = replace('foo', replacer, str)
result // $ExpectType string })})
describe('R.replace - curried', () => { it('happy', () => { const result = replace(/foo/g, replacer)(str)
result // $ExpectType string }) it('with string as search pattern', () => { const result = replace('foo', replacer)(str)
result // $ExpectType string })})