const T = Type
.Transform(Type.Number())
.Decode((value) => new Date(value)) // decode: number to Date
.Encode((value) => value.getTime()); // encode: Date to number
const D = Value.Decode(T, 0); // const D = Date(1970-01-01T00:00:00.000Z)
const E = Value.Encode(T, D);
no errors such as in original typebox example
What do you see instead?
Argument of type 'TTransform<TString, number>' is not assignable to parameter of type 'TSchema'.
Property '[Kind]' is missing in type 'TTransform<TString, number>' but required in type 'TSchema'.ts(2345)
schema.d.ts(21, 5): '[Kind]' is declared here.
Additional information
I am trying to make type casting in returning values. I would like to obfuacate my id from data base from Integers to Strings. I think that its possible to make it with typebox cause it do the same thing in incoming body, query, params requests. It make typecasting with some values such as integers.
I even tried to make this and it still doesnt work
What version of Elysia is running?
1.1.20
What platform is your computer?
Microsoft Windows NT 10.0.19045.0 x64
What steps can reproduce the bug?
What is the expected behavior?
no errors such as in original typebox example
What do you see instead?
Additional information
I am trying to make type casting in returning values. I would like to obfuacate my id from data base from Integers to Strings. I think that its possible to make it with typebox cause it do the same thing in incoming body, query, params requests. It make typecasting with some values such as integers.
I even tried to make this and it still doesnt work
Very close to https://github.com/elysiajs/elysia/issues/873
Have you try removing the
node_modules
andbun.lockb
and try again yet?yes