Pass an array of options and an input string and get a suggestion and a completion string
$ npm install autocomplete-string
import autocomplete from 'autocomplete-string';
autocomplete('foo', ['hello', 'FoobaR', 'foobaz', 'world']);
/*
{
completion: 'baR',
suggestion: 'Foobar',
suggestionIndex: 1
}
*/
Returns the first path found (by respecting the order) or undefined
if none could be found.
Type: string
HeyHa
Type: array
Foobar
MIT © entwicklerstube