Skip to content

ArrayFormatterConfig

Options for controlling how arrays are formatted.

delimiters: object

Bracket delimiters

close: string

open: string

'[]'

maxInlineItems: number

Max items for inline output.

10

maxInlineLength: number

Max total characters for inline output.

40

maxItems: number

Max items to show in multiline output.

100

overflowMessage: (length, remaining) => string

Called when items are truncated

number

number

string


prefix: string

Prefix for array items. Can be used to create YAML formatter.

''

separator: string

Separator for multline output

','

separatorInline: string

Separator for inline output

', '

shouldInline: (arr) => boolean

Custom hook to force inline.

unknown[]

boolean


sparseArrayEmptyElement: string

String represents empty sparse array entry.

'<empty>'

trailingComma: boolean

Include a trailing comma in multiline.

false