@@ -0,0 +1,1448 @@
+%0A/**%0A * Parse %60key%60 to valid range.%0A * https://developer.mozilla.org/en-US/docs/Web/API/IDBKeyRange%0A *%0A * Available options (inspired by mongodb):%0A *   gt: - greater%0A *   lt: - lighter%0A *   gte: - greater equal%0A *   lte: - lighter equal%0A *%0A * @param %7BObject%7D key%0A * @return %7BIDBKeyRange%7D%0A */%0A%0Amodule.exports = function parseRange(key) %7B%0A  var IDBKeyRange = keyRange();%0A  if (!key) return;%0A  if (key instanceof IDBKeyRange) return key;%0A  if (typeof key != 'object') return IDBKeyRange.only(key);%0A%0A  var keys = Object.keys(key).sort();%0A%0A  if (keys.length == 1) %7B%0A    var val = key%5Bkeys%5B0%5D%5D;%0A    switch (keys%5B0%5D) %7B%0A      case 'gt':  return IDBKeyRange.lowerBound(val, true);%0A      case 'lt':  return IDBKeyRange.upperBound(val, true);%0A      case 'gte': return IDBKeyRange.lowerBound(val);%0A      case 'lte': return IDBKeyRange.upperBound(val);%0A    %7D%0A  %7D else %7B%0A    var x = key%5Bkeys%5B0%5D%5D;%0A    var y = key%5Bkeys%5B1%5D%5D;%0A%0A    switch (keys%5B0%5D + '-' + keys%5B1%5D) %7B%0A      case 'gt-lt':   return IDBKeyRange.bound(x, y, true, true);%0A      case 'gt-lte':  return IDBKeyRange.bound(x, y, true, false);%0A      case 'gte-lt':  return IDBKeyRange.bound(x, y, false, true);%0A      case 'gte-lte': return IDBKeyRange.bound(x, y, false, false);%0A    %7D%0A  %7D%0A%7D;%0A%0A/**%0A * Dynamic link to %60window.IDBKeyRange%60 for dynamic polyfills.%0A *%0A * @return %7BIDBKeyRange%7D%0A */%0A%0Afunction keyRange() %7B%0A  return window.IDBKeyRange%0A      %7C%7C window.webkitIDBKeyRange%0A      %7C%7C window.msIDBKeyRange;%0A%7D%0A

copy parseRange implementation from treo