Skip to content

Incorrect return type for extract method #4335

Open
@ben-tilden

Description

Description

The return type for extract is derived incorrectly which leads to typing inconsistencies.

A fix is already open for review.

In the ExtractedValue type, V['value'] is not distributed across conditionals as expected, leading to incorrect typing for extract's return type.

Current Behavior

type Value = ExtractedValue<ExtractValue, ExtractMap> is string | string[] | undefined.

Expected Behavior

type Value = ExtractedValue<ExtractValue, ExtractMap> should be unknown, based on ExtractDescriptorFn's unknown return type.

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