Skip to content

Commit

Permalink
fix(types): favor Record<string, any>> instead of object
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamincanac committed Nov 30, 2023
1 parent a2e9b7d commit 4d72a75
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/runtime/types/utils.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export type Strategy = 'merge' | 'override'

export type NestedKeyOf<ObjectType extends object> = {
[Key in keyof ObjectType]: ObjectType[Key] extends object
export type NestedKeyOf<ObjectType extends Record<string, any>> = {
[Key in keyof ObjectType]: ObjectType[Key] extends Record<string, any>
? NestedKeyOf<ObjectType[Key]>
: Key
}[keyof ObjectType]
Expand All @@ -20,9 +20,9 @@ type DeepKey<T, Keys extends string[]> =
: T

export type ExtractDeepKey<T, Path extends string[]> = DeepKey<T, Path> extends infer Result
? Result extends object ? keyof Result : never
? Result extends Record<string, any> ? keyof Result : never
: never

export type ExtractDeepObject<T, Path extends string[]> = DeepKey<T, Path> extends infer Result
? Result extends object ? Result : never
? Result extends Record<string, any> ? Result : never
: never

1 comment on commit 4d72a75

@vercel
Copy link

@vercel vercel bot commented on 4d72a75 Nov 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

ui – ./

ui-nuxt-js.vercel.app
ui.nuxt.com
ui-git-dev-nuxt-js.vercel.app

Please sign in to comment.