Socket
Socket
Sign inDemoInstall

locale-includes

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    locale-includes

String.prototype.includes() but using localeCompare.


Version published
Weekly downloads
629
increased by7.16%
Maintainers
1
Install size
5.61 kB
Created
Weekly downloads
 

Readme

Source

localeIncludes()

npm npm bundle size (minified)

String.prototype.includes() but using localeCompare.

Install

npm i locale-includes

Syntax

localeIncludes(string, searchString[, options])

Parameters

  • string (string)
    A string to be searched within.

  • searchString (string)
    A string to be searched for within string.

  • options (object) - Optional
    An object with some or all of the following properties:

Return value

  • (bool)
    Whether the search string is found anywhere within the given string or not.

Examples

import {localeIncludes} from `locale-includes`;

localeIncludes("Abcdef", "cde");
// true

localeIncludes("Abcdef", "cde", {position: 3});
// false

localeIncludes("àḃḉdÉf", "bCde", {usage: "search", sensitivity: "base"});
// true

See also

String.prototype.includes()
String.prototype.localeCompare()

Keywords

FAQs

Last updated on 18 Nov 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc