# utils/tomap

module

<a id="functions">

## Functions

<a id="function-toMap">

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

Transforms object or iterable to map. Iterable needs to be in the format acceptable by the `Map` constructor.

```typescript
map = toMap( { 'foo': 1, 'bar': 2 } );
map = toMap( [ [ 'foo', 1 ], [ 'bar', 2 ] ] );
map = toMap( anotherMap );
```

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

#### Type parameters

* `T`

#### Parameters

* `data: object | Iterable<readonly [ string, T ]> | null | undefined`

  Object or iterable to transform.

  Properties

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

#### Returns

* `Map<string, T>`

  Map created from data.

---

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