From ff7acdecf06e02a8eae369057d2d017a8ca77285 Mon Sep 17 00:00:00 2001 From: Braden Wong <13159333+braden-w@users.noreply.github.com> Date: Fri, 5 Dec 2025 15:47:45 -0800 Subject: [PATCH 1/3] docs(tutorial): use string status names in examples - Convert status(418) to status("I'm a teapot") in validation tutorial - Convert status(418) to status("I'm a teapot") in macro tutorial - Convert status(401) to status("Unauthorized") in macro auth example --- docs/tutorial/getting-started/validation/index.md | 2 +- docs/tutorial/patterns/macro/index.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/tutorial/getting-started/validation/index.md b/docs/tutorial/getting-started/validation/index.md index fe2dc7b1..5e67c65c 100644 --- a/docs/tutorial/getting-started/validation/index.md +++ b/docs/tutorial/getting-started/validation/index.md @@ -134,7 +134,7 @@ new Elysia() .get('/', ({ status, set }) => { set.headers['x-powered-by'] = 'Elysia' - return status(418, 'Hello Elysia!') + return status("I'm a teapot", 'Hello Elysia!') }) .get('/docs', ({ redirect }) => redirect('https://elysiajs.com')) .listen(3000) diff --git a/docs/tutorial/patterns/macro/index.md b/docs/tutorial/patterns/macro/index.md index fcc051a6..b15ca4c1 100644 --- a/docs/tutorial/patterns/macro/index.md +++ b/docs/tutorial/patterns/macro/index.md @@ -64,7 +64,7 @@ new Elysia() }), // psuedo auth check beforeHandle({ cookie: { session }, status }) { - if(!session.value) return status(401) + if(!session.value) return status("Unauthorized") } }) .post('/user', ({ body }) => body, { @@ -112,7 +112,7 @@ new Elysia() .macro('isFibonacci', { body: t.Number(), beforeHandle({ body, status }) { - if(!isFibonacci(body)) return status(418) + if(!isFibonacci(body)) return status("I'm a teapot") } }) .post('/', ({ body }) => body, { From 86bb96d9b553d583e3da10019e2abbbeffe99b94 Mon Sep 17 00:00:00 2001 From: Braden Wong Date: Fri, 5 Dec 2025 17:32:01 -0800 Subject: [PATCH 2/3] style: use single quotes for status strings --- docs/tutorial/getting-started/validation/index.md | 2 +- docs/tutorial/patterns/macro/index.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/tutorial/getting-started/validation/index.md b/docs/tutorial/getting-started/validation/index.md index 5e67c65c..6cd60878 100644 --- a/docs/tutorial/getting-started/validation/index.md +++ b/docs/tutorial/getting-started/validation/index.md @@ -134,7 +134,7 @@ new Elysia() .get('/', ({ status, set }) => { set.headers['x-powered-by'] = 'Elysia' - return status("I'm a teapot", 'Hello Elysia!') + return status('I\'m a teapot', 'Hello Elysia!') }) .get('/docs', ({ redirect }) => redirect('https://elysiajs.com')) .listen(3000) diff --git a/docs/tutorial/patterns/macro/index.md b/docs/tutorial/patterns/macro/index.md index b15ca4c1..2ba6a4a2 100644 --- a/docs/tutorial/patterns/macro/index.md +++ b/docs/tutorial/patterns/macro/index.md @@ -64,7 +64,7 @@ new Elysia() }), // psuedo auth check beforeHandle({ cookie: { session }, status }) { - if(!session.value) return status("Unauthorized") + if(!session.value) return status('Unauthorized') } }) .post('/user', ({ body }) => body, { @@ -112,7 +112,7 @@ new Elysia() .macro('isFibonacci', { body: t.Number(), beforeHandle({ body, status }) { - if(!isFibonacci(body)) return status("I'm a teapot") + if(!isFibonacci(body)) return status('I\'m a teapot') } }) .post('/', ({ body }) => body, { From de56db2a5f1385ac3ab46ce83538309a5ec571da Mon Sep 17 00:00:00 2001 From: Braden Wong Date: Fri, 5 Dec 2025 17:38:36 -0800 Subject: [PATCH 3/3] style: use double quotes for strings with apostrophes --- docs/tutorial/getting-started/validation/index.md | 2 +- docs/tutorial/patterns/macro/index.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tutorial/getting-started/validation/index.md b/docs/tutorial/getting-started/validation/index.md index 6cd60878..5e67c65c 100644 --- a/docs/tutorial/getting-started/validation/index.md +++ b/docs/tutorial/getting-started/validation/index.md @@ -134,7 +134,7 @@ new Elysia() .get('/', ({ status, set }) => { set.headers['x-powered-by'] = 'Elysia' - return status('I\'m a teapot', 'Hello Elysia!') + return status("I'm a teapot", 'Hello Elysia!') }) .get('/docs', ({ redirect }) => redirect('https://elysiajs.com')) .listen(3000) diff --git a/docs/tutorial/patterns/macro/index.md b/docs/tutorial/patterns/macro/index.md index 2ba6a4a2..5d305c77 100644 --- a/docs/tutorial/patterns/macro/index.md +++ b/docs/tutorial/patterns/macro/index.md @@ -112,7 +112,7 @@ new Elysia() .macro('isFibonacci', { body: t.Number(), beforeHandle({ body, status }) { - if(!isFibonacci(body)) return status('I\'m a teapot') + if(!isFibonacci(body)) return status("I'm a teapot") } }) .post('/', ({ body }) => body, {