Skip to content

Interface ResolvedInspectionOptions ​

Source: inspect.ts

The resolved inspection options combined with some utility functions for generating string representations.

Used internally by the inspection utilities and InspectionPlugins.

See ​

inspect

Extends ​

Properties ​

depth ​

depth: number

The maximum depth for representations of container values (e.g., objects, arrays).

Default ​

ts
2

Inherited from ​

InspectionOptions.depth


maxArrayLength ​

maxArrayLength: number

The maximum number of array elements to represent before truncating.

Default ​

ts
100

Inherited from ​

InspectionOptions.maxArrayLength


maxStringLength ​

maxStringLength: number

The maximum amount of characters of a string to represent, before replacing the remainder with an ellipsis.

Default ​

ts
80

Inherited from ​

InspectionOptions.maxStringLength


breakLength ​

breakLength: number

The maximum line length before wrapping to a new line.

This option is ignored when compact is set to true.

Default ​

ts
60

Inherited from ​

InspectionOptions.breakLength


compact ​

compact: boolean

true keeps container values on a single line when possible.

Default ​

ts
true

Inherited from ​

InspectionOptions.compact


sortKeys ​

sortKeys: boolean

true enables the sorting of keys in object representations.

Default ​

ts
false

Inherited from ​

InspectionOptions.sortKeys


singleQuotes ​

singleQuotes: boolean

true uses single quotes instead of double quotes.

Default ​

ts
false

Inherited from ​

InspectionOptions.singleQuotes


spaceAfterComma ​

spaceAfterComma: boolean

true places a space after every comma.

Default ​

ts
true

Inherited from ​

InspectionOptions.spaceAfterComma


plugins ​

plugins: InspectionPlugin[]

Plugins to extend, override or configure the inspection process.

Inherited from ​

InspectionOptions.plugins


colors ​

colors: false | { string?: string | null; number?: string | null; boolean?: string | null; null?: string | null; undefined?: string | null; bigint?: string | null; symbol?: string | null; function?: string | null; key?: string | null; date?: string | null; regExp?: string | null; error?: string | null; htmlTag?: string | null; reactComponent?: string | null; delimiter?: string | null; }

The ANSI color codes for different symbols.

Set to false to disable ANSI colors.

Union Members ​

false


Type Literal ​

{ string?: string | null; number?: string | null; boolean?: string | null; null?: string | null; undefined?: string | null; bigint?: string | null; symbol?: string | null; function?: string | null; key?: string | null; date?: string | null; regExp?: string | null; error?: string | null; htmlTag?: string | null; reactComponent?: string | null; delimiter?: string | null; }

string? ​

optional string?: string | null

The color to apply to strings.

Default ​
ts
ANSI.fg.green
number? ​

optional number?: string | null

The color to apply to numbers.

Default ​
ts
ANSI.fg.yellow
boolean? ​

optional boolean?: string | null

The color to apply to booleans.

Default ​
ts
ANSI.fg.yellow
null? ​

optional null?: string | null

The color to apply to null keywords.

Default ​
ts
ANSI.decoration.dim + ANSI.fg.yellow
undefined? ​

optional undefined?: string | null

The color to apply to undefined keywords.

Default ​
ts
ANSI.decoration.dim + ANSI.fg.yellow
bigint? ​

optional bigint?: string | null

The color to apply to bigints.

Default ​
ts
ANSI.fg.yellow
symbol? ​

optional symbol?: string | null

The color to apply to symbols.

Default ​
ts
ANSI.fg.green
function? ​

optional function?: string | null

The color to apply to functions.

Default ​
ts
ANSI.fg.blue
key? ​

optional key?: string | null

The color to apply to keys.

Default ​
ts
ANSI.fg.white
date? ​

optional date?: string | null

The color to apply to dates.

Default ​
ts
ANSI.fg.magenta
regExp? ​

optional regExp?: string | null

The color to apply to RegExps.

Default ​
ts
ANSI.fg.cyan
error? ​

optional error?: string | null

The color to apply to errors.

Default ​
ts
ANSI.fg.red
htmlTag? ​

optional htmlTag?: string | null

The color to apply to HTML tags.

Default ​
ts
ANSI.fg.red
reactComponent? ​

optional reactComponent?: string | null

The color to apply to React components.

Default ​
ts
ANSI.fg.yellow
delimiter? ​

optional delimiter?: string | null

The color to apply to delimiters.

Default ​
ts
ANSI.fg.cyan

Inherited from ​

InspectionOptions.colors


delimiter ​

delimiter: (delimiter: string) => string

Returns a formatted delimiter string.

Parameters ​

delimiter ​

string

The raw delimiter.

Returns ​

string


separator ​

separator: () => string

Returns a formatted separator string.

Returns ​

string


color ​

color: (text: string, colorCode: string | null | undefined) => string

Applies color to the given string, if ResolvedInspectionOptions.colors is true.

Parameters ​

text ​

string

The raw text.

colorCode ​

string | null | undefined

The ANSI color code to apply.

Returns ​

string


token ​

token: (token: string, type?: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "function" | "key" | "null" | "date" | "regExp" | "error" | "htmlTag" | "reactComponent" | "delimiter") => string

Applies the appropriate formatting to the given token.

Parameters ​

token ​

string

The raw token.

type? ​

"string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "function" | "key" | "null" | "date" | "regExp" | "error" | "htmlTag" | "reactComponent" | "delimiter"

The type of token.

Returns ​

string


fork ​

fork: () => ResolvedInspectionOptions

Creates a new inspection context and increments the current depth.

Returns ​

ResolvedInspectionOptions

Built by Prozilla