"use strict";var o={compareTwoStrings:g,findBestMatch:c};function g(r,t){if(r=r.replace(/\s+/g,""),t=t.replace(/\s+/g,""),r===t)return 1;if(r.length<2||t.length<2)return 0;let e=new Map;for(let s=0;s<r.length-1;s++){const n=r.substring(s,s+2),i=e.has(n)?e.get(n)+1:1;e.set(n,i)}let a=0;for(let s=0;s<t.length-1;s++){const n=t.substring(s,s+2),i=e.has(n)?e.get(n):0;i>0&&(e.set(n,i-1),a++)}return 2*a/(r.length+t.length-2)}function c(r,t){if(!l(r,t))throw new Error("Bad arguments: First argument should be a string, second should be an array of strings");const e=[];let a=0;for(let n=0;n<t.length;n++){const i=t[n],u=g(r,i);e.push({target:i,rating:u}),u>e[a].rating&&(a=n)}const s=e[a];return{ratings:e,bestMatch:s,bestMatchIndex:a}}function l(r,t){return!(typeof r!="string"||!Array.isArray(t)||!t.length||t.find(function(e){return typeof e!="string"}))}module.exports=o;
//# sourceMappingURL=index.js.map
