Skip to content

Conversation

rapropos
Copy link
Contributor

@rapropos rapropos commented Aug 7, 2025

line?.length === 0 will be falsy even if line is undefined. If the tsc option noUncheckedIndexedAccess is enabled, array dereferences always run the risk of being undefined. Thus, the call to JSON.parse will generate errors. Changing the emptiness test to !line || line.length === 0 closes off this possibility and makes the JSON.parse call happy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant