@prose-reader/core 1.204.0 → 1.205.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.
@@ -3403,7 +3403,7 @@
3403
3403
  class ResourcesLocator {
3404
3404
  constructor(reader) {
3405
3405
  this.reader = reader;
3406
- this.locate = (resource, options = {}) => {
3406
+ this.locate = (resource, options) => {
3407
3407
  const cfiConsolidatedResource = {
3408
3408
  resource,
3409
3409
  meta: toCfiLocatableResource(this.reader, resource)
@@ -3438,13 +3438,14 @@
3438
3438
  );
3439
3439
  });
3440
3440
  };
3441
- this.locateMultiple = (resources, options = {}) => {
3441
+ }
3442
+ locateResource(resource, options) {
3443
+ if (Array.isArray(resource)) {
3442
3444
  return deferIdle(
3443
- () => rxjs.combineLatest(
3444
- resources.map((resource) => this.locate(resource, options))
3445
- )
3445
+ () => rxjs.combineLatest(resource.map((item) => this.locate(item, options ?? {})))
3446
3446
  );
3447
- };
3447
+ }
3448
+ return this.locate(resource, options ?? {});
3448
3449
  }
3449
3450
  }
3450
3451
  const NAMESPACE$4 = `paginationEnhancer`;
@@ -3726,8 +3727,7 @@
3726
3727
  const resourcesLocator = new ResourcesLocator(reader);
3727
3728
  return {
3728
3729
  ...reader,
3729
- locateResources: resourcesLocator.locateMultiple,
3730
- locateResource: resourcesLocator.locate,
3730
+ locateResource: resourcesLocator.locateResource.bind(resourcesLocator),
3731
3731
  pagination: {
3732
3732
  ...reader.pagination,
3733
3733
  getState: () => getPaginationInfo(),