key.js 502 B

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