Skip to main content
Version: 1.8.0

MessageFormatFuncMap

A mapping of formatter functions.

Syntax

{
  [name]: (args: MessageArg[], options: String[]) => string
}

Example

import { MessageArg, MessageFormatFuncMap } from '@phensley/messageformat';

const FORMATTERS: MessageFormatFuncMap = {
foo: (args: MessageArg[], options: string[]) =>
options[0] === 'upper' ? args[0].toUpperCase() : args[1].toLowerCase()
};

log(FORMATTERS.foo(['hello'], ['upper']));
HELLO