Missing optional modifier in conversion of eagerly resolved mapped types

This issue has been tracked since 2023-03-16.

Search terms

missing optional, mapped types

Bug

When TypeDoc is given the following to document, it says the type of Test is { x: 1 | undefined } instead of { x?: 1 | undefined }

declare function buildObj<T>(x: T): {
    [K in keyof T]?: 1;
};

export const Test = buildObj({ x: 1 });

This happens with exactOptionalPropertyTypes both on and off.

Environment

  • Typedoc version: 0.23 + 0.24
  • TypeScript version: 4.9.5
  • Node.js version: 18
  • OS: Linux
More Details About Repo
Owner Name TypeStrong
Repo Name typedoc
Full Name TypeStrong/typedoc
Language TypeScript
Created Date 2014-05-24
Updated Date 2023-03-19
Star Count 6487
Watcher Count 68
Fork Count 639
Issue Count 48

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date