Skip to content

Commit

Permalink
feat(grammar): improve grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
jlenon7 committed Jan 9, 2024
1 parent 0269308 commit 31028b3
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 15 deletions.
22 changes: 18 additions & 4 deletions docs/digging-deeper/collections.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ As you can see in the example above, creating a collection is as simples as:
const collection = new Collection([1, 2, 3])
```

Simplifying even more: Athenna has extended the `Array` class to simply convert an array to a collection using the `toCollection` method:
Simplifying even more: Athenna has extended the `Array` class to simply convert an array to a collection using the `toAthennaCollection()` method:

```typescript
const numbers = [1, 2, 3]

const collection = numbers.toCollection()
const collection = numbers.toAthennaCollection()
```

:::info
Expand Down Expand Up @@ -2723,9 +2723,23 @@ const json = collection.toJson()
// {"id": 384, "name": "Rayquaza", "gender": "NA"}
```

#### `toJSON()`

Enter in all the collection objects and execute the `toJSON()` method of each object:

```js
const collection = new Collection([
{ toJSON: () => ({ id: 1 }) }
])

const json = collection.toJSON()

// [{ id: 1 }]
```

#### `toResource()`

The toResource method enter all collection objects and execute the `toResource` method of each object:
Enter in all the collection objects and execute the `toResource()` method of each object:

```js
const collection = new Collection([
Expand Down Expand Up @@ -3291,4 +3305,4 @@ const zipped = collection.zip([100, 200])
zipped.all()

// [['Chair', 100], ['Desk', 200]]
```
```
8 changes: 4 additions & 4 deletions docs/orm/extending-models.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ See how to extend models implementations in Athenna Framework.

## Introduction

All the Athenna models extends the
All the Athenna models extends the
[`BaseModel`](https://github.com/AthennaIO/Database/blob/develop/src/models/BaseModel.ts)
class of the `@athenna/database` package. This class
provides everything that a model needs to communicate with database
provides everything that a model needs to communicate with database
in the best way possible. But sometimes you may need to write your
own methods depending on your business logic and to save some time.
You will see at this page how you can easily create your own static
You will see on this page how you can easily create your own static
and instance methods for your models.

:::tip
Expand Down Expand Up @@ -148,7 +148,7 @@ const oldestPost = await user.getOldestPost()
Always be carefully to not break the single responsibility principle
of [`SOLID`](https://medium.com/backticks-tildes/the-s-o-l-i-d-principles-in-pictures-b34ce2f1e898)
when implementing your own model methods. But you are free to do whatever
you want with Athenna 😎🤙. All this methods implementation will always
you want with Athenna 😎🤙. All of these methods implementations will always
depend on your business logic and creativity.

:::
14 changes: 7 additions & 7 deletions docs/rest-api-application/annotations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ export class YourControllerName {}
Set what will be the camel alias that your controller will be
registered with in the service container. Camel aliases are very
useful when you need to resolve your dependency from [`@Inject()`
useful when you need to resolve your dependency from [`@Inject()`
annotation](/docs/architecture-concepts/service-container#using-inject-annotation)
or [automatic constructor injection.](docs/architecture-concepts/service-container#automatic-constructor-injection)

Since controllers were not designed to be resolved using the above
approachs, `camelAlias` will always be `undefined`, but you are
approaches, `camelAlias` will always be `undefined`, but you are
free to define one:

```typescript
Expand Down Expand Up @@ -135,7 +135,7 @@ annotation](/docs/architecture-concepts/service-container#using-inject-annotatio
or [automatic constructor injection.](docs/architecture-concepts/service-container#automatic-constructor-injection)

Since middlewares were not designed to be resolved using the above
approachs, `camelAlias` will always be `undefined`, but you are
approaches, `camelAlias` will always be `undefined`, but you are
free to define one:

```typescript
Expand All @@ -156,7 +156,7 @@ export class YourMiddlewareName {}

## `@Interceptor()`

Use this annotations to define all the metadata needed to register
Use this annotation to define all the metadata needed to register
your interceptor into the service container:

```typescript
Expand Down Expand Up @@ -221,7 +221,7 @@ annotation](/docs/architecture-concepts/service-container#using-inject-annotatio
or [automatic constructor injection.](docs/architecture-concepts/service-container#automatic-constructor-injection)

Since interceptors were not designed to be resolved using the above
approachs, `camelAlias` will always be `undefined`, but you are
approaches, `camelAlias` will always be `undefined`, but you are
free to define one:

```typescript
Expand All @@ -242,7 +242,7 @@ export class YourInterceptorName {}

## `@Terminator()`

Use this annotations to define all the metadata needed to register
Use this annotation to define all the metadata needed to register
your terminator into the service container:

```typescript
Expand Down Expand Up @@ -305,7 +305,7 @@ annotation](/docs/architecture-concepts/service-container#using-inject-annotatio
or [automatic constructor injection.](docs/architecture-concepts/service-container#automatic-constructor-injection)

Since terminators were not designed to be resolved using the above
approachs, `camelAlias` will always be `undefined`, but you are
approaches, `camelAlias` will always be `undefined`, but you are
free to define one:

```typescript
Expand Down

0 comments on commit 31028b3

Please sign in to comment.