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:7

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:128


applyFormat

applyFormat(value, options): string

Parameters

Name Type
value string
options FormatOptions

Returns

string

Defined in

core/src/mci/formatters.ts:52


center

center(text, width): string

Parameters

Name Type
text string
width number

Returns

string

Defined in

core/src/mci/formatters.ts:105


leftJustify

leftJustify(text, width): string

Parameters

Name Type
text string
width number

Returns

string

Defined in

core/src/mci/formatters.ts:91


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:270


parseFormatModifier

parseFormatModifier(codeWithModifier): ParsedFormat

Parameters

Name Type
codeWithModifier string

Returns

ParsedFormat

Defined in

core/src/mci/formatters.ts:22


rightJustify

rightJustify(text, width): string

Parameters

Name Type
text string
width number

Returns

string

Defined in

core/src/mci/formatters.ts:98


stripAnsi

stripAnsi(text): string

Parameters

Name Type
text string

Returns

string

Defined in

core/src/mci/formatters.ts:262


toFullWidth

toFullWidth(text): string

Parameters

Name Type
text string

Returns

string

Defined in

core/src/mci/formatters.ts:235


toHalfWidth

toHalfWidth(text): string

Parameters

Name Type
text string

Returns

string

Defined in

core/src/mci/formatters.ts:243


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:256


visibleLength

visibleLength(text): number

Parameters

Name Type
text string

Returns

number

Defined in

core/src/mci/formatters.ts:266


zeroPad

zeroPad(text, width): string

Parameters

Name Type
text string
width number

Returns

string

Defined in

core/src/mci/formatters.ts:115