docs: function typeaheadSimilarity(a, b) {
      var aLength = a.length;
      var bLength = b.length;
      var table = [];
  
      if (!aLength || !bLength) {
          return 0;
      }
  
      // Ensure `a` isn't shorter than `b`.
      if (aLength < bLength) {
          var _ref2 = [b, a];
          a = _ref2[0];
          b = _ref2[1];
      }
  
      // Early exit if `a` includes `b`; these will be scored higher than any
      // other options with the same `b` (filter string), with a preference for
      // shorter `a` strings (option labels).
      if (a.indexOf(b) !== -1) {
          return bLength + 1 / aLength;
      }
  
      // Initialize the table axes:
      //
      //    0 0 0 0 ... bLength
      //    0
      //    0
      //
      //   ...
      //
      // aLength
      //
      for (var x = 0; x <= aLength; ++x) {
          table[x] = [0];
      }
      for (var y = 0; y <= bLength; ++y) {
          table[0][y] = 0;
      }
  
      // Populate the rest of the table with a dynamic programming algorithm.
      for (var _x = 1; _x <= aLength; ++_x) {
          for (var _y = 1; _y <= bLength; ++_y) {
              table[_x][_y] = a[_x - 1] === b[_y - 1] ? 1 + table[_x - 1][_y - 1] : Math.max(table[_x][_y - 1], table[_x - 1][_y]);
          }
      }
  
      return table[aLength][bLength];
  }