@nextgis/geocoder 3.0.0-alpha.13 → 3.0.0-alpha.15

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.
@@ -1,4 +1,4 @@
1
- /** Bundle of @nextgis/geocoder; version: 3.0.0-alpha.13; author: NextGIS */
1
+ /** Bundle of @nextgis/geocoder; version: 3.0.0-alpha.14; author: NextGIS */
2
2
  'use strict';
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,4 +1,4 @@
1
- /** Bundle of @nextgis/geocoder; version: 3.0.0-alpha.13; author: NextGIS */
1
+ /** Bundle of @nextgis/geocoder; version: 3.0.0-alpha.14; author: NextGIS */
2
2
  function defined(val) {
3
3
  return val !== void 0 && val !== null;
4
4
  }
@@ -1017,7 +1017,7 @@ function unwrapListeners(arr) {
1017
1017
 
1018
1018
  var pkg = {
1019
1019
  name: "@nextgis/ngw-connector",
1020
- version: "3.0.0-alpha.13",
1020
+ version: "3.0.0-alpha.14",
1021
1021
  _priority: 12,
1022
1022
  description: "A lightweight HTTP client optimized for use with NextGIS Web API",
1023
1023
  main: "index.js",
@@ -1413,7 +1413,7 @@ function generateUrl(path, query) {
1413
1413
  }
1414
1414
  function request(path, options, cacheEngine) {
1415
1415
  return __async$5(this, null, function* () {
1416
- var _b;
1416
+ var _b, _c;
1417
1417
  const defaults = {
1418
1418
  method: "GET",
1419
1419
  credentials: "same-origin",
@@ -1438,6 +1438,7 @@ function request(path, options, cacheEngine) {
1438
1438
  "query",
1439
1439
  "json"
1440
1440
  ]);
1441
+ opt.method = (_b = opt.method) == null ? void 0 : _b.toUpperCase();
1441
1442
  if (withCredentials) {
1442
1443
  opt.credentials = "include";
1443
1444
  }
@@ -1495,15 +1496,21 @@ function request(path, options, cacheEngine) {
1495
1496
  }
1496
1497
  return body;
1497
1498
  });
1498
- if (cacheEngine && cache !== false && ((_b = opt.method) == null ? void 0 : _b.toUpperCase()) === "GET") {
1499
- const props = cacheProps ? cacheProps : __spreadValues$6({}, objectRemoveEmpty({
1500
- withCredentials,
1501
- responseType
1502
- }));
1503
- return cacheEngine.add(cacheName || url, makeRequest, {
1504
- props,
1505
- expirationTime: cache ? void 0 : 500
1506
- });
1499
+ if (cacheEngine) {
1500
+ if (((_c = opt.method) == null ? void 0 : _c.toUpperCase()) === "GET") {
1501
+ if (cache !== false) {
1502
+ const props = cacheProps ? cacheProps : __spreadValues$6({}, objectRemoveEmpty({
1503
+ withCredentials,
1504
+ responseType
1505
+ }));
1506
+ return cacheEngine.add(cacheName || url, makeRequest, {
1507
+ props,
1508
+ expirationTime: cache ? void 0 : 500
1509
+ });
1510
+ }
1511
+ } else {
1512
+ cacheEngine.clean();
1513
+ }
1507
1514
  }
1508
1515
  return makeRequest();
1509
1516
  });