1.4.5 • Published 2 years ago

index-of-any v1.4.5

Weekly downloads
10
License
MIT
Repository
github
Last release
2 years ago

index-of-any

  • Like string indexOf with multiple search strings

Build Status Codacy Badge code style: prettier Coverage Status David GitHub npm

Installation

npm install index-of-any

Usage

Search strings

import indexOfAny from "index-of-any";

const searchStrings = ["first", "second", "third"];

const [index, searchString] = indexOfAny("a string containing second search string");

==> [20, "second"]

Search arrays

import indexOfAny from "index-of-any";

const strings = ["first", "second", "third"];

const [index, searchString] = indexOfAny(strings, "second");

==> [2, "second"]

Test

npm test
1.4.5

2 years ago

1.4.4

3 years ago

1.4.3

3 years ago

1.4.2

3 years ago

1.4.0

4 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.0

6 years ago

1.0.0

6 years ago