1.4.5 • Published 11 months ago

index-of-any v1.4.5

Weekly downloads
10
License
MIT
Repository
github
Last release
11 months 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

11 months ago

1.4.4

2 years ago

1.4.3

2 years ago

1.4.2

2 years ago

1.4.0

3 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

5 years ago

1.0.0

5 years ago