cista-storage/node_modules/locale-includes
2023-11-02 17:37:28 +00:00
..
lib Add support for actual renaming of files, and UI on plain tree. 2023-11-02 17:37:28 +00:00
LICENSE Add support for actual renaming of files, and UI on plain tree. 2023-11-02 17:37:28 +00:00
package.json Add support for actual renaming of files, and UI on plain tree. 2023-11-02 17:37:28 +00:00
README.md Add support for actual renaming of files, and UI on plain tree. 2023-11-02 17:37:28 +00:00

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()