typia
typia copied to clipboard
Reuse `is` functions for code size
Feature Request
Reuse already created is given as an argument to reduce the code size of is for large interfaces.
Idea
Typia works without this, so I think it acceptable to have strict conditions.
- If it's not the type you're looking for, ignore it.
- Ignore variable symbols even if they do not appear.
ex:)
typia.is<User>(),validators.user - Ignore any cases beginning with
_,$.
Example
import typia from "typia";
interface User {
name: string;
homepage: string;
age: number;
}
interface Comment {
author: User;
content: string
}
interface Article {
author: User;
content: string;
comments: Comment[]
}
const isUser = typia.createIs<User>();
const isComment = typia.createIs<Comment>(isUser);
const isArticle = typia.createIs<Article>(isUser, isComment);
I have no idea about this way. Would you challenge about this issue?
Close due to no challenge.