getModulePaths = (readPowers, location) => {
  if (
    readPowers &&
    typeof readPowers !== 'function' &&
    readPowers.fileURLToPath
  ) {
    let filename = location;
    let dirname;
    try {
      dirname = new URL('./', filename).href;
    } catch (_) {
      return {
        filename: null,
        dirname: null,
      };
    }

    filename = readPowers.fileURLToPath(filename).toString();
    dirname = noTrailingSlash(readPowers.fileURLToPath(dirname).toString());

    return {
      filename,
      dirname,
    };
  } else {
    return {
      filename: null,
      dirname: null,
    };
  }
}
Generates values for __filename and __dirname from location _if and only if_
`readPowers` is of type {@link ReadPowers} containing a
{@link ReadPowers.fileURLToPath} method.

@param {ReadPowers | ReadFn | undefined} readPowers
@param {string} location
@returns {{
  filename:string|null,
  dirname: string|null
}}