npm.io
2.0.0 • Published 5 years ago

trim-repeated

Licence
MIT
Version
2.0.0
Deps
1
Size
3 kB
Vulns
0
Weekly
0
Stars
21

trim-repeated

Trim a consecutively repeated substring: foo--bar---bazfoo-bar-baz

Install

$ npm install trim-repeated

Usage

import trimRepeated from 'trim-repeated';

trimRepeated('foo--bar---baz', '-');
//=> 'foo-bar-baz'

trimRepeated('foo@#@#baz', '@#');
//=> 'foo@#baz'
trimRepeated(input, target)
input

Required
Type: string

target

Required
Type: string

Substring to trim.

Keywords