didyoumean 输入匹配
1、简介
JavaScript匹配引擎。
https://www.npmjs.com/package/didyoumean
2、示例
var input = 'insargrm'
var list = ['facebook', 'twitter', 'instagram', 'linkedin'];
console.log(didYouMean(input, list));
> 'instagram'
// The method matches 'insargrm' to 'instagram'.
input = 'google plus';
console.log(didYouMean(input, list));
> null
// The method was unable to find 'google plus' in the list of options.
作者:孟繁贵 Email:meng010387@126.com 期待共同进步!