Skip to content

Improve deserialize return types #6

Description

@Corb3nik

HTTPQL return types for the deserialize function should be structured similarly to

ClauseRequest = { field: "FileExtension": expr: ...} | { "field":  ... }

This allows us to have exhaustive switch/case statements:

type X = { field: "A"; value: "B" } | { field: "C"; value: "D" };

const x: X = {};

switch (x.field) {
  case "A":
    x.value; // should be "B"
    break;
  case "C":
    x.value; // should be "D"
    break;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions