@prose-reader/enhancer-search 1.221.0 → 1.223.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prose-reader/enhancer-search",
3
- "version": "1.221.0",
3
+ "version": "1.223.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.umd.cjs",
6
6
  "module": "./dist/index.js",
@@ -17,10 +17,10 @@
17
17
  "test": "vitest run --coverage"
18
18
  },
19
19
  "dependencies": {
20
- "@prose-reader/core": "^1.221.0"
20
+ "@prose-reader/core": "^1.223.0"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "rxjs": "*"
24
24
  },
25
- "gitHead": "d349f90635d8f7d1004738f9f57597a8e0b46e2a"
25
+ "gitHead": "e15ee567520d988a97b35bd1dfe3976462d80d82"
26
26
  }
package/src/search.ts CHANGED
@@ -28,7 +28,7 @@ const searchNodeContainingText = (node: Node, text: string) => {
28
28
  let match: RegExpExecArray | null = null
29
29
  const regexp = RegExp(`(${text})`, `gi`)
30
30
 
31
- // biome-ignore lint/suspicious/noAssignInExpressions: <explanation>
31
+ // biome-ignore lint/suspicious/noAssignInExpressions: TODO
32
32
  while ((match = regexp.exec(content)) !== null) {
33
33
  if (match.index >= 0 && subNode.ownerDocument) {
34
34
  const range = subNode.ownerDocument.createRange()
@@ -54,12 +54,10 @@ export const searchInDocument = (
54
54
  const ranges = searchNodeContainingText(doc, text)
55
55
 
56
56
  const newResults = ranges.map((range) => {
57
- const { end, start } = reader.cfi.generateCfiFromRange(range, item.item)
57
+ const cfi = reader.cfi.generateCfiFromRange(range, item.item)
58
58
 
59
59
  return {
60
- cfi: start,
61
- startCfi: start,
62
- endCfi: end,
60
+ cfi,
63
61
  } satisfies ResultItem
64
62
  })
65
63
 
package/src/types.ts CHANGED
@@ -3,8 +3,6 @@ import type { SearchResult } from "./search"
3
3
 
4
4
  export type ResultItem = {
5
5
  cfi: string
6
- startCfi?: string
7
- endCfi?: string
8
6
  }
9
7
 
10
8
  export type SearchEnhancerAPI = {