Skip to content

Rewrite class decoder to accepts a decoder for properties #31

@ilario-pierbattista

Description

@ilario-pierbattista

By now the class codec accepts an associative array of key-codec pairs.
It works but has a big problem: how to represent an intersection of properties?

Let's suppose to have

type T = {
  a: string
} & (
  | { b: null, c: null }
  | { b: number, c: boolean }
)

If the class decoder accepted a decoder for properties, then an instance of this type would be decoded using a single decoder, not a union of two similar ones.

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