Skip to content

Commit 4b5dcd5

Browse files
authored
Merge pull request #91 from StrawHatHacker/Typos
Typo fixes
2 parents 70e2439 + 895850e commit 4b5dcd5

22 files changed

+91
-99
lines changed

docs/blog/elysia-06.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ By this, Elysia is partially follows WinterCG compliance as we are optimized to
122122

123123
This allows any framework and code that is WinterCG compliance to be run together in theory, an implementation is proved by [Hono](https://honojs.dev) which introduce the **.mount** method to [runs multiple framework together in one codebase](https://twitter.com/honojs/status/1684839623355490304), including Remix, Elysia, Itty Router, and Hono itself in a simple function.
124124

125-
By this, we implemented the same logic for Elysia by introducing `.mount` method to runs any framework or code that WinterCG compliance.
125+
By this, we implemented the same logic for Elysia by introducing `.mount` method to runs any framework or code that is WinterCG compliant.
126126

127127
To use `.mount`, [simply pass a `fetch` function](https://twitter.com/saltyAom/status/1684786233594290176):
128128
```ts
@@ -146,7 +146,7 @@ By default, this declaration are used by:
146146
- Netlify Edge Function
147147
- Remix Function Handler
148148
149-
Which means you can run all of the above code to interlop with Elysia all in a single server, or reused and existing function all in one deployment, no need to setting up Reverse Proxy for handling multiple server.
149+
Which means you can run all of the above code to interlop with Elysia all in a single server, or re-used and existing function all in one deployment, no need to setting up Reverse Proxy for handling multiple server.
150150
151151
If the framework also support a **.mount** function, you can deeply nested a framework that support it infinitely.
152152
```ts
@@ -163,7 +163,7 @@ const main = new Elysia()
163163
.listen(3000)
164164
```
165165

166-
You can even reused multiple existing Elysia project in your server.
166+
You can even re-used multiple existing Elysia project in your server.
167167

168168
```ts
169169
import A from 'project-a/elysia'

docs/blog/elysia-supabase.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ const authen = (app: Elysia) =>
326326
Great! We have just used name reference on our route!
327327

328328
::: tip
329-
If you found yourself with a long schema, you can declare them in a separate file and reuse them in any Elysia route to put the focus back on business logic instead.
329+
If you found yourself with a long schema, you can declare them in a separate file and re-use them in any Elysia route to put the focus back on business logic instead.
330330
:::
331331

332332
## Storing user session
@@ -478,7 +478,7 @@ And that's it!
478478

479479
We have just implemented user authentication which is fun and game, but now you might find yourself in need of authorization for each route, and duplicating the same code to check for cookies all over the place.
480480

481-
Luckily, we can reuse the function in Elysia.
481+
Luckily, we can re-use the function in Elysia.
482482

483483
Let's paint the example by saying that we might want a user to create a simple blog post that can have the database schema as the following:
484484

docs/concept/numeric.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ head:
1919

2020
Sometime you might find yourself in need of numeric string like extracting path parameter, but it's typed as string and need to be convert to number.
2121

22-
Using Elysia's `transform` life-cycle, you can manually parse number to string and reuse the transform function in other handler as well.
22+
Using Elysia's `transform` life-cycle, you can manually parse number to string and re-use the transform function in other handler as well.
2323

2424
```ts
2525
app.get('/id/:id', ({ params: { id } }) => id, {

docs/patterns/body-parser.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ new Elysia()
3737
```
3838

3939
## Custom body parser
40-
If you want to support more `content-type`, you can use `onParse`:
40+
If you want to support more `content-type`s, you can use the `onParse` method:
4141

4242
```typescript
4343
new Elysia()
@@ -47,9 +47,9 @@ new Elysia()
4747
})
4848
```
4949

50-
The returned value will be assigned to `Context.body`, otherwise, Elysia will iterate more parser functions assigned by `onParse` until either body is assigned or all parsers are executed.
50+
The returned value will be assigned to Context.body. If not, Elysia will continue iterating through additional parser functions assigned by `onParse` until either body is assigned or all parsers have been executed.
5151

52-
You can also use `request` to take advantage and add custom behavior for parsing the body.
52+
You can also use `request` to add custom parsing behavior.
5353

5454
For example, parsing GraphQL on a specific path:
5555
```typescript

docs/patterns/dependency-injection.md

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

88
- - meta
99
- name: 'description'
10-
content: Dependency injection is a concept that allows you to separate a utility function, decouple route into a plugin and reuse them in a certain scope. This will allows you to control access to decorators of Elysia.
10+
content: Dependency injection is a concept that allows you to separate a utility function, decouple route into a plugin and re-use them in a certain scope. This will allows you to control access to decorators of Elysia.
1111

1212

1313
- - meta
1414
- property: 'og:description'
15-
content: Dependency injection is a concept that allows you to separate a utility function, decouple route into a plugin and reuse them in a certain scope. This will allows you to control access to decorators of Elysia.
15+
content: Dependency injection is a concept that allows you to separate a utility function, decouple route into a plugin and re-use them in a certain scope. This will allows you to control access to decorators of Elysia.
1616
---
1717

1818
# Dependency Injection
1919
Sometimes you would like to separate routes from your main file.
2020

21-
Normally you would normally decouple them into a plugin like:
21+
Normally you would decouple them into a plugin like:
2222
```typescript
2323
// index.ts
2424
const app = new Elysia()
@@ -32,7 +32,7 @@ const authen = new Elysia()
3232
.post('/sign-up', signUp)
3333
```
3434

35-
But then sometime, at the main instance introduce some `state`, and `decorate` that you might need a separated module.
35+
You might want to introduce some `state`, and `decorate` in the main instance that you actually need in a separated module.
3636
```typescript
3737
// index.ts
3838
const app = new Elysia()
@@ -54,7 +54,7 @@ const authen = new Elysia()
5454
})
5555
```
5656

57-
If you hovered over the main `app` in `index.ts`, you can see that it has some type auto-generated for your main server which might look something like this:
57+
If you hover over the main `app` in `index.ts`, you can see the auto-generated type for your main server which might look something like this:
5858
```typescript
5959
const app: Elysia<'', {
6060
store: {
@@ -69,7 +69,7 @@ const app: Elysia<'', {
6969
7070
But this type isn't applied to sub-modules.
7171
72-
To apply the type to sub-modules, you can create a plugin which only contains `state` and `decorate` which caused **type side-effect** as dependency, and apply to the module you want to use.
72+
To apply the type to sub-modules, you can create a plugin which only contains `state` and `decorate` which causes **type side-effect** as a dependency, and applies it to any sub-modules you want.
7373
7474
```typescript
7575
const setup = new Elysia({ name: 'setup' })
@@ -89,4 +89,4 @@ const authen = new Elysia()
8989
})
9090
```
9191

92-
This will allows you to control access to decorators in modules, this concept is also known as **Dependency Injection** but only for types.
92+
This will allow you to control access to decorators in modules. This concept is also known as **Dependency Injection** but only for types.

docs/patterns/end-to-end-type-safety.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ End-to-end type-safety refers to a system in which every component of the system
1919

2020
This can help prevent bugs and errors by catching type mismatches early in the development process, rather than at runtime.
2121

22-
Ensure that the system is working in a predictable way, thus reducing the risk of unexpected behavior.
22+
It ensures that the system is working in a predictable way, thus reducing the risk of unexpected behavior.
2323

2424
---
2525

26-
Elysia support End-to-End Type-Safety between client-server with the [Eden](/plugins/eden/overview).
26+
Elysia supports End-to-End Type-Safety between client-server with the [Eden](/plugins/eden/overview) plugin.
2727

2828
<iframe
2929
id="embedded-editor"
@@ -37,8 +37,6 @@ Elysia support End-to-End Type-Safety between client-server with the [Eden](/plu
3737
Hover over variable and function to see type definition.
3838
:::
3939

40-
Elysia allows you change type on server and reflect the type definitions on the client, helping with auto-completion and type-enforcement.
40+
Elysia allows you change the type on server and it will be instantly reflected on the client, helping with auto-completion and type-enforcement.
4141

42-
With End-to-End Type-Safety, migrating from old to new type also reflect which path of the codebase need to be migrate by line-of-code level.
43-
44-
See [Eden](/plugins/eden/overview) for more example.
42+
See [Eden](/plugins/eden/overview) for more examples.

docs/patterns/error-handling.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ new Elysia()
3232
With `onError` you can catch and transform the error into your custom error message.
3333

3434
::: tip
35-
It's important that `onError` must be call before handler you want to apply
35+
It's important that `onError` must be called before the handler you want to apply it to.
3636
:::
3737

3838
For example, returning custom 404 messages:
@@ -128,7 +128,7 @@ new Elysia()
128128
```
129129

130130
## Catching all error
131-
To list all error, you can list an error using `error.all`.
131+
To list all errors, you can list an error using `error.all`.
132132

133133
```ts
134134
new Elysia()

docs/patterns/file-upload.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ head:
1515
---
1616

1717
# File Upload
18-
Elysia handle attachment of `multipart/form-data` to `Context.body` by default.
18+
Elysia handles attachment of `multipart/form-data` to `Context.body` by default.
1919

2020
```typescript
2121
import { Elysia, t } from '../src'

docs/patterns/lazy-loading-module.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ head:
1717
# Lazy-Loading Module
1818
Modules are eagerly loaded by default.
1919

20-
Elysia loads all modules and registers and indexes all of the modules before starting the server. This enforces that all the modules should load before start accepting a request.
20+
Elysia loads all modules then registers and indexes all of them before starting the server. This enforces that all the modules have loaded before it starts accepting requests.
2121

22-
While this is fine for most applications, it may become a bottleneck for a server running in a serverless environment and edge function, where the startup time is important.
22+
While this is fine for most applications, it may become a bottleneck for a server running in a serverless environment or an edge function, in which the startup time is important.
2323

2424
Lazy-loading can help decrease startup time by deferring modules to be gradually indexed after the server start.
2525

@@ -53,7 +53,7 @@ const app = new Elysia()
5353

5454
Elysia static plugin is also a deferred module, as it loads files and registers files path asynchronously.
5555

56-
To ensure module registration before the server start, you can use `await` on the deferred module.
56+
To ensure module registration before the server starts, you can use `await` on the deferred module.
5757

5858
```typescript
5959
// index.ts
@@ -66,7 +66,7 @@ const app = new Elysia()
6666
## Lazy Load Module
6767
Same as the async plugin, the lazy-load module will be registered after the server is started.
6868

69-
A lazy-load module can be both sync or async function, as long as the module is used with `import` the module will be lazy-load.
69+
A lazy-load module can be both sync or async function, as long as the module is used with `import` the module will be lazy-loaded.
7070

7171
```typescript
7272
import { Elysia } from 'elysia'
@@ -75,7 +75,7 @@ const app = new Elysia()
7575
.use(import('./plugin'))
7676
```
7777

78-
Lazy-loading module is recommended when the module is heavy and blocking a start-up time, especially in a serverless/edge environment.
78+
Using module lazy-loading is recommended when the module is computationally heavy and/or blocking.
7979

8080
## Testing
8181
In a test environment, you can use `await app.modules` to wait for deferred and lazy-loading modules.

docs/patterns/mount.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Elysia is WinterCG compliance as we are optimized to Bun but also openly support
2121

2222
In theory, this allows any framework or code that is WinterCG compliance to be run together, allowing framework like Elysia, Hono, Remix, Itty Router to runs together in a simple function.
2323

24-
By this, we implemented the same logic for Elysia by introducing `.mount` method to runs any framework or code that WinterCG compliance.
24+
By this, we implemented the same logic for Elysia by introducing `.mount` method to runs any framework or code that is WinterCG compliant.
2525

2626
## Mount
2727
To use `.mount`, [simply pass a `fetch` function](https://twitter.com/saltyAom/status/1684786233594290176):
@@ -31,7 +31,7 @@ const app = new Elysia()
3131
.mount('/hono', hono.fetch)
3232
```
3333

34-
A **fetch** function is a function that accept Web Standard Request and return Web Standard Response as the definition of:
34+
A **fetch** function is a function that accepts a Web Standard Request and returns a Web Standard Response with the definition of:
3535
```ts
3636
// Web Standard Request-like object
3737
// Web Standard Response
@@ -47,7 +47,7 @@ By default, this declaration are used by:
4747
- Remix Function Handler
4848
- etc.
4949
50-
Which means you can run all of the above code to interlop with Elysia all in a single server, or reused and existing function all in one deployment, no need to setting up Reverse Proxy for handling multiple server.
50+
Which means you can run all of the above code to interlop with Elysia all in a single server, or re-used and existing functions all in one deployment, no need to set up a Reverse Proxy for handling multiple servers.
5151
5252
If the framework also support a **.mount** function, you can deeply nested a framework that support it infinitely.
5353
```ts
@@ -65,7 +65,7 @@ const main = new Elysia()
6565
```
6666

6767
## Reusing Elysia
68-
You can even reused multiple existing Elysia project in your server.
68+
You can even re-use multiple existing Elysia project in your server.
6969

7070
```ts
7171
import A from 'project-a/elysia'
@@ -78,6 +78,6 @@ new Elysia()
7878
.mount(C)
7979
```
8080

81-
If an instance passed to mount is an Elysia instance, it will resolve to `use` automatically, providing type-safety and support for Eden by default.
81+
If an instance passed to `mount` is an Elysia instance, it will be resolved with `use` automatically, providing type-safety and support for Eden by default.
8282

83-
This made the possiblility of interlopable framework and runtime to a reality.
83+
This made the possiblility of interlopable framework and runtime, into a reality.

0 commit comments

Comments
 (0)