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

Strongly type D.set for known keys #76

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Mar 20, 2023

  1. Strongly type D.set for known keys

    With existing typing, `D.set` will accept any value type with no complaints from TypeScript:
    
    ```ts
    const obj = { foo: 1 };
    D.set(obj, 'foo', 'uh oh'); // wrong type, but no TypeScript errors
    ```kL
    
    With the updated types in this commit, not only does TypeScript now give errors for mistyped values, but VS Code also does autocomplete for keys. 😎
    
    You can still pass in non-existing keys to add them to the object, in which case `value` can be any type.
    banjerluke committed Mar 20, 2023
    Configuration menu
    Copy the full SHA
    f1ffab8 View commit details
    Browse the repository at this point in the history