samchon / typia

Super-fast/easy runtime validations and serializations through transformation
https://typia.io/
MIT License
4.14k stars 145 forks source link

Any Stringified<T> type for JSON.stringify() in typia? #1013

Open tungrix opened 2 months ago

tungrix commented 2 months ago

I am reading a stringified from somewhere else and wish to declare its type before JSON.parse(), so x won't be any type.

interface Foo {
  x: number;
  y: string;
}
const foo: Stringified<Foo> = "{x:3,y:'abc'}"
const x = JSON.parse(foo)

Is there any similar type in typia can achieve this? Reference

samchon commented 2 months ago

Will you design the Stringified<T> type? I can't imagine it.