fluentToResourceData() function

This API is provided as a beta 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, options?: FluentToMessageOptions): {
    data: FluentMessageResourceData;
    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
options FluentToMessageOptions (Optional)

Returns:

{ data: FluentMessageResourceData; comments: string; }

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