Skip to main content

InspectOptions (interface)​

npm: @suchipi/print@2.5.0. License: ISC

Options for inspect.

declare interface InspectOptions {
all?: boolean;
followGetters?: boolean;
indexes?: boolean;
maxDepth?: number;
noAmp?: boolean;
noHex?: boolean;
noSource?: boolean;
proto?: boolean;
sort?: boolean;
colours?: boolean | 256 | 8 | InspectColours;
indent?: string;
}

InspectOptions.all (boolean property)​

Whether to display non-enumerable properties. Defaults to false.

all?: boolean;

InspectOptions.followGetters (boolean property)​

Whether to invoke getter functions. Defaults to false.

followGetters?: boolean;

InspectOptions.indexes (boolean property)​

Whether to display the indexes of iterable entries. Defaults to false.

indexes?: boolean;

InspectOptions.maxDepth (number property)​

Hide object details after 𝑁 recursions. Defaults to Infinity.

maxDepth?: number;

InspectOptions.noAmp (boolean property)​

If true, don't identify well-known symbols as @@…. Defaults to false.

noAmp?: boolean;

InspectOptions.noHex (boolean property)​

If true, don't format byte-arrays as hexadecimal. Defaults to false.

noHex?: boolean;

InspectOptions.noSource (boolean property)​

If true, don't display function source code. Defaults to false.

noSource?: boolean;

InspectOptions.proto (boolean property)​

Whether to show __proto__ properties if possible. Defaults to false.

proto?: boolean;

InspectOptions.sort (boolean property)​

Whether to sort properties alphabetically. When false, properties are sorted by creation order. Defaults to false.

sort?: boolean;

InspectOptions.colours (property)​

Options that control whether and how ANSI terminal escape sequences for colours should be added to the output. Defaults to false, meaning no colours.

colours?: boolean | 256 | 8 | InspectColours;

InspectOptions.indent (string property)​

Prefix string to use for indentation. Defaults to '\t'.

indent?: string;

InspectColours (interface)​

declare interface InspectColours {
off?: string | number;
red?: string | number;
grey?: string | number;
green?: string | number;
darkGreen?: string | number;
punct?: string | number;
keys?: string | number;
keyEscape?: string | number;
typeColour?: string | number;
primitive?: string | number;
escape?: string | number;
date?: string | number;
hexBorder?: string | number;
hexValue?: string | number;
hexOffset?: string | number;
reference?: string | number;
srcBorder?: string | number;
srcRowNum?: string | number;
srcRowText?: string | number;
nul?: string | number;
nulProt?: string | number;
undef?: string | number;
noExts?: string | number;
frozen?: string | number;
sealed?: string | number;
regex?: string | number;
string?: string | number;
symbol?: string | number;
symbolFade?: string | number;
braces?: string | number;
quotes?: string | number;
empty?: string | number;
dot?: string | number;
}

InspectColours.off (property)​

off?: string | number;

InspectColours.red (property)​

red?: string | number;

InspectColours.grey (property)​

grey?: string | number;

InspectColours.green (property)​

green?: string | number;

InspectColours.darkGreen (property)​

darkGreen?: string | number;

InspectColours.punct (property)​

punct?: string | number;

InspectColours.keys (property)​

keys?: string | number;

InspectColours.keyEscape (property)​

keyEscape?: string | number;

InspectColours.typeColour (property)​

typeColour?: string | number;

InspectColours.primitive (property)​

primitive?: string | number;

InspectColours.escape (property)​

escape?: string | number;

InspectColours.date (property)​

date?: string | number;

InspectColours.hexBorder (property)​

hexBorder?: string | number;

InspectColours.hexValue (property)​

hexValue?: string | number;

InspectColours.hexOffset (property)​

hexOffset?: string | number;

InspectColours.reference (property)​

reference?: string | number;

InspectColours.srcBorder (property)​

srcBorder?: string | number;

InspectColours.srcRowNum (property)​

srcRowNum?: string | number;

InspectColours.srcRowText (property)​

srcRowText?: string | number;

InspectColours.nul (property)​

nul?: string | number;

InspectColours.nulProt (property)​

nulProt?: string | number;

InspectColours.undef (property)​

undef?: string | number;

InspectColours.noExts (property)​

noExts?: string | number;

InspectColours.frozen (property)​

frozen?: string | number;

InspectColours.sealed (property)​

sealed?: string | number;

InspectColours.regex (property)​

regex?: string | number;

InspectColours.string (property)​

string?: string | number;

InspectColours.symbol (property)​

symbol?: string | number;

InspectColours.symbolFade (property)​

symbolFade?: string | number;

InspectColours.braces (property)​

braces?: string | number;

InspectColours.quotes (property)​

quotes?: string | number;

InspectColours.empty (property)​

empty?: string | number;

InspectColours.dot (property)​

dot?: string | number;

InspectFunction (interface)​

declare interface InspectFunction {
(value: any, options?: InspectOptions): string;
(value: any, key?: string | symbol, options?: InspectOptions): string;
custom: symbol;
}

InspectFunction(...) (call signature)​

Generate a human-readable representation of a value.

  • @param value — Value to inspect
  • @param options — Additional settings for refining output
  • @returns A string representation of value.
(value: any, options?: InspectOptions): string;

InspectFunction(...) (call signature)​

Generate a human-readable representation of a value.

  • @param value — Value to inspect
  • @param key — The value's corresponding member name
  • @param options — Additional settings for refining output
  • @returns A string representation of value.
(value: any, key?: string | symbol, options?: InspectOptions): string;

InspectFunction.custom (symbol property)​

A symbol which can be used to customize how an object gets printed.

custom: symbol;

inspect (InspectFunction)​

Generate a human-readable representation of a value.

  • @param value — Value to inspect
  • @param key — The value's corresponding member name
  • @param options — Additional settings for refining output
  • @returns A string representation of value.

InspectCustomInputs (interface)​

declare interface InspectCustomInputs {
key: string | symbol;
type: string;
brackets: [string, string];
oneLine: boolean;
linesBefore: Array<string>;
linesAfter: Array<string>;
propLines: Array<string>;
readonly tooDeep: boolean;
indent: string;
typeSuffix: string;
colours: { [Key in keyof Required<InspectColours>]: string };
}

InspectCustomInputs.key (property)​

key: string | symbol;

InspectCustomInputs.type (string property)​

type: string;

InspectCustomInputs.brackets (property)​

brackets: [string, string];

InspectCustomInputs.oneLine (boolean property)​

oneLine: boolean;

InspectCustomInputs.linesBefore (property)​

linesBefore: Array<string>;

InspectCustomInputs.linesAfter (property)​

linesAfter: Array<string>;

InspectCustomInputs.propLines (property)​

propLines: Array<string>;

InspectCustomInputs.tooDeep (readonly boolean property)​

readonly tooDeep: boolean;

InspectCustomInputs.indent (string property)​

indent: string;

InspectCustomInputs.typeSuffix (string property)​

typeSuffix: string;

InspectCustomInputs.opts (InspectOptions property)​

InspectCustomInputs.colours (property)​

colours: { [Key in keyof Required<InspectColours>]: string };