@nextgis/geocoder 2.3.0 → 2.4.0

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: 2.3.0; author: NextGIS */
1
+ /** Bundle of @nextgis/geocoder; version: 2.4.0; 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: 2.3.0; author: NextGIS */
1
+ /** Bundle of @nextgis/geocoder; version: 2.4.0; author: NextGIS */
2
2
  var __defProp$g = Object.defineProperty;
3
3
  var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
4
  var __publicField$e = (obj, key, value) => __defNormalProp$g(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -1355,7 +1355,10 @@ class ResourcesControl {
1355
1355
  }
1356
1356
  return CancelablePromise.resolve(void 0);
1357
1357
  };
1358
- return cache.addFull("resource", makeRequest, forCache);
1358
+ if (requestOptions == null ? void 0 : requestOptions.cache) {
1359
+ return cache.addFull("resource", makeRequest, forCache);
1360
+ }
1361
+ return makeRequest();
1359
1362
  }
1360
1363
  getOneOrFail(resource, requestOptions) {
1361
1364
  return this.getOne(resource, requestOptions).then((res) => {
@@ -1516,14 +1519,17 @@ class ResourcesControl {
1516
1519
  }
1517
1520
  _fetchResourceById(id, requestOptions) {
1518
1521
  const promise = () => this.connector.get("resource.item", requestOptions, { id });
1519
- return this.cache.add("resource.item", promise, {
1520
- id
1521
- }).catch((er) => {
1522
- if (!(er instanceof ResourceNotFoundError)) {
1523
- throw er;
1524
- }
1525
- return void 0;
1526
- });
1522
+ if (requestOptions == null ? void 0 : requestOptions.cache) {
1523
+ return this.cache.add("resource.item", promise, {
1524
+ id
1525
+ }).catch((er) => {
1526
+ if (!(er instanceof ResourceNotFoundError)) {
1527
+ throw er;
1528
+ }
1529
+ return void 0;
1530
+ });
1531
+ }
1532
+ return promise();
1527
1533
  }
1528
1534
  _fetchResourceBy(resource, requestOptions) {
1529
1535
  return this.getMany(resource, requestOptions).then((resources) => {
@@ -1603,7 +1609,7 @@ function template(str, data) {
1603
1609
  function apiRequest(opt) {
1604
1610
  const params = opt.params;
1605
1611
  return new CancelablePromise((resolve, reject) => {
1606
- opt.connector.connect().then((apiItems) => {
1612
+ return opt.connector.connect().then((apiItems) => {
1607
1613
  let apiItem = apiItems && apiItems[opt.name];
1608
1614
  if (apiItem) {
1609
1615
  apiItem = [...apiItem];