import { type } from "https://deno.land/x/ayonli_jsext@v0.9.72/esm/json/index.js";
A decorator to instruct that the target property in the class is of a specific type.
When parsing JSON via parseAs, this property is guaranteed to be of the given type.
NOTE: This decorator only supports TypeScript's experimentalDecorators
.
Examples
Example 1
Example 1
import { type } from "@ayonli/jsext/json";
class Example {
\ (Date)
date: Date;
}