@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
  import CancelablePromise from '@nextgis/cancelable-promise';
3
3
  import { objectAssign, fixUrlStr } from '@nextgis/utils';
4
4
  import NgwConnector from '@nextgis/ngw-connector';
@@ -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 Geocoder = (function (exports) {
3
3
  'use strict';
4
4
 
@@ -1358,7 +1358,10 @@ var Geocoder = (function (exports) {
1358
1358
  }
1359
1359
  return CancelablePromise.resolve(void 0);
1360
1360
  };
1361
- return cache.addFull("resource", makeRequest, forCache);
1361
+ if (requestOptions == null ? void 0 : requestOptions.cache) {
1362
+ return cache.addFull("resource", makeRequest, forCache);
1363
+ }
1364
+ return makeRequest();
1362
1365
  }
1363
1366
  getOneOrFail(resource, requestOptions) {
1364
1367
  return this.getOne(resource, requestOptions).then((res) => {
@@ -1519,14 +1522,17 @@ var Geocoder = (function (exports) {
1519
1522
  }
1520
1523
  _fetchResourceById(id, requestOptions) {
1521
1524
  const promise = () => this.connector.get("resource.item", requestOptions, { id });
1522
- return this.cache.add("resource.item", promise, {
1523
- id
1524
- }).catch((er) => {
1525
- if (!(er instanceof ResourceNotFoundError)) {
1526
- throw er;
1527
- }
1528
- return void 0;
1529
- });
1525
+ if (requestOptions == null ? void 0 : requestOptions.cache) {
1526
+ return this.cache.add("resource.item", promise, {
1527
+ id
1528
+ }).catch((er) => {
1529
+ if (!(er instanceof ResourceNotFoundError)) {
1530
+ throw er;
1531
+ }
1532
+ return void 0;
1533
+ });
1534
+ }
1535
+ return promise();
1530
1536
  }
1531
1537
  _fetchResourceBy(resource, requestOptions) {
1532
1538
  return this.getMany(resource, requestOptions).then((resources) => {
@@ -1606,7 +1612,7 @@ var Geocoder = (function (exports) {
1606
1612
  function apiRequest(opt) {
1607
1613
  const params = opt.params;
1608
1614
  return new CancelablePromise((resolve, reject) => {
1609
- opt.connector.connect().then((apiItems) => {
1615
+ return opt.connector.connect().then((apiItems) => {
1610
1616
  let apiItem = apiItems && apiItems[opt.name];
1611
1617
  if (apiItem) {
1612
1618
  apiItem = [...apiItem];