Skip to content

TypeAlias.Formatter

github-actions[bot] edited this page Jun 9, 2026 · 33 revisions

umt / Formatter

Type Alias: Formatter

Formatter = (value, ...arguments_) => string

Defined in: types/string/formatString/formatter.ts:13

Function type for formatString formatter functions.

Parameters

value

unknown

The value to be formatted

arguments_

...string[]

Additional string arguments passed to the formatter

Returns

string

Formatted string representation of the value

Example

const upperFormatter: Formatter = (value) => String(value).toUpperCase();
const padFormatter: Formatter = (value, length = "2", char = "0") =>
  String(value).padStart(Number(length), char);

API

Classes

Interfaces

Type Aliases

Variables

Functions

Clone this wiki locally