getItem.js 715 B

12345678910111213141516
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var localforage_driver_commons_1 = require("localforage-driver-commons");
  4. function getItem(key$, callback) {
  5. var _this = this;
  6. key$ = localforage_driver_commons_1.normaliseKey(key$);
  7. var promise = this.ready().then(function () {
  8. var result = _this._dbInfo.mStore.get(key$);
  9. // Deserialise if the result is not null or undefined
  10. return result == null ? null : _this._dbInfo.serializer.deserialize(result); //tslint:disable-line:triple-equals
  11. });
  12. localforage_driver_commons_1.executeCallback(promise, callback);
  13. return promise;
  14. }
  15. exports.getItem = getItem;
  16. //# sourceMappingURL=getItem.js.map