Creates an instance of MismatchInfo, takes on object with data properties. You will never used it, it is used only internally.
Object which contains data about type mismatch.
Value that failed to conform to the expectedTd
.
TypeDescription that actualValue
was expected to conform to.
An array of numbers and strings which defines a path to suspect's
invalid actualValue
.
@remarks
E.g. if suspect.foo.bar[3][5] failed to match to the expectedTd
,
then path would be [ 'foo', 'bar', 3, 5 ]
.
Returns path converted to a human readable JavaScript property access notation string if match was failed. Returned string begins with the 'root' as the root object to access the properties.
Returns a string of form: "value (JSON.stringify(actualValue)) at path 'pathString()' doesn't exactly conform to the given type description (stringifyTd(expectedTd))"
Generated using TypeDoc
Represents the result of running
mismatch(suspect, typeDescr)
orduckMismatch(suspect, typeDescr)
functions.It contains information about why suspect doesn't conform to the given
typeDescr
: the actual value, expected type description and a property path to unexpected value type.