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(runtime-core): add InferDefaults handling of array and object union types #4925

Merged
merged 2 commits into from Nov 15, 2021

Commits on Nov 9, 2021

  1. fix(runtime-core): add InferDefaults handling of array and object uni…

    …on types
    
    This fixes an issue where `InferDefaults` fails to handle union types with base types and array or object types.
    
    `TS2322: Type 'number' is not assignable to type '((props: Readonly<{ foo: number | number[]; }>) => number | number[]) | undefined'.`
    would throw for
    ```ts
    withDefault(
      defineProps<{ foo: number | number[] }>(),
      { foo: 123 },
    )
    ```
    
    This adds handling of base types and array or object types separately, so that both types can exist in prop type unions.
    cathrinevaage committed Nov 9, 2021
    Copy the full SHA
    ef64e45 View commit details
    Browse the repository at this point in the history

Commits on Nov 15, 2021

  1. Update apiSetupHelpers.ts

    yyx990803 committed Nov 15, 2021
    Copy the full SHA
    6361af4 View commit details
    Browse the repository at this point in the history