@nextgis/ngw-map 3.0.0-alpha.13 → 3.0.0-alpha.14

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/ngw-map; version: 3.0.0-alpha.13; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-map; 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/ngw-map; version: 3.0.0-alpha.13; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-map; version: 3.0.0-alpha.14; author: NextGIS */
2
2
  const svgPath = {
3
3
  brill: '<path d="m6 0-5 6 5 6 5-6z"/>',
4
4
  circle: '<circle cx="6" cy="6" r="6"/>',
@@ -1065,7 +1065,7 @@ function unwrapListeners(arr) {
1065
1065
 
1066
1066
  var pkg = {
1067
1067
  name: "@nextgis/ngw-connector",
1068
- version: "3.0.0-alpha.13",
1068
+ version: "3.0.0-alpha.14",
1069
1069
  _priority: 12,
1070
1070
  description: "A lightweight HTTP client optimized for use with NextGIS Web API",
1071
1071
  main: "index.js",
@@ -1461,7 +1461,7 @@ function generateUrl(path, query) {
1461
1461
  }
1462
1462
  function request(path, options, cacheEngine) {
1463
1463
  return __async$u(this, null, function* () {
1464
- var _b;
1464
+ var _b, _c;
1465
1465
  const defaults = {
1466
1466
  method: "GET",
1467
1467
  credentials: "same-origin",
@@ -1486,6 +1486,7 @@ function request(path, options, cacheEngine) {
1486
1486
  "query",
1487
1487
  "json"
1488
1488
  ]);
1489
+ opt.method = (_b = opt.method) == null ? void 0 : _b.toUpperCase();
1489
1490
  if (withCredentials) {
1490
1491
  opt.credentials = "include";
1491
1492
  }
@@ -1543,15 +1544,21 @@ function request(path, options, cacheEngine) {
1543
1544
  }
1544
1545
  return body;
1545
1546
  });
1546
- if (cacheEngine && cache !== false && ((_b = opt.method) == null ? void 0 : _b.toUpperCase()) === "GET") {
1547
- const props = cacheProps ? cacheProps : __spreadValues$w({}, objectRemoveEmpty({
1548
- withCredentials,
1549
- responseType
1550
- }));
1551
- return cacheEngine.add(cacheName || url, makeRequest, {
1552
- props,
1553
- expirationTime: cache ? void 0 : 500
1554
- });
1547
+ if (cacheEngine) {
1548
+ if (((_c = opt.method) == null ? void 0 : _c.toUpperCase()) === "GET") {
1549
+ if (cache !== false) {
1550
+ const props = cacheProps ? cacheProps : __spreadValues$w({}, objectRemoveEmpty({
1551
+ withCredentials,
1552
+ responseType
1553
+ }));
1554
+ return cacheEngine.add(cacheName || url, makeRequest, {
1555
+ props,
1556
+ expirationTime: cache ? void 0 : 500
1557
+ });
1558
+ }
1559
+ } else {
1560
+ cacheEngine.clean();
1561
+ }
1555
1562
  }
1556
1563
  return makeRequest();
1557
1564
  });