# utils/objecttomap

module

<a id="functions">

## Functions

<a id="function-objectToMap">

### `objectToMap( obj = { obj.[key: string] } ) → Map<string, T>`

Transforms object to map.

```typescript
const map = objectToMap( { 'foo': 1, 'bar': 2 } );
map.get( 'foo' ); // 1
```

**Note**: For mixed data (`Object` or `Iterable`) there's a dedicated [`toMap`](module_utils_tomap.md#function-toMap) function.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-utils/src/objecttomap.ts#L23)

#### Type parameters

* `T`

#### Parameters

* `obj: object | null | undefined`

  Object to transform.

  Properties

  * `obj.[key: string]: T`

#### Returns

* `Map<string, T>`

  Map created from object.

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
