Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting exactOptionalPropertyTypes #2111

Merged
merged 4 commits into from
Apr 19, 2023
Merged

Commits on Nov 15, 2022

  1. Supporting exactOptionalPropertyTypes

    `signal` key has defined its key as optional, not necessarily the value even though this happens implicitly.  No key means no value which translates to `undefined`:
    
    ```ts
        signal?: AbortSignal | null;
    ```
    
    To support `exactOptionalPropertyTypes` it would have to be defined as: 
    ```ts
        signal?: AbortSignal | null | undefined;
    ```
    
    While you could say the key isn't optional (removing `?`), which then requires an explicit `undefined` value: 
    ```ts
        signal: AbortSignal | null | undefined;
    ```
    
    That would require an explicit undefined being passed. 
    
    Given this key is part of TS definitions and module augmentation is overkill, just "oring" from undefined to an expected value (in this case `null`) solves the problem.
    seivan committed Nov 15, 2022
    Configuration menu
    Copy the full SHA
    2c8eb4b View commit details
    Browse the repository at this point in the history

Commits on Apr 19, 2023

  1. Configuration menu
    Copy the full SHA
    b331982 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    571b497 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8774ceb View commit details
    Browse the repository at this point in the history