This uses cheating and hackery to allow files with the extension ".mjs" to be importable by both the client and the server code. As long as they are written using import, but never try to touch import.meta or import assertions or require or the other CommonJS things like __dirname, they will be acceptable both to Node on the server side and to Babel on the client side and to Jest during the tests.
I am using this to centralize the parsing/unparsing of region strings, so we can be using the same code throughout and thus not get into trouble with colons in the contig being supported in some places but not in others.
This uses cheating and hackery to allow files with the extension ".mjs" to be importable by both the client and the server code. As long as they are written using import, but never try to touch import.meta or import assertions or require or the other CommonJS things like __dirname, they will be acceptable both to Node on the server side and to Babel on the client side and to Jest during the tests.
I am using this to centralize the parsing/unparsing of region strings, so we can be using the same code throughout and thus not get into trouble with colons in the contig being supported in some places but not in others.
This will fix #284.