Package Exports
- locale-includes
- locale-includes/lib/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (locale-includes) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
localeIncludes()
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 withinstring
.options
(object) - Optional
An object with some or all of the following properties:position
(number) - Default: 0
The position withinstring
at which to begin searching forsearchString
.locales
(string|array)
Passed through as thelocales
parameter toString.prototype.localeCompare()
.Any other property
Passed through in theoptions
parameter toString.prototype.localeCompare()
.
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