@elysiajs/eden 0.1.0-rc.2 → 0.1.0-rc.3
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/dist/cjs/index.js +3 -1
- package/dist/index.js +3 -1
- package/package.json +4 -4
- package/src/index.ts +3 -1
package/dist/cjs/index.js
CHANGED
|
@@ -32,7 +32,9 @@ const createProxy = (domain, path = '') => new Proxy(() => { }, {
|
|
|
32
32
|
? JSON.stringify(body)
|
|
33
33
|
: undefined,
|
|
34
34
|
...$fetch
|
|
35
|
-
}).then((res) => {
|
|
35
|
+
}).then(async (res) => {
|
|
36
|
+
if (res.status >= 300)
|
|
37
|
+
throw new Error(await res.text());
|
|
36
38
|
if (res.headers.get('content-type') === 'application/json')
|
|
37
39
|
return res.json();
|
|
38
40
|
return res.text();
|
package/dist/index.js
CHANGED
|
@@ -29,7 +29,9 @@ const createProxy = (domain, path = '') => new Proxy(() => { }, {
|
|
|
29
29
|
? JSON.stringify(body)
|
|
30
30
|
: undefined,
|
|
31
31
|
...$fetch
|
|
32
|
-
}).then((res) => {
|
|
32
|
+
}).then(async (res) => {
|
|
33
|
+
if (res.status >= 300)
|
|
34
|
+
throw new Error(await res.text());
|
|
33
35
|
if (res.headers.get('content-type') === 'application/json')
|
|
34
36
|
return res.json();
|
|
35
37
|
return res.text();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elysiajs/eden",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.3",
|
|
4
4
|
"description": "Fully type-safe Elysia client",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "saltyAom",
|
|
@@ -36,14 +36,14 @@
|
|
|
36
36
|
"release": "npm run build && npm run test && npm publish --access public"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"elysia": ">= 0.1.0-rc.
|
|
39
|
+
"elysia": ">= 0.1.0-rc.5"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@elysiajs/cors": "^0.1.0-rc.
|
|
42
|
+
"@elysiajs/cors": "^0.1.0-rc.3",
|
|
43
43
|
"@sinclair/typebox": "^0.25.13",
|
|
44
44
|
"@types/node": "^18.11.7",
|
|
45
45
|
"bun-types": "^0.2.2",
|
|
46
|
-
"elysia": "^0.1.0-rc.
|
|
46
|
+
"elysia": "^0.1.0-rc.5",
|
|
47
47
|
"eslint": "^8.26.0",
|
|
48
48
|
"rimraf": "^3.0.2",
|
|
49
49
|
"typescript": "^4.8.4"
|
package/src/index.ts
CHANGED
|
@@ -52,7 +52,9 @@ const createProxy = (
|
|
|
52
52
|
? JSON.stringify(body)
|
|
53
53
|
: undefined,
|
|
54
54
|
...$fetch
|
|
55
|
-
}).then((res) => {
|
|
55
|
+
}).then(async (res) => {
|
|
56
|
+
if (res.status >= 300) throw new Error(await res.text())
|
|
57
|
+
|
|
56
58
|
if (res.headers.get('content-type') === 'application/json')
|
|
57
59
|
return res.json()
|
|
58
60
|
|