You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{getByPath,Path}from'dot-path-value';constusers={name: 'Someone',pets: [{cats: 2}]};functiongetValue<TextendsRecord<string,any>>(obj: T,path: Path<T>){returngetByPath(obj,path);}// Here, the type of `cats` is the union of all field types, i.e.:// `string | number | { cats: number; } | { cats: number; }[]`constcats=getValue(users,'pets.0.cats');
Hi,
It seems that passing a generic which extends something does not correctly resolve at least the extended options:
Reproduction: https://tsplay.dev/NaEx9N
The text was updated successfully, but these errors were encountered: