Any
The Any
type represents any type.
type.Any
Like an identity function, type.Any
is a TypeObject that allows any type of a value to be allowed without checking or coercion.
import { Reflect, type } from "can/everything";
let val = Reflect.convert(42, type.Any);
console.log(val); // -> 42
val = Reflect.convert(null, type.Any);
console.log(val); // -> null
val = Reflect.convert([], type.Any);
console.log(val); // -> []
val = Reflect.convert(new Date(), type.Any);
console.log(val); // Date()
type.Any
returns the same instance as passed into convert so they are referentially identical.
import { Reflect, type } from "can/everything";
let today = new Date();
let val = Reflect.convert(today, type.Any);
console.log(val); // today