is-repeated

Check if a string has consecutive characters

Usage no npm install needed!

<script type="module">
  import isRepeated from 'https://cdn.skypack.dev/is-repeated';
</script>

README

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

Related

Support