Closed zougari47 closed 3 days ago
This is because not every path item has a .key
property, but I plan to improve the developer experience on this part by adding key: undefined
in this case. There is a workaround to fix the TS error. Here is an example:
if (issue.path && 'key' in issue.path![0] && issue.path![0].key === 'message') {
// show message
}
Tip: You can also pass the issue to
v.getDotPath(issue)
to get its path.
v0.36.0 is available
IDE tell me that
Property 'key' does not exist on type 'IssuePathItem'.
. But when I log it it gives me the expected value.(in this case "message") Here is the snippet