We want to convert NetworkController to TypeScript in order to be able
to compare differences in the controller between in this repo and the
core repo. To do this, however, we need to convert the dependencies of
the controller to TypeScript.
As a part of this effort, this commit converts
`shared/modules/network.utils.js` to TypeScript, and also adds tests.
Co-authored-by: Mark Stacey <markjstacey@gmail.com>