Fixed "attr" typing
This commit is contained in:
parent
c446fb7840
commit
b3751ea3ec
1 changed files with 1 additions and 1 deletions
|
@ -107,7 +107,7 @@ export function pipe<IN extends any[], INT, R>(f1: (...args: IN) => INT, f2: (va
|
|||
/**
|
||||
* Attribute getter
|
||||
*/
|
||||
export function attr<K extends string>(name: K): <V, O extends Record<K, V>>(obj: O) => V {
|
||||
export function attr<K extends string>(name: K): <O extends Record<K, O[K]>>(obj: O) => O[K] {
|
||||
return obj => obj[name];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue