Experimental
Experimental
Passing the variable to inspect within an single-prop object
Function
Experimental
mergeAn alias for this package's mergeArgs().
Inputs can be undefined, and if so, the default is returned.
Default object type.
Default values (if not specified in inputs).
Optional
inputs: undefinedOverriding values (changes to make).
Optional
recursive: booleanOptional. Whether to merge the object recursively. Default false.
Resulting object with all the defaults
and inputs
keys with
either default values or input values, as appropriate.
Passing recursive
as false means that the input type must be a Partial
(not RecursivePartial).
Optional
recursive: falsePassing recursive
as true means that the input type may actually be a
RecursivePartial.
Universal overload.
Optional
inputs: IOptional
recursive: booleanProtected
Readonly
Experimental
_nameValue’s name, used in output.
Protected
Readonly
Experimental
_propertiesThese are the properties of the input object, if any.
Protected
Readonly
Experimental
_rawValue to inspect.
Protected
Readonly
Experimental
_typeAlias for this.typeOf( this._rawValue ).
Static
sampleInternal
Used for testing.
Private
Static
_testInternal
Used for testing.
Experimental
Experimental
Build a complete args object.
Optional
args: Partial<VariableInspector.Args> | RecursivePartial<VariableInspector.Args>Experimental
Prefix to print, not including the VariableInspector.type.
Optional. Whether to skip the formatter functions. Default false.
Experimental
String to print for variable type.
In the case of non-Object objects with a constructor, the class name is displayed.
Optional. Whether to skip the formatter functions. Default false.
Experimental
Representation of the variable’s value to print, not including the VariableInspector.type or VariableInspector.prefix.
Optional. Whether to skip the formatter functions. Default false.
Experimental
Print the contents to the console.
Experimental
Overrides the default function to return a string representation of the inspected variable’s value.
Protected
formatterExperimental
Applies any formatting functions as defined in the args.
The stage being formatted.
Value to format.
Formatted value.
Protected
keyExperimental
Formats an object property name into a string for display.
Protected
getExperimental
Builds an array of the property names. Used by VariableInspector.indexProperties
Protected
indexExperimental
Builds an array of the properties for the current VariableInspector._rawValue| this._rawValue().
Protected
_newExperimental
Returns an instance of this class that inherits this instances’s args.
Meant for children/recursion of this inspection.
Static
dumpExperimental
Alias for new VariableInspector( ...).dump()
.
Static
sampleExperimental
Prints sample output to the console via VariableInspector.dump().
An example, constructed instance for a sample object.
Static
stringifyExperimental
Alias for new VariableInspector( ...).toString()
.
Protected
Static
validateProtected
_valueExperimental
Creates a readable representation of VariableInspector._rawValue as if its type is object (including arrays).
Private
Static
_testInternal
Used for testing.
Inspects the value of a variable for debugging.
Can statically return a readable string (VariableInspector.stringify) or output it straight to console (VariableInspector.dump). By constructing an instance, you can get individual parts of the output inspection (VariableInspector.prefix, VariableInspector.type, VariableInspector.value) or get a json-compatible object representing the inspected value VariableInspector.toJSON.
Since
0.1.1
Example