normalize
Given any type, ensure a TypeObject is created for it.
type.normalize(Type)
Given any Type, including builtin types such as Date
and Number
, returns a TypeObject. For builtin constructors type.normalize
returns a strict type for that constructor.
import { type } from "can/everything";
const normalizedType = type.normalize(Date);
const dateStrictType = type.check(Date);
// normalizedType and dateStrictType are equivalent.
Parameters
- Type
{Object|function}
:Anything, but usually an object of some sort.