> For the complete documentation index, see [llms.txt](https://aerocode.gitbook.io/tynamo/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aerocode.gitbook.io/tynamo/tynamo-1/mapper/deformation-api/deformation.md).

# deformation

### Spec

```typescript
deformation<TTarget>(
    target: AttributeMap, 
    RootTClass: ClassCapture<TTarget>
): TTarget
```

Convert AttributeMap to DynamoEntity.

### Input

| Name       | Type                    | Information                        |
| ---------- | ----------------------- | ---------------------------------- |
| target     | `AttributeMap`          | AttributeMap to convert to entity. |
| RootTClass | `ClassCapture<TTarget>` | Reference of `@DynamoEntity` class |

{% hint style="warning" %}
An error is occurs, if the `target` is null or undefined.
{% endhint %}

{% hint style="info" %}
The deformation allows null of non-nullable property.&#x20;
{% endhint %}

### Example

```typescript
const entity: Cat = Mapper.deformation(
    {
        id: { N: "666" }
    },
    Cat
);
```

It will be deformationed as,

```typescript
Cat {
    "id": 666
}
```

### Internal Logic

Use the `deformatProperty` method to perform a deformation on all the properties, then merge all the results.
