@nextgis/ngw-leaflet 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-leaflet; version: 3.0.0-alpha.13; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-leaflet; version: 3.0.0-alpha.14; author: NextGIS */
2
2
  import LeafletMapAdapter from '@nextgis/leaflet-map-adapter';
3
3
  import { NgwMap } from '@nextgis/ngw-map';
4
4
  import { Icon } from 'leaflet';
@@ -1,4 +1,4 @@
1
- /** Bundle of @nextgis/ngw-leaflet; version: 3.0.0-alpha.13; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-leaflet; version: 3.0.0-alpha.14; author: NextGIS */
2
2
  var NgwLeaflet = (function () {
3
3
  'use strict';
4
4
 
@@ -18193,7 +18193,7 @@ var NgwLeaflet = (function () {
18193
18193
 
18194
18194
  var pkg = {
18195
18195
  name: "@nextgis/ngw-connector",
18196
- version: "3.0.0-alpha.13",
18196
+ version: "3.0.0-alpha.14",
18197
18197
  _priority: 12,
18198
18198
  description: "A lightweight HTTP client optimized for use with NextGIS Web API",
18199
18199
  main: "index.js",
@@ -18589,7 +18589,7 @@ var NgwLeaflet = (function () {
18589
18589
  }
18590
18590
  function request(path, options, cacheEngine) {
18591
18591
  return __async$t(this, null, function* () {
18592
- var _b;
18592
+ var _b, _c;
18593
18593
  const defaults = {
18594
18594
  method: "GET",
18595
18595
  credentials: "same-origin",
@@ -18614,6 +18614,7 @@ var NgwLeaflet = (function () {
18614
18614
  "query",
18615
18615
  "json"
18616
18616
  ]);
18617
+ opt.method = (_b = opt.method) == null ? void 0 : _b.toUpperCase();
18617
18618
  if (withCredentials) {
18618
18619
  opt.credentials = "include";
18619
18620
  }
@@ -18671,15 +18672,21 @@ var NgwLeaflet = (function () {
18671
18672
  }
18672
18673
  return body;
18673
18674
  });
18674
- if (cacheEngine && cache !== false && ((_b = opt.method) == null ? void 0 : _b.toUpperCase()) === "GET") {
18675
- const props = cacheProps ? cacheProps : __spreadValues$t({}, objectRemoveEmpty({
18676
- withCredentials,
18677
- responseType
18678
- }));
18679
- return cacheEngine.add(cacheName || url, makeRequest, {
18680
- props,
18681
- expirationTime: cache ? void 0 : 500
18682
- });
18675
+ if (cacheEngine) {
18676
+ if (((_c = opt.method) == null ? void 0 : _c.toUpperCase()) === "GET") {
18677
+ if (cache !== false) {
18678
+ const props = cacheProps ? cacheProps : __spreadValues$t({}, objectRemoveEmpty({
18679
+ withCredentials,
18680
+ responseType
18681
+ }));
18682
+ return cacheEngine.add(cacheName || url, makeRequest, {
18683
+ props,
18684
+ expirationTime: cache ? void 0 : 500
18685
+ });
18686
+ }
18687
+ } else {
18688
+ cacheEngine.clean();
18689
+ }
18683
18690
  }
18684
18691
  return makeRequest();
18685
18692
  });