maybeStringify(val, indent)
If the provided value is a string, return it unchanged. Otherwise encode it with JSON.stringify
and return the result.
-
val
any
— value to be stringified (maybe)
-
indent
number
— number of spaces used to indent the JSON object
(default: 2
)
See
-
isString
—
used by this function to determine whether or not to process the value
-
acEx
—
uses this function to produce the string representation of the actual and expected values
-
Tap
—
uses this function as the default implementation of the Tap.messageToString
method
Examples