react-flow-chart icon indicating copy to clipboard operation
react-flow-chart copied to clipboard

Error in mapValues.ts

Open ToughDude opened this issue 4 years ago • 0 comments

I was looking at the source code of this library and found some error highlighting in VSCODE.

in mapValues.ts at line 8 :- res[key] = func(o[key]);

the error is :- const key: Extract<keyof Obj, string> Type 'Res[keyof Obj]' is not assignable to type 'Res[Extract<keyof Obj, string>]'. Type 'keyof Obj' is not assignable to type 'Extract<keyof Obj, string>'. Type 'string | number | symbol' is not assignable to type 'Extract<keyof Obj, string>'. Type 'string' is not assignable to type 'Extract<keyof Obj, string>'.ts(2322)

Can anybody tell why is that?

ToughDude avatar Jun 27 '20 16:06 ToughDude