Skip to content

TypeAlias.FormatData

github-actions[bot] edited this page May 21, 2026 · 33 revisions

umt / FormatData

Type Alias: FormatData

FormatData = Record<string, unknown> | FormatValue[]

Defined in: types/string/formatString/formatData.ts:18

Data structure for formatString input.

Can be either an object for named placeholders or an array for indexed placeholders.

Examples

// Object for named placeholders
const namedData: FormatData = { name: "Alice", age: 25 };
formatString("Hello {name}, age {age}", namedData);
// Array for indexed placeholders
const indexedData: FormatData = ["Alice", 25];
formatString("Hello {0}, age {1}", ...indexedData);

API

Classes

Interfaces

Type Aliases

Variables

Functions

Clone this wiki locally