Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Symbol(type) in deserialization #139

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
247 changes: 139 additions & 108 deletions docs/README.md

Large diffs are not rendered by default.

82 changes: 39 additions & 43 deletions docs/classes/ContextBuilder.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

## Type parameters

| Name | Type |
| :------ | :------ |
| `TEntity` | `TEntity` |
| Name | Type |
| :----------------- | :-------- |
| `TEntity` | `TEntity` |
| `TExtraProperties` | `unknown` |

## Table of contents
Expand Down Expand Up @@ -40,20 +40,20 @@

#### Type parameters

| Name | Type |
| :------ | :------ |
| `TEntity` | `TEntity` |
| Name | Type |
| :----------------- | :-------- |
| `TEntity` | `TEntity` |
| `TExtraProperties` | `unknown` |

#### Parameters

| Name | Type |
| :------ | :------ |
| Name | Type |
| :--------------- | :-------------------------------------------------------------------------------------------------------------------------- |
| `renderFunction` | (`c`: [`Context`](../README.md#context)<`TEntity`, `TExtraProperties`\>) => [`DocumentObject`](../README.md#documentobject) |

#### Defined in

[src/context.ts:18](https://github.com/andersondanilo/jsonapi-fractal/blob/9e4f6c2/src/context.ts#L18)
[src/context.ts:18](https://github.com/andersondanilo/jsonapi-fractal/blob/43f9c51/src/context.ts#L18)

## Properties

Expand All @@ -63,29 +63,29 @@

#### Defined in

[src/context.ts:15](https://github.com/andersondanilo/jsonapi-fractal/blob/9e4f6c2/src/context.ts#L15)
[src/context.ts:15](https://github.com/andersondanilo/jsonapi-fractal/blob/43f9c51/src/context.ts#L15)

___
---

### input

• `Optional` **input**: `TEntity`

#### Defined in

[src/context.ts:13](https://github.com/andersondanilo/jsonapi-fractal/blob/9e4f6c2/src/context.ts#L13)
[src/context.ts:13](https://github.com/andersondanilo/jsonapi-fractal/blob/43f9c51/src/context.ts#L13)

___
---

### options

• `Optional` **options**: [`Options`](../README.md#options)<`TExtraProperties`\>

#### Defined in

[src/context.ts:16](https://github.com/andersondanilo/jsonapi-fractal/blob/9e4f6c2/src/context.ts#L16)
[src/context.ts:16](https://github.com/andersondanilo/jsonapi-fractal/blob/43f9c51/src/context.ts#L16)

___
---

### renderFunction

Expand All @@ -97,27 +97,23 @@ ___

##### Parameters

| Name | Type |
| :------ | :------ |
| `c` | [`Context`](../README.md#context)<`TEntity`, `TExtraProperties`\> |
| Name | Type |
| :--- | :---------------------------------------------------------------- |
| `c` | [`Context`](../README.md#context)<`TEntity`, `TExtraProperties`\> |

##### Returns

[`DocumentObject`](../README.md#documentobject)

#### Defined in

[src/context.ts:18](https://github.com/andersondanilo/jsonapi-fractal/blob/9e4f6c2/src/context.ts#L18)

___
---

### transformer

• `Optional` **transformer**: [`Transformer`](Transformer.md)<`TEntity`, `TExtraProperties`\>

#### Defined in

[src/context.ts:14](https://github.com/andersondanilo/jsonapi-fractal/blob/9e4f6c2/src/context.ts#L14)
[src/context.ts:14](https://github.com/andersondanilo/jsonapi-fractal/blob/43f9c51/src/context.ts#L14)

## Methods

Expand All @@ -131,9 +127,9 @@ ___

#### Defined in

[src/context.ts:60](https://github.com/andersondanilo/jsonapi-fractal/blob/9e4f6c2/src/context.ts#L60)
[src/context.ts:60](https://github.com/andersondanilo/jsonapi-fractal/blob/43f9c51/src/context.ts#L60)

___
---

### toContext

Expand All @@ -145,18 +141,18 @@ ___

#### Defined in

[src/context.ts:43](https://github.com/andersondanilo/jsonapi-fractal/blob/9e4f6c2/src/context.ts#L43)
[src/context.ts:43](https://github.com/andersondanilo/jsonapi-fractal/blob/43f9c51/src/context.ts#L43)

___
---

### withIncluded

▸ **withIncluded**(`included`): [`ContextBuilder`](ContextBuilder.md)<`TEntity`, `TExtraProperties`\>

#### Parameters

| Name | Type |
| :------ | :------ |
| Name | Type |
| :--------- | :-------- |
| `included` | `boolean` |

#### Returns
Expand All @@ -165,18 +161,18 @@ ___

#### Defined in

[src/context.ts:31](https://github.com/andersondanilo/jsonapi-fractal/blob/9e4f6c2/src/context.ts#L31)
[src/context.ts:31](https://github.com/andersondanilo/jsonapi-fractal/blob/43f9c51/src/context.ts#L31)

___
---

### withInput

▸ **withInput**(`input`): [`ContextBuilder`](ContextBuilder.md)<`TEntity`, `TExtraProperties`\>

#### Parameters

| Name | Type |
| :------ | :------ |
| Name | Type |
| :------ | :-------- |
| `input` | `TEntity` |

#### Returns
Expand All @@ -185,18 +181,18 @@ ___

#### Defined in

[src/context.ts:20](https://github.com/andersondanilo/jsonapi-fractal/blob/9e4f6c2/src/context.ts#L20)
[src/context.ts:20](https://github.com/andersondanilo/jsonapi-fractal/blob/43f9c51/src/context.ts#L20)

___
---

### withOptions

▸ **withOptions**(`options`): [`ContextBuilder`](ContextBuilder.md)<`TEntity`, `TExtraProperties`\>

#### Parameters

| Name | Type |
| :------ | :------ |
| Name | Type |
| :-------- | :----------------------------------------------------- |
| `options` | [`Options`](../README.md#options)<`TExtraProperties`\> |

#### Returns
Expand All @@ -205,18 +201,18 @@ ___

#### Defined in

[src/context.ts:37](https://github.com/andersondanilo/jsonapi-fractal/blob/9e4f6c2/src/context.ts#L37)
[src/context.ts:37](https://github.com/andersondanilo/jsonapi-fractal/blob/43f9c51/src/context.ts#L37)

___
---

### withTransformer

▸ **withTransformer**(`transformer`): [`ContextBuilder`](ContextBuilder.md)<`TEntity`, `TExtraProperties`\>

#### Parameters

| Name | Type |
| :------ | :------ |
| Name | Type |
| :------------ | :-------------------------------------------------------------- |
| `transformer` | [`Transformer`](Transformer.md)<`TEntity`, `TExtraProperties`\> |

#### Returns
Expand All @@ -225,4 +221,4 @@ ___

#### Defined in

[src/context.ts:25](https://github.com/andersondanilo/jsonapi-fractal/blob/9e4f6c2/src/context.ts#L25)
[src/context.ts:25](https://github.com/andersondanilo/jsonapi-fractal/blob/43f9c51/src/context.ts#L25)
40 changes: 18 additions & 22 deletions docs/classes/DefaultTransformer.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

## Type parameters

| Name | Type |
| :------ | :------ |
| `TEntity` | `unknown` |
| `TExtraOptions` | `void` |
| Name | Type |
| :-------------- | :-------- |
| `TEntity` | `unknown` |
| `TExtraOptions` | `void` |

## Hierarchy

Expand Down Expand Up @@ -38,25 +38,25 @@

#### Type parameters

| Name | Type |
| :------ | :------ |
| `TEntity` | `unknown` |
| `TExtraOptions` | `void` |
| Name | Type |
| :-------------- | :-------- |
| `TEntity` | `unknown` |
| `TExtraOptions` | `void` |

#### Parameters

| Name | Type | Default value |
| :------ | :------ | :------ |
| `type` | `string` | `undefined` |
| `relationships` | `string`[] \| `Record`<`string`, `string`\> | `[]` |
| Name | Type | Default value |
| :-------------- | :------------------------------------------ | :------------ |
| `type` | `string` | `undefined` |
| `relationships` | `string`[] \| `Record`<`string`, `string`\> | `[]` |

#### Overrides

[Transformer](Transformer.md).[constructor](Transformer.md#constructor)

#### Defined in

[src/default-transformer.ts:8](https://github.com/andersondanilo/jsonapi-fractal/blob/9e4f6c2/src/default-transformer.ts#L8)
[src/default-transformer.ts:8](https://github.com/andersondanilo/jsonapi-fractal/blob/43f9c51/src/default-transformer.ts#L8)

## Properties

Expand All @@ -70,9 +70,9 @@

#### Defined in

[src/default-transformer.ts:6](https://github.com/andersondanilo/jsonapi-fractal/blob/9e4f6c2/src/default-transformer.ts#L6)
[src/default-transformer.ts:6](https://github.com/andersondanilo/jsonapi-fractal/blob/43f9c51/src/default-transformer.ts#L6)

___
---

### type

Expand All @@ -82,10 +82,6 @@ ___

[Transformer](Transformer.md).[type](Transformer.md#type)

#### Defined in

[src/default-transformer.ts:8](https://github.com/andersondanilo/jsonapi-fractal/blob/9e4f6c2/src/default-transformer.ts#L8)

## Methods

### transform
Expand All @@ -94,8 +90,8 @@ ___

#### Parameters

| Name | Type |
| :------ | :------ |
| Name | Type |
| :------- | :---- |
| `entity` | `any` |

#### Returns
Expand All @@ -108,4 +104,4 @@ ___

#### Defined in

[src/default-transformer.ts:28](https://github.com/andersondanilo/jsonapi-fractal/blob/9e4f6c2/src/default-transformer.ts#L28)
[src/default-transformer.ts:28](https://github.com/andersondanilo/jsonapi-fractal/blob/43f9c51/src/default-transformer.ts#L28)
Loading