lib/compiler.js
function requireReporter(name) {
  const prefix = capitalize(camelcase(name));
  const locations = [`./reporters/${prefix}Reporter`, name, path.resolve(name)];
  let result = null;

  for (const location of locations) {
    try {
      // eslint-disable-next-line import/no-dynamic-require, global-require
      result = require(location);
    } catch (e) {
      // noop
    }

    if (result) {
      break;
    }
  }

  return result;
}
function requireReporter(name) {
  const prefix = capitalize(camelcase(name));
  const locations = [`./reporters/${prefix}Reporter`, name, path.resolve(name)];
  let result = null;

  for (const location of locations) {
    try {
      // eslint-disable-next-line import/no-dynamic-require, global-require
      result = require(location);
    } catch (e) {
      // noop
    }

    if (result) {
      break;
    }
  }

  return result;
}
function requireReporter ( name ) { const prefix = capitalize ( camelcase ( name ) ) ; const locations = [ ` ${ prefix } ` , name , path . resolve ( name ) ] ; let result = null ; for ( const location of locations ) { try { // eslint-disable-next-line import/no-dynamic-require, global-require result = require ( location ) ; } catch ( e ) { // noop } if ( result ) { break ; } } return result ; }
Attempts to require a specified reporter. Tries the local built-ins first,
and if that fails, attempts to load an npm module that exports a reporter
handler function, and if that fails, attempts to load the reporter relative
to the current working directory.
Attempts to require a specified reporter . Tries the local built - ins first and if that fails attempts to load an npm module that exports a reporter handler function and if that fails attempts to load the reporter relative to the current working directory .