Module

utils/tomap

@ckeditor/ckeditor5-utils/src/tomap

module

Filtering

Functions

  • 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.

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

    Type parameters

    T

    Parameters

    data : undefined | null | object | Iterable<readonly tuple>

    Object or iterable to transform.

    Properties
    data[key: string] : T

    Returns

    Map<string, T>

    Map created from data.