MCPcopy Index your code
hub / github.com/compat-table/compat-table / closestString

Function closestString

build.js:50–60  ·  view source on GitHub ↗
(possibilities, input)

Source from the content-addressed store, hash-verified

48};
49
50function closestString(possibilities, input) {
51 var closest;
52 for (var i = possibilities.length - 1, distance_min = Infinity; i >= 0; i--) {
53 var next_dist = fl.get(possibilities[i], input);
54 if (next_dist < distance_min) {
55 closest = possibilities[i];
56 distance_min = next_dist;
57 }
58 }
59 return closest;
60}
61
62// let prototypes declared below in this file be initialized
63process.nextTick(function () {

Callers 2

resultCellFunction · 0.85
dataToHtmlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected