Skip to content

Commit 29f5000

Browse files
authored
🔧 fix: some spelling and grammar (#241)
1 parent a716c57 commit 29f5000

29 files changed

+103
-105
lines changed

‎docs/api/constructor.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ new Elysia({
3232
```
3333

3434
## Listen
35-
`.listen` will config any value for starting server.
35+
`.listen` will configure any value for starting the server.
3636

3737
By default `listen` will either accept `number` or `Object`.
3838

39-
For Object, `listen` accept the same value as `Bun.serve`, you can provide any custom one except `serve`.
39+
For Object, `listen` accepts the same value as `Bun.serve`, you can provide any custom one except `serve`.
4040

4141
```typescript
4242
// ✅ This is fine

‎docs/at-glance.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ new Elysia()
2626
.listen(3000)
2727
```
2828

29-
Navigate to [localhost:3000](http://localhost:3000/) should show 'Hello Elysia' as a result.
29+
Navigate to [localhost:3000](http://localhost:3000/) and it should show 'Hello Elysia' as a result.
3030

3131
## Performance
3232
Building on Bun and extensive optimization like Static Code Analysis allows Elysia to generate optimized code on the fly.
@@ -62,7 +62,7 @@ new Elysia()
6262

6363
The above code allows you to create a path parameter with the name of id, the value that passes after `/id/` will be reflected in `params.id`.
6464

65-
In most framework, you need to provide a generic type to the **id** parameter while Elysia understand that `params.id` will always be available and type as **string**. Elysia then infers this type without any manual type reference need.
65+
In most framework, you need to provide a generic type to the **id** parameter while Elysia understand that `params.id` will always be available and type as **string**. Elysia then infers this type without any manual type reference needed.
6666

6767
Elysia's goal is to help you write less TypeScript and focus more on Business logic. Let the complex type be handled by the framework.
6868

‎docs/concept/schema.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ head:
77

88
- - meta
99
- name: 'description'
10-
content: Schema is a strictly typed definitions, use to infer TypeScript's type and data validation of an incoming request and outgoing response. Elysia's schema validation are based on Sinclair's TypeBox, a TypeScript library for data validation.
10+
content: Schema are strictly typed definitions, used to infer TypeScript's type and data validation of an incoming request and outgoing response. Elysia's schema validation are based on Sinclair's TypeBox, a TypeScript library for data validation.
1111

1212
- - meta
1313
- property: 'og:description'
14-
content: Schema is a strictly typed definitions, use to infer TypeScript's type and data validation of an incoming request and outgoing response. Elysia's schema validation are based on Sinclair's TypeBox, a TypeScript library for data validation.
14+
content: Schema are strictly typed definitions, used to infer TypeScript's type and data validation of an incoming request and outgoing response. Elysia's schema validation are based on Sinclair's TypeBox, a TypeScript library for data validation.
1515
---
1616

1717
# Schema

‎docs/concept/state-decorate.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ head:
77

88
- - meta
99
- name: 'description'
10-
content: You can extend Elysia to fits your need with ".state" and ".decorate" to add custom value to the "Context", and handler, for example. Database connection, utility function, or cookie.
10+
content: You can extend Elysia to fit your needs with ".state" and ".decorate" to add custom value to the "Context", and handler, for example. Database connection, utility function, or cookie.
1111

1212
- - meta
1313
- property: 'og:description'
14-
content: You can extend Elysia to fits your need with ".state" and ".decorate" to add custom value to the "Context", and handler, for example. Database connection, utility function, or cookie.
14+
content: You can extend Elysia to fit your needs with ".state" and ".decorate" to add custom value to the "Context", and handler, for example. Database connection, utility function, or cookie.
1515
---
1616

1717
# State and Decorate
18-
You can extend Elysia to fit your need. This is useful when you need to access extra values in a handler (e.g. a database connection).
18+
You can extend Elysia to fit your needs. This is useful when you need to access extra values in a handler (e.g. a database connection).
1919

2020
In summary:
2121
- `state`: assign value to `Context.store` (a global state object of the Elysia instance)
2222
- `decorate`: assign value to `Context`
2323

2424
::: tip
25-
`Context` is a parameter in the callback of handler.
25+
`Context` is a parameter in the callback of the handler.
2626
:::
2727

2828
### Example
@@ -41,7 +41,7 @@ app
4141
- `getDate` is registered using `decorate`, and accessible via `Context.getDate`.
4242

4343
## Remap
44-
By providing a function as a first parameters, the callback will accept current value, allowing us to remap the value to anything we like.
44+
By providing a function as the first parameter, the callback will accept the current value, allowing us to remap the value to anything we like.
4545

4646
```typescript
4747
app

‎docs/eden/fetch.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ const { id, name } = nendoroid
103103
## When should I use Eden Fetch over Eden Treaty
104104
Using Eden Treaty requires a lot of down-level iteration to map all possible types in a single go, while in contrast, Eden Fetch can be lazily executed until you pick a route.
105105

106-
With complex types and lot of server routes, using Eden Treaty on a low-end development device can lead to slow type inference and auto-completion.
106+
With complex types and a lot of server routes, using Eden Treaty on a low-end development device can lead to slow type inference and auto-completion.
107107

108-
But as Elysia has tweak and optimized a lot of types and inference, Eden Treaty can be perform very well in the considerable amount of routes.
108+
But as Elysia has tweaked and optimized a lot of types and inference, Eden Treaty can perform very well in the considerable amount of routes.
109109

110-
If your single process contains **more than 500 routes**, and you need to consume all of the routes **in a single frontend codebase**, then you might want to use Eden Fetch as it has a significant better TypeScript performance than Eden Treaty.
110+
If your single process contains **more than 500 routes**, and you need to consume all of the routes **in a single frontend codebase**, then you might want to use Eden Fetch as it has a significantly better TypeScript performance than Eden Treaty.

‎docs/eden/installation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ bun add -d elysia
2222
```
2323

2424
::: tip
25-
Eden need Elysia to infers utilities type.
25+
Eden needs Elysia to infer utilities type.
2626

2727
Make sure to install Elysia with the version matching on the server.
2828
:::
@@ -68,7 +68,7 @@ client.mirror.post({
6868
```
6969

7070
## Gotcha
71-
Sometime Eden may not infers type from Elysia correctly, the following are the most common workaround to fix Eden type inference.
71+
Sometimes Eden may not infer type from Elysia correctly, the following are the most common workaround to fix Eden type inference.
7272

7373
### Type Strict
7474
Make sure to enable strict mode in **tsconfig.json**
@@ -86,9 +86,9 @@ Eden depends Elysia class to import Elysia instance and infers type correctly.
8686
Make sure that both client and server have a matching Elysia version.
8787

8888
### TypeScript version
89-
Elysia is using a newer feature and syntax of TypeScript to infers type in a most performance way, feature like Const Generic, Template Literal are heavily use.
89+
Elysia uses newer features and syntax of TypeScript to infer types in a the most performant way. Features like Const Generic and Template Literal are heavily used.
9090

91-
Make sure your client have a **minimum TypeScript version if >= 5.0**
91+
Make sure your client has a **minimum TypeScript version if >= 5.0**
9292

9393
### Method Chaining
9494
To make Eden works, Elysia must be using **method chaining**

‎docs/eden/overview.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ head:
77

88
- - meta
99
- name: 'description'
10-
content: Elysia support end-to-end type safety with Elysia Eden since start. End-to-end type-safety refers to a system in which every component of the system is checked for type consistency, meaning that data is passed between components only if the types of the data are compatible.
10+
content: Elysia supports end-to-end type safety with Elysia Eden since start. End-to-end type-safety refers to a system in which every component of the system is checked for type consistency, meaning that data is passed between components only if the types of the data are compatible.
1111

1212
- - meta
1313
- property: 'og:description'
14-
content: Elysia support end-to-end type safety with Elysia Eden since start. End-to-end type-safety refers to a system in which every component of the system is checked for type consistency, meaning that data is passed between components only if the types of the data are compatible.
14+
content: Elysia supports end-to-end type safety with Elysia Eden since start. End-to-end type-safety refers to a system in which every component of the system is checked for type consistency, meaning that data is passed between components only if the types of the data are compatible.
1515
---
1616

1717
# End-to-End Type-Safety
@@ -49,7 +49,7 @@ Others framework that support e2e type safety:
4949
Hover over variable and function to see type definition.
5050
::: -->
5151

52-
Elysia allows you change the type on server and it will be instantly reflected on the client, helping with auto-completion and type-enforcement.
52+
Elysia allows you to change the type on the server and it will be instantly reflected on the client, helping with auto-completion and type-enforcement.
5353

5454
## Eden
5555
Eden is a RPC-like client to connect Elysia **end-to-end type safety** using only TypeScript's type inference instead of code generation.
@@ -104,7 +104,7 @@ const data = await fetch('/name/:name', {
104104
})
105105
```
106106

107-
Using Eden Treaty with a complex type and lot of routes (more than 500 routes per server) on a low-end development device can lead to slow type inference and auto-completion.
107+
Using Eden Treaty with a complex type and a lot of routes (more than 500 routes per server) on a low-end development device can lead to slow type inference and auto-completion.
108108

109109
Eden Fetch is an alternative and solution for fastest type inference possible while providing full type support like Eden Treaty.
110110

‎docs/eden/test.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Using Eden, we can create an integration test with end-to-end type safety and au
2525
> Using Eden Treaty to create tests by [irvilerodrigues on Twitter](https://twitter.com/irvilerodrigues/status/1724836632300265926)
2626
2727
## Setup
28-
We can use [Bun test](https://bun.sh/guides/test/watch-mode) to create test.
28+
We can use [Bun test](https://bun.sh/guides/test/watch-mode) to create tests.
2929

3030
Create **test/index.test.ts** in the root of project directory with the following:
3131

@@ -56,4 +56,4 @@ Then we can perform tests by running **bun test**
5656
bun test
5757
```
5858

59-
This allows us to perform integration test programmatically instead of manual fetch while supporting type checking automatically.
59+
This allows us to perform integration tests programmatically instead of manual fetch while supporting type checking automatically.

‎docs/eden/treaty.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ head:
77

88
- - meta
99
- name: 'og:description'
10-
content: Eden Treaty is a object-like representation of an Elysia server, providing an end-to-end type safety, and a significantly improved developer experience. With Eden, we can fetch an API from Elysia server fully type-safe without code generation.
10+
content: Eden Treaty is an object-like representation of an Elysia server, providing an end-to-end type safety, and a significantly improved developer experience. With Eden, we can fetch an API from Elysia server fully type-safe without code generation.
1111

1212
- - meta
1313
- name: 'og:description'
14-
content: Eden Treaty is a object-like representation of an Elysia server, providing an end-to-end type safety, and a significantly improved developer experience. With Eden, we can fetch an API from Elysia server fully type-safe without code generation.
14+
content: Eden Treaty is an object-like representation of an Elysia server, providing an end-to-end type safety, and a significantly improved developer experience. With Eden, we can fetch an API from Elysia server fully type-safe without code generation.
1515
---
1616

1717
# Eden Treaty
@@ -81,7 +81,7 @@ Eden will transform `/` into `.` which can be called with a registered `method`,
8181
- **/nested/path** -> .nested.path
8282

8383
### Path parameters
84-
Path parameters will be mapped to automatically by their name in the URL.
84+
Path parameters will be mapped automatically by their name in the URL.
8585

8686
- **/id/:id** -> .id.`<anyThing>`
8787
- eg: .id.hi
@@ -108,7 +108,7 @@ Eden Treaty is a fetch wrapper, you can add any valid [Fetch](https://developer.
108108
app.post({
109109
$fetch: {
110110
headers: {
111-
'x-origanization': 'MANTIS'
111+
'x-organization': 'MANTIS'
112112
}
113113
}
114114
})
@@ -148,14 +148,14 @@ const { id, name } = nendoroid
148148

149149
Both **data**, and **error** will be typed as nullable until you can confirm their statuses with a type guard.
150150

151-
To put it simply, if fetch is sucessful, data will have a value and error will be null, and vice-versa.
151+
To put it simply, if fetch is successful, data will have a value and error will be null, and vice-versa.
152152

153153
::: tip
154154
Error is wrapped with an `Error` with its value return from the server can be retrieve from `Error.value`
155155
:::
156156

157157
### Error type based on status
158-
Both Eden Treaty and Eden Fetch can narrow down an error type based on status code if you explictly provided an error type in the Elysia server.
158+
Both Eden Treaty and Eden Fetch can narrow down an error type based on status code if you explicitly provided an error type in the Elysia server.
159159

160160
```typescript
161161
// server.ts
@@ -212,7 +212,7 @@ if(error) {
212212
```
213213

214214
## WebSocket
215-
Eden supports WebSocket using the same API as same as normal route.
215+
Eden supports WebSocket using the same API as a normal route.
216216
```typescript
217217
// Server
218218
import { Elysia, t } from 'elysia'

‎docs/essential/context.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ head:
77

88
- - meta
99
- name: 'description'
10-
content: Context is an information of each request from the client, unique to each request with global mutable store. Context can be customize by using state, decorate and derive.
10+
content: Context is information about each request from the client, unique to each request with a global mutable store. Context can be customized using state, decorate and derive.
1111

1212
- - meta
1313
- property: 'og:description'
14-
content: Context is an information of each request from the client, unique to each request with global mutable store. Context can be customize by using state, decorate and derive.
14+
content: Context is information about each request from the client, unique to each request with a global mutable store. Context can be customized using state, decorate and derive.
1515
---
1616

1717
# Context
@@ -27,7 +27,7 @@ Elysia context is consists of:
2727
- **headers** - [HTTP Header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers), additional information about the request like User-Agent, Content-Type, Cache Hint.
2828
- **request** - [Web Standard Request](https://developer.mozilla.org/en-US/docs/Web/API/Request)
2929
- **store** - A global mutable store for Elysia instance
30-
- **cookie** - A global mutatable signal store for interacting with Cookie (including get/set)
30+
- **cookie** - A global mutable signal store for interacting with Cookie (including get/set)
3131
- **set** - Property to apply to Response:
3232
- **status** - [HTTP status](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status), default to 200 if not set.
3333
- **headers** - Response headers
@@ -40,7 +40,7 @@ Because Elysia only provides essential information about the Request, you can cu
4040
Extraction of a user ID or another frequently used function related to the request, for example, into Context itself.
4141

4242
You can extend Elysia's context by using:
43-
- **state** - Create a global mutatable state into **Context.store**
43+
- **state** - Create a global mutable state into **Context.store**
4444
- **decorate** - Add additional function or property assigned to **Context**
4545
- **derive** - Add additional property based on existing property or request which is uniquely assigned to every request.
4646

@@ -237,7 +237,7 @@ const app = new Elysia()
237237
## Reference and value
238238
To mutate the state, it's recommended to use **reference** to mutate rather than using an actual value.
239239

240-
When accessing the property from JavaScript, if you define a primitive value from an object property as a new value, the reference is lost, the value is treat as new separate value instead.
240+
When accessing the property from JavaScript, if you define a primitive value from an object property as a new value, the reference is lost, the value is treated as new separate value instead.
241241

242242
For example:
243243
```typescript

0 commit comments

Comments
 (0)