We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a0fd079 commit 1e5be5aCopy full SHA for 1e5be5a
1 file changed
src/runtime/typeUtils.ts
@@ -5,9 +5,17 @@ import type { Ref } from 'vue';
5
6
export type OmitStrict<Object, Key extends keyof Object> = Omit<Object, Key>;
7
8
-export type HasRequiredProperties<Object> = Object extends {} | null | undefined
9
- ? false
10
- : true;
+export type HasRequiredProperties<Object> =
+ // if any empty object can be assigned to Object
+ {} extends Object
11
+ ? false
12
+ : // if null can be assigned to Object
13
+ null extends Object
14
15
+ : // if undefined can be assigned to Object
16
+ undefined extends Object
17
18
+ : true;
19
20
/** @see {@link https://github.com/nuxt/nuxt/blob/42114f44a60ae326b58c05afe92ad535227d8f37/packages/nuxt/src/app/composables/fetch.ts#L20} */
21
export type ComputedOptions<T extends Record<string, any>> = {
0 commit comments