Skip to content

Instantly share code, notes, and snippets.

@shiftgeist
Created June 6, 2023 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shiftgeist/492bd6a9e15c8dd852780d6c9e1256ad to your computer and use it in GitHub Desktop.
Save shiftgeist/492bd6a9e15c8dd852780d6c9e1256ad to your computer and use it in GitHub Desktop.
/**
* If a object has a property with Array<{ [key]: val }> and you want to make the array object values partial
*/
export type PartialByArray<T, K extends keyof T> = Exclude<T, K> & {
[key in K]: Array<{ [B in keyof T[K]]: Partial<T[K][B]> }>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment