@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
  var domain;
3
3
 
4
4
  // This constructor is used to store event handlers. Instantiating this is
@@ -18190,7 +18190,7 @@ let Cache = _Cache;
18190
18190
 
18191
18191
  var pkg = {
18192
18192
  name: "@nextgis/ngw-connector",
18193
- version: "3.0.0-alpha.13",
18193
+ version: "3.0.0-alpha.14",
18194
18194
  _priority: 12,
18195
18195
  description: "A lightweight HTTP client optimized for use with NextGIS Web API",
18196
18196
  main: "index.js",
@@ -18586,7 +18586,7 @@ function generateUrl(path, query) {
18586
18586
  }
18587
18587
  function request(path, options, cacheEngine) {
18588
18588
  return __async$t(this, null, function* () {
18589
- var _b;
18589
+ var _b, _c;
18590
18590
  const defaults = {
18591
18591
  method: "GET",
18592
18592
  credentials: "same-origin",
@@ -18611,6 +18611,7 @@ function request(path, options, cacheEngine) {
18611
18611
  "query",
18612
18612
  "json"
18613
18613
  ]);
18614
+ opt.method = (_b = opt.method) == null ? void 0 : _b.toUpperCase();
18614
18615
  if (withCredentials) {
18615
18616
  opt.credentials = "include";
18616
18617
  }
@@ -18668,15 +18669,21 @@ function request(path, options, cacheEngine) {
18668
18669
  }
18669
18670
  return body;
18670
18671
  });
18671
- if (cacheEngine && cache !== false && ((_b = opt.method) == null ? void 0 : _b.toUpperCase()) === "GET") {
18672
- const props = cacheProps ? cacheProps : __spreadValues$t({}, objectRemoveEmpty({
18673
- withCredentials,
18674
- responseType
18675
- }));
18676
- return cacheEngine.add(cacheName || url, makeRequest, {
18677
- props,
18678
- expirationTime: cache ? void 0 : 500
18679
- });
18672
+ if (cacheEngine) {
18673
+ if (((_c = opt.method) == null ? void 0 : _c.toUpperCase()) === "GET") {
18674
+ if (cache !== false) {
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
+ });
18683
+ }
18684
+ } else {
18685
+ cacheEngine.clean();
18686
+ }
18680
18687
  }
18681
18688
  return makeRequest();
18682
18689
  });