@prose-reader/enhancer-search 1.39.0 → 1.41.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/.test/coverage/clover.xml +2 -2
- package/.test/coverage/index.html +2 -2
- package/package.json +3 -3
- package/src/index.ts +7 -6
- package/vitest.config.ts +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<coverage generated="
|
|
3
|
-
<project timestamp="
|
|
2
|
+
<coverage generated="1708781017830" clover="3.2.0">
|
|
3
|
+
<project timestamp="1708781017830" name="All files">
|
|
4
4
|
<metrics statements="0" coveredstatements="0" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0" elements="0" coveredelements="0" complexity="0" loc="0" ncloc="0" packages="0" files="0" classes="0"/>
|
|
5
5
|
</project>
|
|
6
6
|
</coverage>
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
<template id="filterTemplate">
|
|
58
58
|
<div class="quiet">
|
|
59
59
|
Filter:
|
|
60
|
-
<input
|
|
60
|
+
<input type="search" id="fileSearch">
|
|
61
61
|
</div>
|
|
62
62
|
</template>
|
|
63
63
|
</div>
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
87
87
|
Code coverage generated by
|
|
88
88
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
89
|
-
at
|
|
89
|
+
at 2024-02-24T13:23:37.826Z
|
|
90
90
|
</div>
|
|
91
91
|
<script src="prettify.js"></script>
|
|
92
92
|
<script>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prose-reader/enhancer-search",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.41.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/prose-reader-enhancer-search.umd.cjs",
|
|
6
6
|
"module": "./dist/prose-reader-enhancer-search.js",
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"test": "vitest run --coverage"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@prose-reader/core": "^1.
|
|
22
|
+
"@prose-reader/core": "^1.41.0"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"rxjs": "*"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "0dc4c79587ea1a400b5b901066bcdeb8730c4113"
|
|
28
28
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1
2
|
import { Reader } from "@prose-reader/core"
|
|
2
3
|
import { forkJoin, from, merge, Observable, of, Subject } from "rxjs"
|
|
3
4
|
import { map, share, switchMap, takeUntil } from "rxjs/operators"
|
|
@@ -28,7 +29,7 @@ export type SearchResult = ResultItem[]
|
|
|
28
29
|
export const searchEnhancer =
|
|
29
30
|
<InheritOptions, InheritOutput extends Reader>(next: (options: InheritOptions) => InheritOutput) =>
|
|
30
31
|
(
|
|
31
|
-
options: InheritOptions
|
|
32
|
+
options: InheritOptions,
|
|
32
33
|
): InheritOutput & {
|
|
33
34
|
search: {
|
|
34
35
|
search: (text: string) => void
|
|
@@ -129,9 +130,9 @@ export const searchEnhancer =
|
|
|
129
130
|
})
|
|
130
131
|
|
|
131
132
|
return newResults
|
|
132
|
-
})
|
|
133
|
+
}),
|
|
133
134
|
)
|
|
134
|
-
})
|
|
135
|
+
}),
|
|
135
136
|
)
|
|
136
137
|
}
|
|
137
138
|
|
|
@@ -155,11 +156,11 @@ export const searchEnhancer =
|
|
|
155
156
|
return forkJoin(searches$).pipe(
|
|
156
157
|
map((results) => {
|
|
157
158
|
return results.reduce((acc, value) => [...acc, ...value], [])
|
|
158
|
-
})
|
|
159
|
+
}),
|
|
159
160
|
)
|
|
160
161
|
}),
|
|
161
|
-
map((data) => ({ type: `end` as const, data }))
|
|
162
|
-
)
|
|
162
|
+
map((data) => ({ type: `end` as const, data })),
|
|
163
|
+
),
|
|
163
164
|
).pipe(share(), takeUntil(reader.$.destroy$))
|
|
164
165
|
|
|
165
166
|
const destroy = () => {
|