kentcdodds / match-sorter

Simple, expected, and deterministic best-match sorting of an array in JavaScript
https://npm.im/match-sorter
MIT License
3.73k stars 129 forks source link

fix: :bug: TypeError #117

Closed PhilGarb closed 3 years ago

PhilGarb commented 3 years ago

What: Fix Type Error

Why: Please see issue for a description of this pull request. => #116

How: When providing keys to the options object the expected type is string. Working with nested arrays in objects does however require mapping over the nested array to produce the strings that should be matched. This fixes a TypeError that expected all the keys to be of type string, by creating a Union Type with type Array.

Checklist:

codecov[bot] commented 3 years ago

Codecov Report

Merging #117 (fd36288) into master (e4f32d5) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #117   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines          137       137           
  Branches        31        31           
=========================================
  Hits           137       137           
Impacted Files Coverage Δ
src/index.ts 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e4f32d5...fd36288. Read the comment docs.

kentcdodds commented 3 years ago

@all-contributors please add @PhilGarb for code

allcontributors[bot] commented 3 years ago

@kentcdodds

I've put up a pull request to add @PhilGarb! :tada:

github-actions[bot] commented 3 years ago

:tada: This PR is included in version 6.0.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: