@aws-amplify/cache 4.0.51-size-improvement.21 → 4.0.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [4.0.51](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/cache@4.0.50...@aws-amplify/cache@4.0.51) (2022-08-16)
7
+
8
+ **Note:** Version bump only for package @aws-amplify/cache
9
+
10
+
11
+
12
+
13
+
6
14
  ## [4.0.50](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/cache@4.0.49...@aws-amplify/cache@4.0.50) (2022-08-01)
7
15
 
8
16
  **Note:** Version bump only for package @aws-amplify/cache
@@ -96,260 +96,6 @@ return /******/ (function(modules) { // webpackBootstrap
96
96
  /************************************************************************/
97
97
  /******/ ({
98
98
 
99
- /***/ "../../node_modules/tslib/tslib.es6.js":
100
- /*!********************************************************!*\
101
- !*** /root/amplify-js/node_modules/tslib/tslib.es6.js ***!
102
- \********************************************************/
103
- /*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet */
104
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
105
-
106
- "use strict";
107
- __webpack_require__.r(__webpack_exports__);
108
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__extends", function() { return __extends; });
109
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__assign", function() { return __assign; });
110
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__rest", function() { return __rest; });
111
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__decorate", function() { return __decorate; });
112
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__param", function() { return __param; });
113
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__metadata", function() { return __metadata; });
114
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__awaiter", function() { return __awaiter; });
115
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__generator", function() { return __generator; });
116
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__createBinding", function() { return __createBinding; });
117
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__exportStar", function() { return __exportStar; });
118
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; });
119
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; });
120
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; });
121
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArrays", function() { return __spreadArrays; });
122
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; });
123
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; });
124
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; });
125
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncValues", function() { return __asyncValues; });
126
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__makeTemplateObject", function() { return __makeTemplateObject; });
127
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importStar", function() { return __importStar; });
128
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importDefault", function() { return __importDefault; });
129
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldGet", function() { return __classPrivateFieldGet; });
130
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldSet", function() { return __classPrivateFieldSet; });
131
- /*! *****************************************************************************
132
- Copyright (c) Microsoft Corporation.
133
-
134
- Permission to use, copy, modify, and/or distribute this software for any
135
- purpose with or without fee is hereby granted.
136
-
137
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
138
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
139
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
140
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
141
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
142
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
143
- PERFORMANCE OF THIS SOFTWARE.
144
- ***************************************************************************** */
145
- /* global Reflect, Promise */
146
-
147
- var extendStatics = function(d, b) {
148
- extendStatics = Object.setPrototypeOf ||
149
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
150
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
151
- return extendStatics(d, b);
152
- };
153
-
154
- function __extends(d, b) {
155
- extendStatics(d, b);
156
- function __() { this.constructor = d; }
157
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
158
- }
159
-
160
- var __assign = function() {
161
- __assign = Object.assign || function __assign(t) {
162
- for (var s, i = 1, n = arguments.length; i < n; i++) {
163
- s = arguments[i];
164
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
165
- }
166
- return t;
167
- }
168
- return __assign.apply(this, arguments);
169
- }
170
-
171
- function __rest(s, e) {
172
- var t = {};
173
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
174
- t[p] = s[p];
175
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
176
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
177
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
178
- t[p[i]] = s[p[i]];
179
- }
180
- return t;
181
- }
182
-
183
- function __decorate(decorators, target, key, desc) {
184
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
185
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
186
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
187
- return c > 3 && r && Object.defineProperty(target, key, r), r;
188
- }
189
-
190
- function __param(paramIndex, decorator) {
191
- return function (target, key) { decorator(target, key, paramIndex); }
192
- }
193
-
194
- function __metadata(metadataKey, metadataValue) {
195
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
196
- }
197
-
198
- function __awaiter(thisArg, _arguments, P, generator) {
199
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
200
- return new (P || (P = Promise))(function (resolve, reject) {
201
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
202
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
203
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
204
- step((generator = generator.apply(thisArg, _arguments || [])).next());
205
- });
206
- }
207
-
208
- function __generator(thisArg, body) {
209
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
210
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
211
- function verb(n) { return function (v) { return step([n, v]); }; }
212
- function step(op) {
213
- if (f) throw new TypeError("Generator is already executing.");
214
- while (_) try {
215
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
216
- if (y = 0, t) op = [op[0] & 2, t.value];
217
- switch (op[0]) {
218
- case 0: case 1: t = op; break;
219
- case 4: _.label++; return { value: op[1], done: false };
220
- case 5: _.label++; y = op[1]; op = [0]; continue;
221
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
222
- default:
223
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
224
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
225
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
226
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
227
- if (t[2]) _.ops.pop();
228
- _.trys.pop(); continue;
229
- }
230
- op = body.call(thisArg, _);
231
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
232
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
233
- }
234
- }
235
-
236
- function __createBinding(o, m, k, k2) {
237
- if (k2 === undefined) k2 = k;
238
- o[k2] = m[k];
239
- }
240
-
241
- function __exportStar(m, exports) {
242
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
243
- }
244
-
245
- function __values(o) {
246
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
247
- if (m) return m.call(o);
248
- if (o && typeof o.length === "number") return {
249
- next: function () {
250
- if (o && i >= o.length) o = void 0;
251
- return { value: o && o[i++], done: !o };
252
- }
253
- };
254
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
255
- }
256
-
257
- function __read(o, n) {
258
- var m = typeof Symbol === "function" && o[Symbol.iterator];
259
- if (!m) return o;
260
- var i = m.call(o), r, ar = [], e;
261
- try {
262
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
263
- }
264
- catch (error) { e = { error: error }; }
265
- finally {
266
- try {
267
- if (r && !r.done && (m = i["return"])) m.call(i);
268
- }
269
- finally { if (e) throw e.error; }
270
- }
271
- return ar;
272
- }
273
-
274
- function __spread() {
275
- for (var ar = [], i = 0; i < arguments.length; i++)
276
- ar = ar.concat(__read(arguments[i]));
277
- return ar;
278
- }
279
-
280
- function __spreadArrays() {
281
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
282
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
283
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
284
- r[k] = a[j];
285
- return r;
286
- };
287
-
288
- function __await(v) {
289
- return this instanceof __await ? (this.v = v, this) : new __await(v);
290
- }
291
-
292
- function __asyncGenerator(thisArg, _arguments, generator) {
293
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
294
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
295
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
296
- function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
297
- function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
298
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
299
- function fulfill(value) { resume("next", value); }
300
- function reject(value) { resume("throw", value); }
301
- function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
302
- }
303
-
304
- function __asyncDelegator(o) {
305
- var i, p;
306
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
307
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
308
- }
309
-
310
- function __asyncValues(o) {
311
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
312
- var m = o[Symbol.asyncIterator], i;
313
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
314
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
315
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
316
- }
317
-
318
- function __makeTemplateObject(cooked, raw) {
319
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
320
- return cooked;
321
- };
322
-
323
- function __importStar(mod) {
324
- if (mod && mod.__esModule) return mod;
325
- var result = {};
326
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
327
- result.default = mod;
328
- return result;
329
- }
330
-
331
- function __importDefault(mod) {
332
- return (mod && mod.__esModule) ? mod : { default: mod };
333
- }
334
-
335
- function __classPrivateFieldGet(receiver, privateMap) {
336
- if (!privateMap.has(receiver)) {
337
- throw new TypeError("attempted to get private field on non-instance");
338
- }
339
- return privateMap.get(receiver);
340
- }
341
-
342
- function __classPrivateFieldSet(receiver, privateMap, value) {
343
- if (!privateMap.has(receiver)) {
344
- throw new TypeError("attempted to set private field on non-instance");
345
- }
346
- privateMap.set(receiver, value);
347
- return value;
348
- }
349
-
350
-
351
- /***/ }),
352
-
353
99
  /***/ "./lib-esm/BrowserStorageCache.js":
354
100
  /*!****************************************!*\
355
101
  !*** ./lib-esm/BrowserStorageCache.js ***!
@@ -361,11 +107,10 @@ function __classPrivateFieldSet(receiver, privateMap, value) {
361
107
  __webpack_require__.r(__webpack_exports__);
362
108
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BrowserStorageCacheClass", function() { return BrowserStorageCacheClass; });
363
109
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BrowserStorageCache", function() { return BrowserStorageCache; });
364
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
365
- /* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Utils */ "./lib-esm/Utils/index.js");
366
- /* harmony import */ var _StorageCache__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./StorageCache */ "./lib-esm/StorageCache.js");
367
- /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @aws-amplify/core */ "@aws-amplify/core");
368
- /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_3__);
110
+ /* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Utils */ "./lib-esm/Utils/index.js");
111
+ /* harmony import */ var _StorageCache__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./StorageCache */ "./lib-esm/StorageCache.js");
112
+ /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @aws-amplify/core */ "@aws-amplify/core");
113
+ /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_2__);
369
114
  /*
370
115
  * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
371
116
  *
@@ -378,11 +123,36 @@ __webpack_require__.r(__webpack_exports__);
378
123
  * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
379
124
  * and limitations under the License.
380
125
  */
126
+ var __extends = undefined && undefined.__extends || function () {
127
+ var _extendStatics = function extendStatics(d, b) {
128
+ _extendStatics = Object.setPrototypeOf || {
129
+ __proto__: []
130
+ } instanceof Array && function (d, b) {
131
+ d.__proto__ = b;
132
+ } || function (d, b) {
133
+ for (var p in b) {
134
+ if (b.hasOwnProperty(p)) d[p] = b[p];
135
+ }
136
+ };
137
+
138
+ return _extendStatics(d, b);
139
+ };
140
+
141
+ return function (d, b) {
142
+ _extendStatics(d, b);
143
+
144
+ function __() {
145
+ this.constructor = d;
146
+ }
381
147
 
148
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
149
+ };
150
+ }();
382
151
 
383
152
 
384
153
 
385
- var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_3__["ConsoleLogger"]('Cache');
154
+
155
+ var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_2__["ConsoleLogger"]('Cache');
386
156
  /**
387
157
  * Customized storage based on the SessionStorage or LocalStorage with LRU implemented
388
158
  */
@@ -390,7 +160,7 @@ var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_3__["ConsoleLogger"]
390
160
  var BrowserStorageCacheClass =
391
161
  /** @class */
392
162
  function (_super) {
393
- Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(BrowserStorageCacheClass, _super);
163
+ __extends(BrowserStorageCacheClass, _super);
394
164
  /**
395
165
  * initialize the cache
396
166
  * @param config - the configuration of the cache
@@ -400,7 +170,7 @@ function (_super) {
400
170
  function BrowserStorageCacheClass(config) {
401
171
  var _this = this;
402
172
 
403
- var cacheConfig = config ? Object.assign({}, _Utils__WEBPACK_IMPORTED_MODULE_1__["defaultConfig"], config) : _Utils__WEBPACK_IMPORTED_MODULE_1__["defaultConfig"];
173
+ var cacheConfig = config ? Object.assign({}, _Utils__WEBPACK_IMPORTED_MODULE_0__["defaultConfig"], config) : _Utils__WEBPACK_IMPORTED_MODULE_0__["defaultConfig"];
404
174
  _this = _super.call(this, cacheConfig) || this;
405
175
  _this.config.storage = cacheConfig.storage;
406
176
  _this.getItem = _this.getItem.bind(_this);
@@ -444,7 +214,7 @@ function (_super) {
444
214
 
445
215
 
446
216
  BrowserStorageCacheClass.prototype._refreshItem = function (item, prefixedKey) {
447
- item.visitedTime = Object(_Utils__WEBPACK_IMPORTED_MODULE_1__["getCurrTime"])();
217
+ item.visitedTime = Object(_Utils__WEBPACK_IMPORTED_MODULE_0__["getCurrTime"])();
448
218
  this.config.storage.setItem(prefixedKey, JSON.stringify(item));
449
219
  return item;
450
220
  };
@@ -462,7 +232,7 @@ function (_super) {
462
232
  var text = this.config.storage.getItem(key);
463
233
  var item = JSON.parse(text);
464
234
 
465
- if (Object(_Utils__WEBPACK_IMPORTED_MODULE_1__["getCurrTime"])() >= item.expires) {
235
+ if (Object(_Utils__WEBPACK_IMPORTED_MODULE_0__["getCurrTime"])() >= item.expires) {
466
236
  return true;
467
237
  }
468
238
 
@@ -652,7 +422,7 @@ function (_super) {
652
422
 
653
423
  var cacheItemOptions = {
654
424
  priority: options && options.priority !== undefined ? options.priority : this.config.defaultPriority,
655
- expires: options && options.expires !== undefined ? options.expires : this.config.defaultTTL + Object(_Utils__WEBPACK_IMPORTED_MODULE_1__["getCurrTime"])()
425
+ expires: options && options.expires !== undefined ? options.expires : this.config.defaultTTL + Object(_Utils__WEBPACK_IMPORTED_MODULE_0__["getCurrTime"])()
656
426
  };
657
427
 
658
428
  if (cacheItemOptions.priority < 1 || cacheItemOptions.priority > 5) {
@@ -853,16 +623,16 @@ function (_super) {
853
623
 
854
624
 
855
625
  BrowserStorageCacheClass.prototype.createInstance = function (config) {
856
- if (!config.keyPrefix || config.keyPrefix === _Utils__WEBPACK_IMPORTED_MODULE_1__["defaultConfig"].keyPrefix) {
626
+ if (!config.keyPrefix || config.keyPrefix === _Utils__WEBPACK_IMPORTED_MODULE_0__["defaultConfig"].keyPrefix) {
857
627
  logger.error('invalid keyPrefix, setting keyPrefix with timeStamp');
858
- config.keyPrefix = _Utils__WEBPACK_IMPORTED_MODULE_1__["getCurrTime"].toString();
628
+ config.keyPrefix = _Utils__WEBPACK_IMPORTED_MODULE_0__["getCurrTime"].toString();
859
629
  }
860
630
 
861
631
  return new BrowserStorageCacheClass(config);
862
632
  };
863
633
 
864
634
  return BrowserStorageCacheClass;
865
- }(_StorageCache__WEBPACK_IMPORTED_MODULE_2__["StorageCache"]);
635
+ }(_StorageCache__WEBPACK_IMPORTED_MODULE_1__["StorageCache"]);
866
636
 
867
637
 
868
638
  var BrowserStorageCache = new BrowserStorageCacheClass();
@@ -885,11 +655,10 @@ var BrowserStorageCache = new BrowserStorageCacheClass();
885
655
  __webpack_require__.r(__webpack_exports__);
886
656
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InMemoryCacheClass", function() { return InMemoryCacheClass; });
887
657
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InMemoryCache", function() { return InMemoryCache; });
888
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
889
- /* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Utils */ "./lib-esm/Utils/index.js");
890
- /* harmony import */ var _StorageCache__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./StorageCache */ "./lib-esm/StorageCache.js");
891
- /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @aws-amplify/core */ "@aws-amplify/core");
892
- /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_3__);
658
+ /* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Utils */ "./lib-esm/Utils/index.js");
659
+ /* harmony import */ var _StorageCache__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./StorageCache */ "./lib-esm/StorageCache.js");
660
+ /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @aws-amplify/core */ "@aws-amplify/core");
661
+ /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_2__);
893
662
  /*
894
663
  * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
895
664
  *
@@ -902,11 +671,53 @@ __webpack_require__.r(__webpack_exports__);
902
671
  * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
903
672
  * and limitations under the License.
904
673
  */
674
+ var __extends = undefined && undefined.__extends || function () {
675
+ var _extendStatics = function extendStatics(d, b) {
676
+ _extendStatics = Object.setPrototypeOf || {
677
+ __proto__: []
678
+ } instanceof Array && function (d, b) {
679
+ d.__proto__ = b;
680
+ } || function (d, b) {
681
+ for (var p in b) {
682
+ if (b.hasOwnProperty(p)) d[p] = b[p];
683
+ }
684
+ };
685
+
686
+ return _extendStatics(d, b);
687
+ };
688
+
689
+ return function (d, b) {
690
+ _extendStatics(d, b);
691
+
692
+ function __() {
693
+ this.constructor = d;
694
+ }
695
+
696
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
697
+ };
698
+ }();
699
+
700
+ var __values = undefined && undefined.__values || function (o) {
701
+ var s = typeof Symbol === "function" && Symbol.iterator,
702
+ m = s && o[s],
703
+ i = 0;
704
+ if (m) return m.call(o);
705
+ if (o && typeof o.length === "number") return {
706
+ next: function next() {
707
+ if (o && i >= o.length) o = void 0;
708
+ return {
709
+ value: o && o[i++],
710
+ done: !o
711
+ };
712
+ }
713
+ };
714
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
715
+ };
905
716
 
906
717
 
907
718
 
908
719
 
909
- var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_3__["ConsoleLogger"]('InMemoryCache');
720
+ var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_2__["ConsoleLogger"]('InMemoryCache');
910
721
  /**
911
722
  * Customized in-memory cache with LRU implemented
912
723
  * @member cacheObj - object which store items
@@ -919,7 +730,7 @@ var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_3__["ConsoleLogger"]
919
730
  var InMemoryCacheClass =
920
731
  /** @class */
