Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional type, different argument for function in encode and decode #58

Open
Zehir opened this issue Feb 19, 2023 · 0 comments
Open

Optional type, different argument for function in encode and decode #58

Zehir opened this issue Feb 19, 2023 · 0 comments

Comments

@Zehir
Copy link

Zehir commented Feb 19, 2023

Hello,

For some reason I get different params format when encoding and decoding data.

For example;

data: new r.Optional(new r.String('size', 'utf8'), (parent) => {
  console.log(parent)
  return !isBinaryType(parent.val?.type ?? parent.type)
}),

When encoding I get :
image
But when decoding I get :
image

So when I decoding I get the .val that I get in encoding

I that expected ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant