README
is-repeated
Check if a string has consecutive characters
Install
$ npm install is-repeated
Usage
const isRepeated = require('is-repeated')
isRepeated('foo-bar---baz','-')
//=> true
isRepeated('-bar-', '-'));
//=> false
isRepeated('foo@#@#baz', '@#');
//=> true
isRepeated('baAr', 'a', {ignoreCase: true});
//=> true
API
isRepeated(input, target, options?)
input
Required
Type: string
target
Required
Type: string
subtring to run the test against.
options
ignoreCase
Type: boolean
Default: false
Related
trim-repeated
- Trim a consecutively repeated substring