Skip to content

Commit

Permalink
🎉 feat: release 1.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
SaltyAom committed Mar 25, 2024
1 parent 8509fb2 commit 961cf39
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.0.6 - 21 Mar 2024
Bug fix:
- treaty2: default onResponse to null and mutate when need

# 1.0.6 - 21 Mar 2024
Change:
- treaty2: use null as default error value instead of undefined
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@elysiajs/eden",
"version": "1.0.6",
"version": "1.0.7",
"description": "Fully type-safe Elysia client",
"author": {
"name": "saltyAom",
Expand Down
7 changes: 5 additions & 2 deletions src/treaty2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,12 @@ const createProxy = (

for (const value of onResponse)
try {
data = await value(response.clone())
const temp = await value(response.clone())

if (data !== undefined && data !== null) break
if (data !== undefined && data !== null) {
data = temp
break
}
} catch (err) {
if (err instanceof EdenFetchError) error = err
else error = new EdenFetchError(422, err)
Expand Down

0 comments on commit 961cf39

Please sign in to comment.