Skip to main content
Module

x/rambda/source/replaceAll.js

Faster and smaller alternative to Ramda
Latest
File
import { curry } from './curry.js'import { ok } from './ok.js'
function replaceAllFn( patterns, replacer, input){ ok( patterns, replacer, input )( Array, String, String )
let text = input patterns.forEach(singlePattern => { text = text.replace(singlePattern, replacer) })
return text}
export const replaceAll = curry(replaceAllFn)