key.js 534 B

1234567891011121314151617181920
  1. import { executeCallback } from 'localforage-driver-commons';
  2. export function key(idx, callback) {
  3. var _this = this;
  4. var promise = this.ready().then(function () {
  5. var result;
  6. try {
  7. result = _this._dbInfo.mStore.key(idx);
  8. if (result === undefined) {
  9. result = null;
  10. }
  11. }
  12. catch (_a) {
  13. result = null;
  14. }
  15. return result;
  16. });
  17. executeCallback(promise, callback);
  18. return promise;
  19. }
  20. //# sourceMappingURL=key.js.map