mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-18 09:25:54 +00:00
fix(nuxt3): correctly type arrays returned from fetch requests (#1089)
This commit is contained in:
parent
ab7aef8a13
commit
93f7d776c4
@ -4,7 +4,7 @@ import { NuxtApp, useNuxtApp } from '#app'
|
||||
|
||||
export type _Transform<Input=any, Output=any> = (input: Input) => Output
|
||||
|
||||
export type PickFrom<T, K extends Array<string>> = T extends Record<string, any> ? Pick<T, K[number]> : T
|
||||
export type PickFrom<T, K extends Array<string>> = T extends Array<any> ? T : T extends Record<string, any> ? Pick<T, K[number]> : T
|
||||
export type KeysOf<T> = Array<keyof T extends string ? keyof T : string>
|
||||
export type KeyOfRes<Transform extends _Transform> = KeysOf<ReturnType<Transform>>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user