react-match-finder

Match finder is a function that takes in a search input and an array to search and returns an array of matches.

Usage no npm install needed!

<script type="module">
  import reactMatchFinder from 'https://cdn.skypack.dev/react-match-finder';
</script>

README

Usage

import getMatches from 'react-match-finder'

const array = ('test', ['test', 'testing', {name: 'test'}, [{name: 'testing'}], 'nothing here'], 50)
const searchInput = 'test'
// match percentage
const percentMatch = 50
const matches = getMatches('test', array, percentMatch) //  returns ['test', 'testing', {name: 'test'}, [{name: 'testing'}]]