can-util/js/types/types
module
A stateful container for CanJS type information.
Object
Use
can-util/js/types/types exports an object with placeholder functions that
can be used to provide default types or test if something is of a certain type.
This is where the sausage of loose coupling modules takes place. Modules that provide a type will overwrite one or multiple of these functions so they take into account the new type.
For example, can-define/map/map might overwrite isMapLike to return true
if the object is an instance of Map:
var types = require("can-util/js/types/types");
var oldIsMapLike = types.isMapLike;
types.isMapLike = function(obj){
return obj instanceof DefineMap || oldIsMapLike.apply(this, arguments);
};
types.DefaultMap = DefineMap;