key.js 664 B

1234567891011121314151617181920212223
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var localforage_driver_commons_1 = require("localforage-driver-commons");
  4. function key(idx, callback) {
  5. var _this = this;
  6. var promise = this.ready().then(function () {
  7. var result;
  8. try {
  9. result = _this._dbInfo.mStore.key(idx);
  10. if (result === undefined) {
  11. result = null;
  12. }
  13. }
  14. catch (_a) {
  15. result = null;
  16. }
  17. return result;
  18. });
  19. localforage_driver_commons_1.executeCallback(promise, callback);
  20. return promise;
  21. }
  22. exports.key = key;
  23. //# sourceMappingURL=key.js.map