combo-breaker
Break consecutive repetition of a string in Node.js and browsers.
Examples
var comboBreaker = redundant broken; redundant = 'I really really really really love pizza.'; broken = ;console; // "I really love pizza." broken = ;console; // "I really really love pizza."
API
comboBreaker(str, combo[, options])
Searches string str
for consecutive repetitions of combo
and returns a copy of str
with the repetitions replaced by a single combo
. Use options.keep
(integer
) to keep more than one (or no) combo
.
Install
Install with npm:
npm install combo-breaker
License
ISC