Skip to content

Commit 023af44

Browse files
committed
🎉 feat: soundness
1 parent bc32ad5 commit 023af44

File tree

8 files changed

+962
-609
lines changed

8 files changed

+962
-609
lines changed

example/a.ts

Lines changed: 15 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,16 @@
1-
import { Elysia, error, t } from '../src'
2-
import { sucrose } from '../src/sucrose'
3-
import { post, req } from '../test/utils'
1+
import { Elysia } from '../src'
42

5-
console.log(
6-
sucrose({
7-
handler: function ({ query }) {
8-
query.a
9-
},
10-
afterHandle: [],
11-
beforeHandle: [],
12-
error: [
13-
function a({
14-
query,
15-
query: { a, c: d },
16-
headers: { hello },
17-
...rest
18-
}) {
19-
query.b
20-
rest.query.e
21-
},
22-
({ query: { f } }) => {}
23-
],
24-
mapResponse: [],
25-
onResponse: [],
26-
parse: [],
27-
request: [],
28-
start: [],
29-
stop: [],
30-
trace: [],
31-
transform: []
32-
})
33-
)
3+
const child = new Elysia()
4+
// ? This is only in local
5+
.derive(() => ({
6+
hello: 'world'
7+
}))
8+
/**
9+
* ? Since hello is only in local
10+
* ? It might not be available in global
11+
*
12+
**/
13+
.mapDerive(({ hello }) => ({
14+
hello
15+
}))
16+
.get('/child', ({ hello }) => hello)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "elysia",
33
"description": "Ergonomic Framework for Human",
4-
"version": "1.0.1",
4+
"version": "1.0.2",
55
"author": {
66
"name": "saltyAom",
77
"url": "https://github.com/SaltyAom",

0 commit comments

Comments
 (0)