there is actually `resolve` function exported by the module that does exactly that, so probably it's easier to use that.