Skip to content

Commit

Permalink
chore: reformat README.md with latest Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
loilo committed Feb 3, 2025
1 parent 47ded8b commit ee43909
Showing 1 changed file with 43 additions and 43 deletions.
86 changes: 43 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ Check out their [demo](https://fusejs.io/demo.html) and [examples](https://fusej

**Table of Contents:**

- [Installation](#installation)
- [Usage](#usage)
- [Options](#options)
- [Methods](#methods)
- [Differences with Fuse.js](#differences-with-fusejs)
- [Development](#development)
- [Installation](#installation)
- [Usage](#usage)
- [Options](#options)
- [Methods](#methods)
- [Differences with Fuse.js](#differences-with-fusejs)
- [Development](#development)

---

Expand Down Expand Up @@ -107,8 +107,8 @@ Fuse has a lot of options to refine your search:

#### `isCaseSensitive`

- Type: `bool`
- Default: `false`
- Type: `bool`
- Default: `false`

Indicates whether comparisons should be case sensitive.

Expand All @@ -125,53 +125,53 @@ Indicates whether comparisons should ignore diacritics (accents).

#### `includeScore`

- Type: `bool`
- Default: `false`
- Type: `bool`
- Default: `false`

Whether the score should be included in the result set. A score of `0` indicates a perfect match, while a score of `1` indicates a complete mismatch.

---

#### `includeMatches`

- Type: `bool`
- Default: `false`
- Type: `bool`
- Default: `false`

Whether the matches should be included in the result set. When `true`, each record in the result set will include the indices of the matched characters. These can consequently be used for highlighting purposes.

---

#### `minMatchCharLength`

- Type: `int`
- Default: `1`
- Type: `int`
- Default: `1`

Only the matches whose length exceeds this value will be returned. (For instance, if you want to ignore single character matches in the result, set it to `2`).

---

#### `shouldSort`

- Type: `bool`
- Default: `true`
- Type: `bool`
- Default: `true`

Whether to sort the result list, by score.

---

#### `findAllMatches`

- Type: `bool`
- Default: `false`
- Type: `bool`
- Default: `false`

When true, the matching function will continue to the end of a search pattern even if a perfect match has already been located in the string.

---

#### `keys`

- Type: `array`
- Default: `[]`
- Type: `array`
- Default: `[]`

List of keys that will be searched. This supports nested paths, weighted search, searching in arrays of [strings](https://fusejs.io/examples.html#search-string-array) and [objects](https://fusejs.io/examples.html#nested-search).

Expand All @@ -181,35 +181,35 @@ List of keys that will be searched. This supports nested paths, weighted search,

#### `location`

- Type: `int`
- Default: `0`
- Type: `int`
- Default: `0`

Determines approximately where in the text is the pattern expected to be found.

---

#### `threshold`

- Type: `float`
- Default: `0.6`
- Type: `float`
- Default: `0.6`

At what point does the match algorithm give up. A threshold of `0.0` requires a perfect match (of both letters and location), a threshold of `1.0` would match anything.

---

#### `distance`

- Type: `int`
- Default: `100`
- Type: `int`
- Default: `100`

Determines how close the match must be to the fuzzy location (specified by `location`). An exact letter match which is `distance` characters away from the fuzzy location would score as a complete mismatch. A `distance` of `0` requires the match be at the exact `location` specified. A distance of `1000` would require a perfect match to be within `800` characters of the `location` to be found using a `threshold` of `0.8`.

---

#### `ignoreLocation`

- Type: `bool`
- Default: `false`
- Type: `bool`
- Default: `false`

When `true`, search will ignore `location` and `distance`, so it won't matter where in the string the pattern appears.

Expand All @@ -223,35 +223,35 @@ When `true`, search will ignore `location` and `distance`, so it won't matter wh

#### `useExtendedSearch`

- Type: `bool`
- Default: `false`
- Type: `bool`
- Default: `false`

When `true`, it enables the use of unix-like search commands. See [example](https://fusejs.io/examples.html#extended-search).

---

#### `getFn`

- Type: `callable`
- Default: [source](src/Helpers/get.php)
- Type: `callable`
- Default: [source](src/Helpers/get.php)

The function to use to retrieve an object's value at the provided path. The default will also search nested paths.

---

#### `sortFn`

- Type: `callable`
- Default: [source](src/Helpers/sort.php)
- Type: `callable`
- Default: [source](src/Helpers/sort.php)

The function to use to sort all the results. The default will sort by ascending relevance score, ascending index.

---

#### `ignoreFieldNorm`

- Type: `bool`
- Default: `false`
- Type: `bool`
- Default: `false`

When `true`, the calculation for the relevance score (used for sorting) will ignore the [field-length norm](https://fusejs.io/concepts/scoring-theory.html#fuzziness-score).

Expand All @@ -261,8 +261,8 @@ When `true`, the calculation for the relevance score (used for sorting) will ign
### `fieldNormWeight`

- Type: `float`
- Default: `1`
- Type: `float`
- Default: `1`

Determines how much the [field-length norm](https://fusejs.io/concepts/scoring-theory.html#field-length-norm) affects scoring. A value of `0` is equivalent to ignoring the field-length norm. A value of `0.5` will greatly reduce the effect of field-length norm, while a value of `2.0` will greatly increase it.

Expand Down Expand Up @@ -302,14 +302,14 @@ public function search(mixed $pattern, ?array $options): array

The `$pattern` can be one of:

- [String](https://fusejs.io/examples.html#search-string-array)
- [Path](https://fusejs.io/examples.html#nested-search)
- [Extended query](https://fusejs.io/examples.html#extended-search)
- [Logical query](https://fusejs.io/api/query.html)
- [String](https://fusejs.io/examples.html#search-string-array)
- [Path](https://fusejs.io/examples.html#nested-search)
- [Extended query](https://fusejs.io/examples.html#extended-search)
- [Logical query](https://fusejs.io/api/query.html)

The `$options`:

- `limit` (type: `int`): Denotes the max number of returned search results.
- `limit` (type: `int`): Denotes the max number of returned search results.

---

Expand Down

0 comments on commit ee43909

Please sign in to comment.