import { as } from "https://deno.land/x/ayonli_jsext@v0.9.72/json/index.ts";
Converts the data into the given type.
This function is primarily used in parseAs and shares the same conversion rules, but it
can be used in other scenarios too, for example, inside the fromJSON
function.
Parameters
type: Constructor<T> & { fromJSON?(data: any): T; }