@panda-lingo/goldendict 0.1.5 → 0.1.7
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/README.md +9 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,6 +17,15 @@ view.client = new DictionaryClient({ baseUrl: "/api/v1" });
|
|
|
17
17
|
await view.lookup("example");
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
+
`baseUrl` is the complete public API mount, including a reverse-proxy prefix
|
|
21
|
+
when one exists. GoldenDict-rooted article resources are rebased through that
|
|
22
|
+
mount, so a host can expose the service at a route such as `/api/v1/mdict`
|
|
23
|
+
without rewriting lookup payloads:
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
view.client = new DictionaryClient({ baseUrl: "/api/v1/mdict" });
|
|
27
|
+
```
|
|
28
|
+
|
|
20
29
|
Search-first hosts can request bounded prefix suggestions through the same
|
|
21
30
|
client and API base before committing an article lookup:
|
|
22
31
|
|
package/dist/index.js
CHANGED
|
@@ -8085,7 +8085,7 @@ function he(i, e) {
|
|
|
8085
8085
|
}
|
|
8086
8086
|
function D(i, e) {
|
|
8087
8087
|
const o = e.replace(/[?#].*$/, "").replace(/\/+$/, "");
|
|
8088
|
-
return (i === _ || i.startsWith(`${_}/`)) &&
|
|
8088
|
+
return (i === _ || i.startsWith(`${_}/`)) && o !== "" ? `${o}${i.slice(_.length)}` : /^[a-z][a-z\d+.-]*:/i.test(e) ? new URL(i, e).toString() : i;
|
|
8089
8089
|
}
|
|
8090
8090
|
function C(i) {
|
|
8091
8091
|
const e = i.resourceBaseUrl;
|