dnf-api 0.6.2 → 0.6.4
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/bun.lockb +0 -0
- package/dist/index.js +21 -144
- package/package.json +3 -3
- package/src/api/items.ts +1 -1
- package/src/util/query.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dnf-api",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
4
4
|
"description": "던전 앤 파이터 API",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/src/index.d.ts",
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"typescript": "5.5.3"
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
|
-
"dev": "bun --watch
|
|
21
|
+
"dev": "bun --watch test.ts",
|
|
22
22
|
"bundle": "tsc --declaration --emitDeclarationOnly --outDir dist && bun build src/index.ts --minify --target=bun --outfile dist/index.js",
|
|
23
|
-
"test
|
|
23
|
+
"dev:test": "bun --watch test.ts",
|
|
24
24
|
"test": "jest"
|
|
25
25
|
},
|
|
26
26
|
"repository": {
|
package/src/api/items.ts
CHANGED
package/src/util/query.ts
CHANGED
|
@@ -28,7 +28,7 @@ const sender = async <T>(path: string, method: "GET" | "POST", query: any) => {
|
|
|
28
28
|
};
|
|
29
29
|
const showUrl = (url: string): string => {
|
|
30
30
|
if (Util.Config.key) {
|
|
31
|
-
return url
|
|
31
|
+
return url?.replace(Util.Config.key, Util.Config.hideKeyText);
|
|
32
32
|
} else {
|
|
33
33
|
return url;
|
|
34
34
|
}
|
|
@@ -81,7 +81,7 @@ export default class Request {
|
|
|
81
81
|
if (res.statusCode !== 200) {
|
|
82
82
|
const resBody = (await res.body.json()) as Model.DnfResponse<T>;
|
|
83
83
|
const error: Model.DnfErrorResponse = {
|
|
84
|
-
url: showUrl(opt.url),
|
|
84
|
+
url: showUrl(opt.url ?? ""),
|
|
85
85
|
status: res.statusCode || 0,
|
|
86
86
|
statusText: "",
|
|
87
87
|
code: resBody.error?.code || "",
|