@andrei137/best-match
v0.0.2
Published
Finds the best match given a target and an array
Downloads
7
Readme
Finds the best match given a target and an array
import bestMatch from '@andrei137/best-match'
const target = "Blapshemous";
const options = [
{
"name": "Blasphemous",
"id": 1,
},
{
"name": "Blasphemous 2",
"id": 2,
},
];
const best = bestMatch(target, options, { field: "name" });