New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

index-of-any

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

index-of-any

Like string indexOf with multiple search strings

  • 1.4.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-53.85%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

FAQs

Package last updated on 19 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc