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

Fix Typescript 4.1 compile error #2219

Merged
merged 1 commit into from Sep 28, 2020

Commits on Sep 23, 2020

  1. Fix Typescript 4.1 compile error

    Typescript 4.1 will have [stricter rules for type predicates](microsoft/TypeScript#39258) like
    
    ```ts
    export const isObject = (val: unknown): val is Record<any, any> =>
      val !== null && typeof val === 'object'
    ```
    
    As a result of these rules, an expression in collectionHandlers.ts in
    the reactivity package doesn't get narrowed to the type it did in TS 4.0
    and below. Instead it gets an intersection type, which doesn't work with
    subsequent code.
    
    I restored the old type using a cast, since that's essentially what the
    old version of Typescript was doing here.
    sandersn committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    f241f1c View commit details
    Browse the repository at this point in the history