js-waku
js-waku copied to clipboard
chore: prevent unchecked index access
Problem
When access happens by index it is possible to hit a case when no value returned. With no proper handling of such edge case it's easy to hit a problem in run time and increase amount of problems for consumers. Examples of such issue is here - https://github.com/waku-org/js-waku/issues/1562
Solution
Enable TypeScript to check for such a case
Notes
- Link https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-1.html#checked-indexed-accesses---nouncheckedindexedaccess