Skip to main content Link Search Menu Expand Document (external link)

fluentToResourceData() function

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Compile a Fluent resource (i.e. an FTL file) into a Map of Message data objects.

Signature:

export declare function fluentToResourceData(source: string | Fluent.Resource): {
    data: Map<string, Message>;
    comments: string;
};

Parameters

Parameter Type Description
source string | Fluent.Resource A Fluent resource, as the string contents of an FTL file or as a Fluent.Resource

Returns:

{ data: Map<string, Message>; comments: string; }

An object containing the messages as data and any resource-level comments of the resource.