Find the closest match for a string from an array of matches, using string distance.
$ component install ianstormtaylor/closest-match
var closest = require('closest-match');
var animals = ['dog', 'cat', 'bird'];
closest('dag', animals); // 'dog'
Match the given string
against an array of possible matches
.
Change the string distance threshold
used to match. Default is 3
.
Change the distancing method. Default is the timoxley/sift
component.
MIT