Module

utils/objecttomap

@ckeditor/ckeditor5-utils/src/objecttomap

module

Filtering

Functions

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

    Transforms object to map.

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

    Note: For mixed data (Object or Iterable) there's a dedicated toMap function.

    Type parameters

    T

    Parameters

    obj : undefined | null | object

    Object to transform.

    Properties
    obj[key: string] : T

    Returns

    Map<string, T>

    Map created from object.