@arsedizioni/ars-utils 21.1.7 → 21.1.8

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.
@@ -2476,22 +2476,19 @@ class ClipperSearchResultItemComponent {
2476
2476
  * @returns the chunks info string or undefined
2477
2477
  */
2478
2478
  getChunks() {
2479
- let anchors = this.item().anchors?.sort((a, b) => (a.score ?? 0) - (b.score ?? 0)).slice(0, 5) ?? [];
2480
- console.log(anchors.length ?? 0);
2481
- if (anchors.length > 0) {
2479
+ if (this.item().chunks && this.item().chunks.length > 0) {
2482
2480
  let chunks = "chunks:";
2483
2481
  let count = 0;
2484
- anchors.forEach((anchor, index) => {
2485
- if (anchor.chunk === undefined)
2482
+ this.item().chunks.forEach((chunk, index) => {
2483
+ if (chunk <= 0)
2486
2484
  return;
2487
2485
  if (index > 0) {
2488
2486
  chunks += "|";
2489
2487
  }
2490
- chunks += anchor.chunk;
2488
+ chunks += chunk;
2491
2489
  count++;
2492
2490
  });
2493
2491
  return count > 0 ? chunks : undefined;
2494
- console.log(chunks);
2495
2492
  }
2496
2493
  return undefined;
2497
2494
  }