921
732
  function (_super) {
922
- Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(InMemoryCacheClass, _super);
733
+ __extends(InMemoryCacheClass, _super);
923
734
  /**
924
735
  * initialize the cache
925
736
  *
@@ -930,7 +741,7 @@ function (_super) {
930
741
  function InMemoryCacheClass(config) {
931
742
  var _this = this;
932
743
 
933
- var cacheConfig = config ? Object.assign({}, _Utils__WEBPACK_IMPORTED_MODULE_1__["defaultConfig"], config) : _Utils__WEBPACK_IMPORTED_MODULE_1__["defaultConfig"];
744
+ var cacheConfig = config ? Object.assign({}, _Utils__WEBPACK_IMPORTED_MODULE_0__["defaultConfig"], config) : _Utils__WEBPACK_IMPORTED_MODULE_0__["defaultConfig"];
934
745
  _this = _super.call(this, cacheConfig) || this;
935
746
  logger.debug('now we start!');
936
747
  _this.cacheList = [];
@@ -941,7 +752,7 @@ function (_super) {
941
752
  _this.removeItem = _this.removeItem.bind(_this); // initialize list for every priority
942
753
 
943
754
  for (var i = 0; i < _this.maxPriority; i += 1) {
944
- _this.cacheList[i] = new _Utils__WEBPACK_IMPORTED_MODULE_1__["CacheList"]();
755
+ _this.cacheList[i] = new _Utils__WEBPACK_IMPORTED_MODULE_0__["CacheList"]();
945
756
  }
946
757
 
947
758
  return _this;
@@ -976,10 +787,10 @@ function (_super) {
976
787
 
977
788
 
978
789
  InMemoryCacheClass.prototype._isExpired = function (key) {
979
- var text = _Utils__WEBPACK_IMPORTED_MODULE_1__["CacheObject"].getItem(key);
790
+ var text = _Utils__WEBPACK_IMPORTED_MODULE_0__["CacheObject"].getItem(key);
980
791
  var item = JSON.parse(text);
981
792
 
982
- if (Object(_Utils__WEBPACK_IMPORTED_MODULE_1__["getCurrTime"])() >= item.expires) {
793
+ if (Object(_Utils__WEBPACK_IMPORTED_MODULE_0__["getCurrTime"])() >= item.expires) {
983
794
  return true;
984
795
  }
985
796
 
@@ -997,10 +808,10 @@ function (_super) {
997
808
  // delete the key from the list
998
809
  this.cacheList[listIdx].removeItem(prefixedKey); // decrease the current size of the cache
999
810
 
1000
- this._decreaseCurSizeInBytes(JSON.parse(_Utils__WEBPACK_IMPORTED_MODULE_1__["CacheObject"].getItem(prefixedKey)).byteSize); // finally remove the item from memory
811
+ this._decreaseCurSizeInBytes(JSON.parse(_Utils__WEBPACK_IMPORTED_MODULE_0__["CacheObject"].getItem(prefixedKey)).byteSize); // finally remove the item from memory
1001
812
 
1002
813
 
1003
- _Utils__WEBPACK_IMPORTED_MODULE_1__["CacheObject"].removeItem(prefixedKey);
814
+ _Utils__WEBPACK_IMPORTED_MODULE_0__["CacheObject"].removeItem(prefixedKey);
1004
815
  };
1005
816
  /**
1006
817
  * put item into cache
@@ -1019,7 +830,7 @@ function (_super) {
1019
830
  this._increaseCurSizeInBytes(item.byteSize); // finally add the item into memory
1020
831
 
1021
832
 
1022
- _Utils__WEBPACK_IMPORTED_MODULE_1__["CacheObject"].setItem(prefixedKey, JSON.stringify(item));
833
+ _Utils__WEBPACK_IMPORTED_MODULE_0__["CacheObject"].setItem(prefixedKey, JSON.stringify(item));
1023
834
  };
1024
835
  /**
1025
836
  * see whether cache is full
@@ -1087,7 +898,7 @@ function (_super) {
1087
898
 
1088
899
  var cacheItemOptions = {
1089
900
  priority: options && options.priority !== undefined ? options.priority : this.config.defaultPriority,
1090
- expires: options && options.expires !== undefined ? options.expires : this.config.defaultTTL + Object(_Utils__WEBPACK_IMPORTED_MODULE_1__["getCurrTime"])()
901
+ expires: options && options.expires !== undefined ? options.expires : this.config.defaultTTL + Object(_Utils__WEBPACK_IMPORTED_MODULE_0__["getCurrTime"])()
1091
902
  };
1092
903
 
1093
904
  if (cacheItemOptions.priority < 1 || cacheItemOptions.priority > 5) {
@@ -1157,7 +968,7 @@ function (_super) {
1157
968
  this._removeItem(prefixedKey, presentKeyPrio - 1);
1158
969
  } else {
1159
970
  // if not expired, great, return the value and refresh it
1160
- ret = _Utils__WEBPACK_IMPORTED_MODULE_1__["CacheObject"].getItem(prefixedKey);
971
+ ret = _Utils__WEBPACK_IMPORTED_MODULE_0__["CacheObject"].getItem(prefixedKey);
1161
972
  var item = JSON.parse(ret);
1162
973
  this.cacheList[item.priority - 1].refresh(prefixedKey);
1163
974
  return item.data;
@@ -1202,7 +1013,7 @@ function (_super) {
1202
1013
 
1203
1014
  for (var i = 0; i < this.maxPriority; i += 1) {
1204
1015
  try {
1205
- for (var _b = (e_1 = void 0, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(this.cacheList[i].getKeys())), _c = _b.next(); !_c.done; _c = _b.next()) {
1016
+ for (var _b = (e_1 = void 0, __values(this.cacheList[i].getKeys())), _c = _b.next(); !_c.done; _c = _b.next()) {
1206
1017
  var key = _c.value;
1207
1018
 
1208
1019
  this._removeItem(key, i);
@@ -1232,7 +1043,7 @@ function (_super) {
1232
1043
 
1233
1044
  for (var i = 0; i < this.maxPriority; i += 1) {
1234
1045
  try {
1235
- for (var _b = (e_2 = void 0, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(this.cacheList[i].getKeys())), _c = _b.next(); !_c.done; _c = _b.next()) {
1046
+ for (var _b = (e_2 = void 0, __values(this.cacheList[i].getKeys())), _c = _b.next(); !_c.done; _c = _b.next()) {
1236
1047
  var key = _c.value;
1237
1048
  keys.push(key.substring(this.config.keyPrefix.length));
1238
1049
  }
@@ -1272,7 +1083,7 @@ function (_super) {
1272
1083
  };
1273
1084
 
1274
1085
  return InMemoryCacheClass;
1275
- }(_StorageCache__WEBPACK_IMPORTED_MODULE_2__["StorageCache"]);
1086
+ }(_StorageCache__WEBPACK_IMPORTED_MODULE_1__["StorageCache"]);
1276
1087
 
1277
1088
 
1278
1089
  var InMemoryCache = new InMemoryCacheClass();
@@ -1458,7 +1269,6 @@ function () {
1458
1269
 
1459
1270
  "use strict";
1460
1271
  __webpack_require__.r(__webpack_exports__);
1461
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
1462
1272
  /*
1463
1273
  * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
1464
1274
  *
@@ -1471,7 +1281,22 @@ __webpack_require__.r(__webpack_exports__);
1471
1281
  * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
1472
1282
  * and limitations under the License.
1473
1283
  */
1474
-
1284
+ var __values = undefined && undefined.__values || function (o) {
1285
+ var s = typeof Symbol === "function" && Symbol.iterator,
1286
+ m = s && o[s],
1287
+ i = 0;
1288
+ if (m) return m.call(o);
1289
+ if (o && typeof o.length === "number") return {
1290
+ next: function next() {
1291
+ if (o && i >= o.length) o = void 0;
1292
+ return {
1293
+ value: o && o[i++],
1294
+ done: !o
1295
+ };
1296
+ }
1297
+ };
1298
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
1299
+ };
1475
1300
 
1476
1301
  var DoubleLinkedNode =
1477
1302
  /** @class */
@@ -1617,7 +1442,7 @@ function () {
1617
1442
  var e_1, _a;
1618
1443
 
1619
1444
  try {
1620
- for (var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(Object.keys(this.hashtable)), _c = _b.next(); !_c.done; _c = _b.next()) {
1445
+ for (var _b = __values(Object.keys(this.hashtable)), _c = _b.next(); !_c.done; _c = _b.next()) {
1621
1446
  var key = _c.value;
1622
1447
 
1623
1448
  if (this.hashtable.hasOwnProperty(key)) {