millsp / ts-toolbelt

πŸ‘· TypeScript's largest type utility library

Home Page:https://millsp.github.io/ts-toolbelt/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incorrect Optional (Patch?) results on types which look like Error

koloboid opened this issue Β· comments

🐞 Bug Report

Describe the bug

Incorrect Optional (Patch?) results on types which look like Error

Reproduce the bug

type A = O.Optional<{ name: string; message: string }, 'some'>;

Expected behavior

A should be like

{ name: string; message: string }

Actual behavior

A is an empty object - {}

Possible Solution

I think it's related to ignoring built-in types in PatchFlat. But I have no competence in toolbelt's internals.

@millsp and co-authors: so many thanks to you for this kit! Everyday tool for years!