github samchon/typia v3.7.0

latest releases: v6.12.0, v6.11.4, v6.11.3...
19 months ago

From now on, you can add custom validation function utilizing comment tags like below:

typia.customValidators.insert("powerOf")("number")(
    (text: string) => {
        const denominator: number = Math.log(Number(text));
        return (value: number) => {
            value = Math.log(value) / denominator;
            return value === Math.floor(value);
        };
    }
);
typia.customValidators.insert("dollar")("string")(
    () => (value: string) => value.startsWith("$"),
);

interface TagCustom {
   /**
    * @powerOf 10
    */
   powerOf: number;

   /**
    * @dollar
    */
   dollar: string;
}

What's Changed

Full Changelog: v3.6.9...v3.7.0

Don't miss a new typia release

NewReleases is sending notifications on new releases.