Skip to content

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

@Zehir

Description

@Zehir

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions