npm.io
1.0.0 • Published 5 years ago

is-repeated

Licence
MIT
Version
1.0.0
Deps
1
Size
4 kB
Vulns
0
Weekly
0
Stars
1

is-repeated build license

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

Support

Keywords