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
Extends
Properties
depth
depth:
number
The maximum depth for representations of container values (e.g., objects, arrays).
Default
2Inherited from
maxArrayLength
maxArrayLength:
number
The maximum number of array elements to represent before truncating.
Default
100Inherited from
InspectionOptions.maxArrayLength
maxStringLength
maxStringLength:
number
The maximum amount of characters of a string to represent, before replacing the remainder with an ellipsis.
Default
80Inherited 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
60Inherited from
compact
compact:
boolean
true keeps container values on a single line when possible.
Default
trueInherited from
sortKeys
sortKeys:
boolean
true enables the sorting of keys in object representations.
Default
falseInherited from
singleQuotes
singleQuotes:
boolean
true uses single quotes instead of double quotes.
Default
falseInherited from
InspectionOptions.singleQuotes
spaceAfterComma
spaceAfterComma:
boolean
true places a space after every comma.
Default
trueInherited from
InspectionOptions.spaceAfterComma
plugins
plugins:
InspectionPlugin[]
Plugins to extend, override or configure the inspection process.
Inherited from
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?
optionalstring?:string|null
The color to apply to strings.
Default
ANSI.fg.greennumber?
optionalnumber?:string|null
The color to apply to numbers.
Default
ANSI.fg.yellowboolean?
optionalboolean?:string|null
The color to apply to booleans.
Default
ANSI.fg.yellownull?
optionalnull?:string|null
The color to apply to null keywords.
Default
undefined?
optionalundefined?:string|null
The color to apply to undefined keywords.
Default
bigint?
optionalbigint?:string|null
The color to apply to bigints.
Default
ANSI.fg.yellowsymbol?
optionalsymbol?:string|null
The color to apply to symbols.
Default
ANSI.fg.greenfunction?
optionalfunction?:string|null
The color to apply to functions.
Default
ANSI.fg.bluekey?
optionalkey?:string|null
The color to apply to keys.
Default
ANSI.fg.whitedate?
optionaldate?:string|null
The color to apply to dates.
Default
ANSI.fg.magentaregExp?
optionalregExp?:string|null
The color to apply to RegExps.
Default
ANSI.fg.cyanerror?
optionalerror?:string|null
The color to apply to errors.
Default
ANSI.fg.redhtmlTag?
optionalhtmlTag?:string|null
The color to apply to HTML tags.
Default
ANSI.fg.redreactComponent?
optionalreactComponent?:string|null
The color to apply to React components.
Default
ANSI.fg.yellowdelimiter?
optionaldelimiter?:string|null
The color to apply to delimiters.
Default
ANSI.fg.cyanInherited from
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.