samchon / typia

Super-fast/easy runtime validators and serializers via transformation
https://typia.io/
MIT License
4.49k stars 156 forks source link

What's the field "value" in the validator customization for ? #1220

Open bogeeee opened 1 month ago

bogeeee commented 1 month ago

Hi

From the Example here in the docs:

type Postfix<Value extends string> = typia.tags.TagBase<{
  kind: "postfix";
  target: "string";
  value: Value;
  validate: `$input.endsWith("${Value}")`;
}>;

The line: value: Value; seems to be pretty meaningless to me. I don't see where it's for and when i change it to value: undefined;, it works the same way.

samchon commented 1 month ago

It is a legacy spec. so that better to deprecate it.

bogeeee commented 1 month ago

Do you mean only the value field is legacy ? I'm still relying on the TagBase feature or i'd need something similar in my project.

samchon commented 1 month ago

The value property would be erased at v7 next major update.