const ArrToStr = S.Uint8Array.pipe(
S.transform(
S.string,
(arr) => new TextDecoder().decode(arr),
(str) => new TextEncoder().encode(str)
)
)
export class Req extends S.TaggedRequest<Req>()('req', S.string, S.string, {
arr: ArrToStr
}) {}
// how can I pass a Uint8Array here
new Req({ arr: new Uint8Array() })
const ArrToStr = S.Uint8Array.pipe(
S.transform(
S.string,
(arr) => new TextDecoder().decode(arr),
(str) => new TextEncoder().encode(str)
)
)
export class Req extends S.TaggedRequest<Req>()('req', S.string, S.string, {
arr: ArrToStr
}) {}
// how can I pass a Uint8Array here
new Req({ arr: new Uint8Array() })