Skip to content

Commit dcbd815

Browse files
committed
🎉 feat: get global definition
1 parent 8407fd9 commit dcbd815

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

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.3.0-exp.70",
4+
"version": "1.3.0-exp.71",
55
"author": {
66
"name": "saltyAom",
77
"url": "https://github.com/SaltyAom",

src/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,10 @@ export default class Elysia<
307307
return this.router.history
308308
}
309309

310+
protected getGlobalDefinitions() {
311+
return this.definitions
312+
}
313+
310314
protected inference: Sucrose.Inference = {
311315
body: false,
312316
cookie: false,
@@ -3929,6 +3933,8 @@ export default class Elysia<
39293933
plugin.getServer = () => this.getServer()
39303934
plugin.getGlobalRoutes = () =>
39313935
this.getGlobalRoutes()
3936+
plugin.getGlobalDefinitions = () =>
3937+
this.getGlobalDefinitions()
39323938

39333939
/**
39343940
* Model and error is required for Swagger generation
@@ -3997,6 +4003,7 @@ export default class Elysia<
39974003
plugin.getParent = () => this as any
39984004
plugin.getServer = () => this.getServer()
39994005
plugin.getGlobalRoutes = () => this.getGlobalRoutes()
4006+
plugin.getGlobalDefinitions = () => this.getGlobalDefinitions()
40004007

40014008
// if (this.config.sanitize) {
40024009
// const isArray = (v: unknown): v is any[] => Array.isArray(v)

0 commit comments

Comments
 (0)