UNPKG

30.6 kBJavaScriptView Raw
1"use strict";
2// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3// SPDX-License-Identifier: Apache-2.0
4Object.defineProperty(exports, "__esModule", { value: true });
5var tslib_1 = require("tslib");
6var core_1 = require("@aws-amplify/core");
7var async_storage_1 = tslib_1.__importDefault(require("@react-native-async-storage/async-storage"));
8exports.AsyncStorage = async_storage_1.default;
9var StorageCache_1 = require("./StorageCache");
10var Utils_1 = require("./Utils");
11var logger = new core_1.ConsoleLogger('AsyncStorageCache');
12/*
13 * Customized cache which based on the AsyncStorage with LRU implemented
14 */
15var AsyncStorageCache = /** @class */ (function (_super) {
16 tslib_1.__extends(AsyncStorageCache, _super);
17 /**
18 * initialize the cache
19 *
20 * @param {Object} config - the configuration of the cache
21 */
22 function AsyncStorageCache(config) {
23 var _this = this;
24 var cache_config = config
25 ? Object.assign({}, Utils_1.defaultConfig, config)
26 : Utils_1.defaultConfig;
27 _this = _super.call(this, cache_config) || this;
28 _this.getItem = _this.getItem.bind(_this);
29 _this.setItem = _this.setItem.bind(_this);
30 _this.removeItem = _this.removeItem.bind(_this);
31 logger.debug('Using AsyncStorageCache');
32 return _this;
33 }
34 /**
35 * decrease current size of the cache
36 * @private
37 * @param amount - the amount of the cache size which needs to be decreased
38 */
39 AsyncStorageCache.prototype._decreaseCurSizeInBytes = function (amount) {
40 return tslib_1.__awaiter(this, void 0, void 0, function () {
41 var curSize;
42 return tslib_1.__generator(this, function (_a) {
43 switch (_a.label) {
44 case 0: return [4 /*yield*/, this.getCacheCurSize()];
45 case 1:
46 curSize = _a.sent();
47 return [4 /*yield*/, async_storage_1.default.setItem(this.cacheCurSizeKey, (curSize - amount).toString())];
48 case 2:
49 _a.sent();
50 return [2 /*return*/];
51 }
52 });
53 });
54 };
55 /**
56 * increase current size of the cache
57 * @private
58 * @param amount - the amount of the cache szie which need to be increased
59 */
60 AsyncStorageCache.prototype._increaseCurSizeInBytes = function (amount) {
61 return tslib_1.__awaiter(this, void 0, void 0, function () {
62 var curSize;
63 return tslib_1.__generator(this, function (_a) {
64 switch (_a.label) {
65 case 0: return [4 /*yield*/, this.getCacheCurSize()];
66 case 1:
67 curSize = _a.sent();
68 return [4 /*yield*/, async_storage_1.default.setItem(this.cacheCurSizeKey, (curSize + amount).toString())];
69 case 2:
70 _a.sent();
71 return [2 /*return*/];
72 }
73 });
74 });
75 };
76 /**
77 * update the visited time if item has been visited
78 * @private
79 * @param item - the item which need to be refreshed
80 * @param prefixedKey - the key of the item
81 *
82 * @return the refreshed item
83 */
84 AsyncStorageCache.prototype._refreshItem = function (item, prefixedKey) {
85 return tslib_1.__awaiter(this, void 0, void 0, function () {
86 return tslib_1.__generator(this, function (_a) {
87 switch (_a.label) {
88 case 0:
89 item.visitedTime = Utils_1.getCurrTime();
90 return [4 /*yield*/, async_storage_1.default.setItem(prefixedKey, JSON.stringify(item))];
91 case 1:
92 _a.sent();
93 return [2 /*return*/, item];
94 }
95 });
96 });
97 };
98 /**
99 * check wether item is expired
100 * @private
101 * @param key - the key of the item
102 *
103 * @return true if the item is expired.
104 */
105 AsyncStorageCache.prototype._isExpired = function (key) {
106 return tslib_1.__awaiter(this, void 0, void 0, function () {
107 var text, item;
108 return tslib_1.__generator(this, function (_a) {
109 switch (_a.label) {
110 case 0: return [4 /*yield*/, async_storage_1.default.getItem(key)];
111 case 1:
112 text = _a.sent();
113 item = JSON.parse(text);
114 if (Utils_1.getCurrTime() >= item.expires) {
115 return [2 /*return*/, true];
116 }
117 return [2 /*return*/, false];
118 }
119 });
120 });
121 };
122 /**
123 * delete item from cache
124 * @private
125 * @param prefixedKey - the key of the item
126 * @param size - optional, the byte size of the item
127 */
128 AsyncStorageCache.prototype._removeItem = function (prefixedKey, size) {
129 return tslib_1.__awaiter(this, void 0, void 0, function () {
130 var itemSize, _a, _b, _c, removeItemError_1;
131 return tslib_1.__generator(this, function (_d) {
132 switch (_d.label) {
133 case 0:
134 if (!size) return [3 /*break*/, 1];
135 _a = size;
136 return [3 /*break*/, 3];
137 case 1:
138 _c = (_b = JSON).parse;
139 return [4 /*yield*/, async_storage_1.default.getItem(prefixedKey)];
140 case 2:
141 _a = _c.apply(_b, [_d.sent()]).byteSize;
142 _d.label = 3;
143 case 3:
144 itemSize = _a;
145 // first try to update the current size of the cache
146 return [4 /*yield*/, this._decreaseCurSizeInBytes(itemSize)];
147 case 4:
148 // first try to update the current size of the cache
149 _d.sent();
150 _d.label = 5;
151 case 5:
152 _d.trys.push([5, 7, , 9]);
153 return [4 /*yield*/, async_storage_1.default.removeItem(prefixedKey)];
154 case 6:
155 _d.sent();
156 return [3 /*break*/, 9];
157 case 7:
158 removeItemError_1 = _d.sent();
159 // if some error happened, we need to rollback the current size
160 return [4 /*yield*/, this._increaseCurSizeInBytes(itemSize)];
161 case 8:
162 // if some error happened, we need to rollback the current size
163 _d.sent();
164 logger.error("Failed to remove item: " + removeItemError_1);
165 return [3 /*break*/, 9];
166 case 9: return [2 /*return*/];
167 }
168 });
169 });
170 };
171 /**
172 * put item into cache
173 * @private
174 * @param prefixedKey - the key of the item
175 * @param itemData - the value of the item
176 * @param itemSizeInBytes - the byte size of the item
177 */
178 AsyncStorageCache.prototype._setItem = function (prefixedKey, item) {
179 return tslib_1.__awaiter(this, void 0, void 0, function () {
180 var setItemErr_1;
181 return tslib_1.__generator(this, function (_a) {
182 switch (_a.label) {
183 case 0:
184 // first try to update the current size of the cache.
185 return [4 /*yield*/, this._increaseCurSizeInBytes(item.byteSize)];
186 case 1:
187 // first try to update the current size of the cache.
188 _a.sent();
189 _a.label = 2;
190 case 2:
191 _a.trys.push([2, 4, , 6]);
192 return [4 /*yield*/, async_storage_1.default.setItem(prefixedKey, JSON.stringify(item))];
193 case 3:
194 _a.sent();
195 return [3 /*break*/, 6];
196 case 4:
197 setItemErr_1 = _a.sent();
198 // if some error happened, we need to rollback the current size
199 return [4 /*yield*/, this._decreaseCurSizeInBytes(item.byteSize)];
200 case 5:
201 // if some error happened, we need to rollback the current size
202 _a.sent();
203 logger.error("Failed to set item " + setItemErr_1);
204 return [3 /*break*/, 6];
205 case 6: return [2 /*return*/];
206 }
207 });
208 });
209 };
210 /**
211 * total space needed when poping out items
212 * @private
213 * @param itemSize
214 *
215 * @return total space needed
216 */
217 AsyncStorageCache.prototype._sizeToPop = function (itemSize) {
218 return tslib_1.__awaiter(this, void 0, void 0, function () {
219 var spaceItemNeed, cacheThresholdSpace;
220 return tslib_1.__generator(this, function (_a) {
221 switch (_a.label) {
222 case 0: return [4 /*yield*/, this.getCacheCurSize()];
223 case 1:
224 spaceItemNeed = (_a.sent()) + itemSize - this.config.capacityInBytes;
225 cacheThresholdSpace = (1 - this.config.warningThreshold) * this.config.capacityInBytes;
226 return [2 /*return*/, spaceItemNeed > cacheThresholdSpace
227 ? spaceItemNeed
228 : cacheThresholdSpace];
229 }
230 });
231 });
232 };
233 /**
234 * see whether cache is full
235 * @private
236 * @param itemSize
237 *
238 * @return true if cache is full
239 */
240 AsyncStorageCache.prototype._isCacheFull = function (itemSize) {
241 return tslib_1.__awaiter(this, void 0, void 0, function () {
242 var _a;
243 return tslib_1.__generator(this, function (_b) {
244 switch (_b.label) {
245 case 0:
246 _a = itemSize;
247 return [4 /*yield*/, this.getCacheCurSize()];
248 case 1: return [2 /*return*/, (_a + (_b.sent()) > this.config.capacityInBytes)];
249 }
250 });
251 });
252 };
253 /**
254 * scan the storage and find out all the keys owned by this cache
255 * also clean the expired keys while scanning
256 * @private
257 * @return array of keys
258 */
259 AsyncStorageCache.prototype._findValidKeys = function () {
260 return tslib_1.__awaiter(this, void 0, void 0, function () {
261 var keys, keyInCache, i, key;
262 return tslib_1.__generator(this, function (_a) {
263 switch (_a.label) {
264 case 0:
265 keys = [];
266 keyInCache = [];
267 return [4 /*yield*/, async_storage_1.default.getAllKeys()];
268 case 1:
269 keyInCache = _a.sent();
270 i = 0;
271 _a.label = 2;
272 case 2:
273 if (!(i < keyInCache.length)) return [3 /*break*/, 7];
274 key = keyInCache[i];
275 if (!(key.indexOf(this.config.keyPrefix) === 0 &&
276 key !== this.cacheCurSizeKey)) return [3 /*break*/, 6];
277 return [4 /*yield*/, this._isExpired(key)];
278 case 3:
279 if (!_a.sent()) return [3 /*break*/, 5];
280 return [4 /*yield*/, this._removeItem(key)];
281 case 4:
282 _a.sent();
283 return [3 /*break*/, 6];
284 case 5:
285 keys.push(key);
286 _a.label = 6;
287 case 6:
288 i += 1;
289 return [3 /*break*/, 2];
290 case 7: return [2 /*return*/, keys];
291 }
292 });
293 });
294 };
295 /**
296 * get all the items we have, sort them by their priority,
297 * if priority is same, sort them by their last visited time
298 * pop out items from the low priority (5 is the lowest)
299 * @private
300 * @param keys - all the keys in this cache
301 * @param sizeToPop - the total size of the items which needed to be poped out
302 */
303 AsyncStorageCache.prototype._popOutItems = function (keys, sizeToPop) {
304 return tslib_1.__awaiter(this, void 0, void 0, function () {
305 var items, remainedSize, i, val, item, i;
306 return tslib_1.__generator(this, function (_a) {
307 switch (_a.label) {
308 case 0:
309 items = [];
310 remainedSize = sizeToPop;
311 i = 0;
312 _a.label = 1;
313 case 1:
314 if (!(i < keys.length)) return [3 /*break*/, 4];
315 return [4 /*yield*/, async_storage_1.default.getItem(keys[i])];
316 case 2:
317 val = _a.sent();
318 if (val != null) {
319 item = JSON.parse(val);
320 items.push(item);
321 }
322 _a.label = 3;
323 case 3:
324 i += 1;
325 return [3 /*break*/, 1];
326 case 4:
327 // first compare priority
328 // then compare visited time
329 items.sort(function (a, b) {
330 if (a.priority > b.priority) {
331 return -1;
332 }
333 else if (a.priority < b.priority) {
334 return 1;
335 }
336 else {
337 if (a.visitedTime < b.visitedTime) {
338 return -1;
339 }
340 else
341 return 1;
342 }
343 });
344 i = 0;
345 _a.label = 5;
346 case 5:
347 if (!(i < items.length)) return [3 /*break*/, 8];
348 // pop out items until we have enough room for new item
349 return [4 /*yield*/, this._removeItem(items[i].key, items[i].byteSize)];
350 case 6:
351 // pop out items until we have enough room for new item
352 _a.sent();
353 remainedSize -= items[i].byteSize;
354 if (remainedSize <= 0) {
355 return [2 /*return*/];
356 }
357 _a.label = 7;
358 case 7:
359 i += 1;
360 return [3 /*break*/, 5];
361 case 8: return [2 /*return*/];
362 }
363 });
364 });
365 };
366 /**
367 * Set item into cache. You can put number, string, boolean or object.
368 * The cache will first check whether has the same key.
369 * If it has, it will delete the old item and then put the new item in
370 * The cache will pop out items if it is full
371 * You can specify the cache item options. The cache will abort and output a warning:
372 * If the key is invalid
373 * If the size of the item exceeds itemMaxSize.
374 * If the value is undefined
375 * If incorrect cache item configuration
376 * If error happened with browser storage
377 *
378 * @param {String} key - the key of the item
379 * @param {Object} value - the value of the item
380 * @param {Object} [options] - optional, the specified meta-data
381 * @return {Prmoise}
382 */
383 AsyncStorageCache.prototype.setItem = function (key, value, options) {
384 return tslib_1.__awaiter(this, void 0, void 0, function () {
385 var prefixedKey, cacheItemOptions, item, val, validKeys, sizeToPop, e_1;
386 return tslib_1.__generator(this, function (_a) {
387 switch (_a.label) {
388 case 0:
389 logger.debug("Set item: key is " + key + ", value is " + value + " with options: " + options);
390 prefixedKey = this.config.keyPrefix + key;
391 // invalid keys
392 if (prefixedKey === this.config.keyPrefix ||
393 prefixedKey === this.cacheCurSizeKey) {
394 logger.warn("Invalid key: should not be empty or 'CurSize'");
395 return [2 /*return*/];
396 }
397 if (typeof value === 'undefined') {
398 logger.warn("The value of item should not be undefined!");
399 return [2 /*return*/];
400 }
401 cacheItemOptions = {
402 priority: options && options.priority !== undefined
403 ? options.priority
404 : this.config.defaultPriority,
405 expires: options && options.expires !== undefined
406 ? options.expires
407 : this.config.defaultTTL + Utils_1.getCurrTime(),
408 };
409 if (cacheItemOptions.priority < 1 || cacheItemOptions.priority > 5) {
410 logger.warn("Invalid parameter: priority due to out or range. It should be within 1 and 5.");
411 return [2 /*return*/];
412 }
413 item = this.fillCacheItem(prefixedKey, value, cacheItemOptions);
414 // check wether this item is too big;
415 if (item.byteSize > this.config.itemMaxSize) {
416 logger.warn("Item with key: " + key + " you are trying to put into is too big!");
417 return [2 /*return*/];
418 }
419 _a.label = 1;
420 case 1:
421 _a.trys.push([1, 12, , 13]);
422 return [4 /*yield*/, async_storage_1.default.getItem(prefixedKey)];
423 case 2:
424 val = _a.sent();
425 if (!val) return [3 /*break*/, 4];
426 return [4 /*yield*/, this._removeItem(prefixedKey, JSON.parse(val).byteSize)];
427 case 3:
428 _a.sent();
429 _a.label = 4;
430 case 4: return [4 /*yield*/, this._isCacheFull(item.byteSize)];
431 case 5:
432 if (!_a.sent()) return [3 /*break*/, 10];
433 return [4 /*yield*/, this._findValidKeys()];
434 case 6:
435 validKeys = _a.sent();
436 return [4 /*yield*/, this._isCacheFull(item.byteSize)];
437 case 7:
438 if (!_a.sent()) return [3 /*break*/, 10];
439 return [4 /*yield*/, this._sizeToPop(item.byteSize)];
440 case 8:
441 sizeToPop = _a.sent();
442 return [4 /*yield*/, this._popOutItems(validKeys, sizeToPop)];
443 case 9:
444 _a.sent();
445 _a.label = 10;
446 case 10:
447 // put item in the cache
448 return [4 /*yield*/, this._setItem(prefixedKey, item)];
449 case 11:
450 // put item in the cache
451 _a.sent();
452 return [3 /*break*/, 13];
453 case 12:
454 e_1 = _a.sent();
455 logger.warn("setItem failed! " + e_1);
456 return [3 /*break*/, 13];
457 case 13: return [2 /*return*/];
458 }
459 });
460 });
461 };
462 /**
463 * Get item from cache. It will return null if item doesn’t exist or it has been expired.
464 * If you specified callback function in the options,
465 * then the function will be executed if no such item in the cache
466 * and finally put the return value into cache.
467 * Please make sure the callback function will return the value you want to put into the cache.
468 * The cache will abort output a warning:
469 * If the key is invalid
470 * If error happened with AsyncStorage
471 *
472 * @param {String} key - the key of the item
473 * @param {Object} [options] - the options of callback function
474 * @return {Promise} - return a promise resolves to be the value of the item
475 */
476 AsyncStorageCache.prototype.getItem = function (key, options) {
477 return tslib_1.__awaiter(this, void 0, void 0, function () {
478 var ret, prefixedKey, item, val, e_2;
479 return tslib_1.__generator(this, function (_a) {
480 switch (_a.label) {
481 case 0:
482 logger.debug("Get item: key is " + key + " with options " + options);
483 ret = null;
484 prefixedKey = this.config.keyPrefix + key;
485 if (prefixedKey === this.config.keyPrefix ||
486 prefixedKey === this.cacheCurSizeKey) {
487 logger.warn("Invalid key: should not be empty or 'CurSize'");
488 return [2 /*return*/, null];
489 }
490 _a.label = 1;
491 case 1:
492 _a.trys.push([1, 8, , 9]);
493 return [4 /*yield*/, async_storage_1.default.getItem(prefixedKey)];
494 case 2:
495 ret = _a.sent();
496 if (!(ret != null)) return [3 /*break*/, 7];
497 return [4 /*yield*/, this._isExpired(prefixedKey)];
498 case 3:
499 if (!_a.sent()) return [3 /*break*/, 5];
500 // if expired, remove that item and return null
501 return [4 /*yield*/, this._removeItem(prefixedKey, JSON.parse(ret).byteSize)];
502 case 4:
503 // if expired, remove that item and return null
504 _a.sent();
505 return [3 /*break*/, 7];
506 case 5:
507 item = JSON.parse(ret);
508 return [4 /*yield*/, this._refreshItem(item, prefixedKey)];
509 case 6:
510 item = _a.sent();
511 return [2 /*return*/, item.data];
512 case 7:
513 if (options && options.callback !== undefined) {
514 val = options.callback();
515 if (val !== null) {
516 this.setItem(key, val, options);
517 }
518 return [2 /*return*/, val];
519 }
520 return [2 /*return*/, null];
521 case 8:
522 e_2 = _a.sent();
523 logger.warn("getItem failed! " + e_2);
524 return [2 /*return*/, null];
525 case 9: return [2 /*return*/];
526 }
527 });
528 });
529 };
530 /**
531 * remove item from the cache
532 * The cache will abort output a warning:
533 * If error happened with AsyncStorage
534 * @param {String} key - the key of the item
535 * @return {Promise}
536 */
537 AsyncStorageCache.prototype.removeItem = function (key) {
538 return tslib_1.__awaiter(this, void 0, void 0, function () {
539 var prefixedKey, val, e_3;
540 return tslib_1.__generator(this, function (_a) {
541 switch (_a.label) {
542 case 0:
543 logger.debug("Remove item: key is " + key);
544 prefixedKey = this.config.keyPrefix + key;
545 if (prefixedKey === this.config.keyPrefix ||
546 prefixedKey === this.cacheCurSizeKey) {
547 return [2 /*return*/];
548 }
549 _a.label = 1;
550 case 1:
551 _a.trys.push([1, 5, , 6]);
552 return [4 /*yield*/, async_storage_1.default.getItem(prefixedKey)];
553 case 2:
554 val = _a.sent();
555 if (!val) return [3 /*break*/, 4];
556 return [4 /*yield*/, this._removeItem(prefixedKey, JSON.parse(val).byteSize)];
557 case 3:
558 _a.sent();
559 _a.label = 4;
560 case 4: return [3 /*break*/, 6];
561 case 5:
562 e_3 = _a.sent();
563 logger.warn("removeItem failed! " + e_3);
564 return [3 /*break*/, 6];
565 case 6: return [2 /*return*/];
566 }
567 });
568 });
569 };
570 /**
571 * clear the entire cache
572 * The cache will abort output a warning:
573 * If error happened with AsyncStorage
574 * @return {Promise}
575 */
576 AsyncStorageCache.prototype.clear = function () {
577 return tslib_1.__awaiter(this, void 0, void 0, function () {
578 var keys, keysToRemove, i, i, e_4;
579 return tslib_1.__generator(this, function (_a) {
580 switch (_a.label) {
581 case 0:
582 logger.debug("Clear Cache");
583 _a.label = 1;
584 case 1:
585 _a.trys.push([1, 7, , 8]);
586 return [4 /*yield*/, async_storage_1.default.getAllKeys()];
587 case 2:
588 keys = _a.sent();
589 keysToRemove = [];
590 for (i = 0; i < keys.length; i += 1) {
591 if (keys[i].indexOf(this.config.keyPrefix) === 0) {
592 keysToRemove.push(keys[i]);
593 }
594 }
595 i = 0;
596 _a.label = 3;
597 case 3:
598 if (!(i < keysToRemove.length)) return [3 /*break*/, 6];
599 return [4 /*yield*/, async_storage_1.default.removeItem(keysToRemove[i])];
600 case 4:
601 _a.sent();
602 _a.label = 5;
603 case 5:
604 i += 1;
605 return [3 /*break*/, 3];
606 case 6: return [3 /*break*/, 8];
607 case 7:
608 e_4 = _a.sent();
609 logger.warn("clear failed! " + e_4);
610 return [3 /*break*/, 8];
611 case 8: return [2 /*return*/];
612 }
613 });
614 });
615 };
616 /**
617 * return the current size of the cache
618 * @return {Promise}
619 */
620 AsyncStorageCache.prototype.getCacheCurSize = function () {
621 return tslib_1.__awaiter(this, void 0, void 0, function () {
622 var ret;
623 return tslib_1.__generator(this, function (_a) {
624 switch (_a.label) {
625 case 0: return [4 /*yield*/, async_storage_1.default.getItem(this.cacheCurSizeKey)];
626 case 1:
627 ret = _a.sent();
628 if (!!ret) return [3 /*break*/, 3];
629 return [4 /*yield*/, async_storage_1.default.setItem(this.cacheCurSizeKey, '0')];
630 case 2:
631 _a.sent();
632 ret = '0';
633 _a.label = 3;
634 case 3: return [2 /*return*/, Number(ret)];
635 }
636 });
637 });
638 };
639 /**
640 * Return all the keys in the cache.
641 * Will return an empty array if error happend.
642 * @return {Promise}
643 */
644 AsyncStorageCache.prototype.getAllKeys = function () {
645 return tslib_1.__awaiter(this, void 0, void 0, function () {
646 var keys, retKeys, i, e_5;
647 return tslib_1.__generator(this, function (_a) {
648 switch (_a.label) {
649 case 0:
650 _a.trys.push([0, 2, , 3]);
651 return [4 /*yield*/, async_storage_1.default.getAllKeys()];
652 case 1:
653 keys = _a.sent();
654 retKeys = [];
655 for (i = 0; i < keys.length; i += 1) {
656 if (keys[i].indexOf(this.config.keyPrefix) === 0 &&
657 keys[i] !== this.cacheCurSizeKey) {
658 retKeys.push(keys[i].substring(this.config.keyPrefix.length));
659 }
660 }
661 return [2 /*return*/, retKeys];
662 case 2:
663 e_5 = _a.sent();
664 logger.warn("getALlkeys failed! " + e_5);
665 return [2 /*return*/, []];
666 case 3: return [2 /*return*/];
667 }
668 });
669 });
670 };
671 /**
672 * Return a new instance of cache with customized configuration.
673 * @param {Object} config - the customized configuration
674 * @return {Object} - the new instance of Cache
675 */
676 AsyncStorageCache.prototype.createInstance = function (config) {
677 if (config.keyPrefix === Utils_1.defaultConfig.keyPrefix) {
678 logger.error('invalid keyPrefix, setting keyPrefix with timeStamp');
679 config.keyPrefix = Utils_1.getCurrTime.toString();
680 }
681 return new AsyncStorageCache(config);
682 };
683 return AsyncStorageCache;
684}(StorageCache_1.StorageCache));
685exports.AsyncStorageCache = AsyncStorageCache;
686var instance = new AsyncStorageCache();
687exports.Cache = instance;
688core_1.Amplify.register(instance);
689//# sourceMappingURL=AsyncStorageCache.js.map
\No newline at end of file