---
url: "https://vueda.dev/v3/reference/api/js/utils/getTypeMapping/functions/getTypeMapping.md"
title: "getTypeMapping"
---

# getTypeMapping

## Overview

Resolve the mapping for a field's `typeSerializer`, falling back to the serializer's default entry when `typeModel` is unknown.

## Signature

`getTypeMapping(mapping, field)`

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| <span id="param-mapping">mapping</span> | `object` | yes | The mapping object keyed by typeSerializer and typeModel. |
| <span id="param-field">field</span> | [FieldInfo](/v3/reference/api/js/stores/storeModelInfo/types/FieldInfo.md) | yes | Field info containing the typeSerializer/typeModel. |

### Returns

`T`

The matched mapping or the default entry for the serializer.

## Source

`client/lib/utils/getTypeMapping.js:15`
