Module

utils/toarray

@ckeditor/ckeditor5-utils/src/toarray

module

Filtering

Type Definitions

Functions

  • toArray( data ) → Array<T>

    Transforms any value to an array. If the provided value is already an array, it is returned unchanged.

    Type parameters

    T

    Parameters

    data : ArrayOrItem<T>

    The value to transform to an array.

    Returns

    Array<T>

    An array created from data.

  • toArray( data ) → ReadonlyArray<T>

    Transforms any value to an array. If the provided value is already an array, it is returned unchanged.

    Type parameters

    T

    Parameters

    data : ReadonlyArrayOrItem<T>

    The value to transform to an array.

    Returns

    ReadonlyArray<T>

    An array created from data.