1.1.0 • Published 2 years ago

accent-insensitive-search v1.1.0

Weekly downloads
140
License
ISC
Repository
github
Last release
2 years ago

accent-insensitive-search

Javascript plugin to perform an accent-insensitive-search

Installation

npm install accent-insensitive-search

Usage

import accentInsensitiveSearch from 'accent-insensitive-search';

accentInsensitiveSearch(value, searchIn);

accentInsensitiveSearch(value, searchIn) returns true if value is in searchIn (case and accent insensitive), and false else.

Options

accentInsensitiveSearch(value, searchIn, options);

options can be on the form:

{
  startWith: boolean,
  endWith: boolean,
}

The option startWith: true can be used if you only want to find strings starting with the search value. Otherwise, with the default option startWith: false you find strings containing the search value.

The option endWith: true can be used if you only want to find strings ending with the search value. Otherwise, with the default option endWith: false you find strings containing the search value.

Accent mapping

The accent mapping is defined in the file accent-map.js. This is an objet of the form { special_char: replacements }, replacements can either be a string or an array of strings.

Example: { 'é': 'e', 'ü': ['u', 'ue']}.

If you want a mapping to be added, free to you to open an issue or contribute.

1.1.0

2 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago