TypeTool
- To Do:
-
(#344) WIP
Methods
-
addReprFunc(type, func)
-
Parameters:
Name Type Description typestring Type of interest.
funcmodule:xunit.TypeTool~ReprFunc Function for this type.
-
getReprFunc(item) → {module:xunit.TypeTool~ReprFunc}
-
Find a ReprFunc for the given item.
Parameters:
Name Type Description itemobject Item of interest.
-
getType(item) → {string}
-
Attempt to get the type of item.
This is NOT equivalent to the built-in
typeofoperator. Hence, results are explicitly NOT lower-cased in order to reduce chances of conflicts.Parameters:
Name Type Description itemobject Item to inspect.
Returns:
string -The likely type of item.
-
repr(item) → {string}
-
Returns a string representation of the item using the registration system.
Parameters:
Name Type Description itemobject Anything.
Returns:
string -String version of item.
-
reprArray(array) → {string}
-
Parameters:
Name Type Description arrayArray.<object> Array of anything.
Returns:
string -String version of item.
- Implements:
-
reprMap(map) → {string}
-
Parameters:
Name Type Description mapMap.<object, object> Any Map.
Returns:
string -String version of map.
- Implements:
-
reprObject(obj) → {string}
-
Parameters:
Name Type Description objobject Any object.
Returns:
string -String version of obj.
- Implements:
-
reprSet(set) → {string}
-
Parameters:
Name Type Description setSet.<object> Any Set.
Returns:
string -String version of set.
- Implements:
-
reprString(item) → {string}
-
Parameters:
Name Type Description itemstring String to wrap.
Returns:
string -Wrapped version of item.
- Implements:
Type Definitions
-
ReprFunc(item) → {string}
-
Parameters:
Name Type Description itemobject Anything.
Returns:
string -String version of item.