iniquity

A re-imagining of the iconic BBS software.

View on GitHub

Module: runtime/mci/formatters

Format Modifiers

Summary

Synchronet-style format modifiers (L/R/C/Z/W/T/U)

Table of contents

Interfaces

Type Aliases

Functions

Type Aliases

FormatModifier

Ƭ FormatModifier: "L" | "R" | "C" | "Z" | "W" | "T" | "U" | ">"

Defined in

core/src/mci/formatters.ts:27

Functions

addThousandsSeparator

▸ addThousandsSeparator(text, separator?): string

Parameters

Name Type Default value
text string undefined
separator string ","

Returns

string

Defined in

core/src/mci/formatters.ts:148


applyFormat

▸ applyFormat(value, options): string

Parameters

Name Type
value string
options FormatOptions

Returns

string

Defined in

core/src/mci/formatters.ts:72


center

▸ center(text, width): string

Parameters

Name Type
text string
width number

Returns

string

Defined in

core/src/mci/formatters.ts:125


leftJustify

▸ leftJustify(text, width): string

Parameters

Name Type
text string
width number

Returns

string

Defined in

core/src/mci/formatters.ts:111


padToVisibleWidth

▸ padToVisibleWidth(text, width, align?): string

Parameters

Name Type Default value
text string undefined
width number undefined
align "left" | "right" | "center" "left"

Returns

string

Defined in

core/src/mci/formatters.ts:290


parseFormatModifier

▸ parseFormatModifier(codeWithModifier): ParsedFormat

Parameters

Name Type
codeWithModifier string

Returns

ParsedFormat

Defined in

core/src/mci/formatters.ts:42


rightJustify

▸ rightJustify(text, width): string

Parameters

Name Type
text string
width number

Returns

string

Defined in

core/src/mci/formatters.ts:118


stripAnsi

▸ stripAnsi(text): string

Parameters

Name Type
text string

Returns

string

Defined in

core/src/mci/formatters.ts:282


toFullWidth

▸ toFullWidth(text): string

Parameters

Name Type
text string

Returns

string

Defined in

core/src/mci/formatters.ts:255


toHalfWidth

▸ toHalfWidth(text): string

Parameters

Name Type
text string

Returns

string

Defined in

core/src/mci/formatters.ts:263


truncate

▸ truncate(text, maxLength, ellipsis?): string

Parameters

Name Type Default value
text string undefined
maxLength number undefined
ellipsis string "..."

Returns

string

Defined in

core/src/mci/formatters.ts:276


visibleLength

▸ visibleLength(text): number

Parameters

Name Type
text string

Returns

number

Defined in

core/src/mci/formatters.ts:286


zeroPad

▸ zeroPad(text, width): string

Parameters

Name Type
text string
width number

Returns

string

Defined in

core/src/mci/formatters.ts:135