lib/application-classes.js
function getName(candidate) {
  var proto   = getProto(candidate),
      isValid = !!proto && !isPlainObject(candidate) && !Array.isArray(candidate);
  if (isValid) {
    for (var key in require.cache) {
      var exports = require.cache[key].exports,
          result  = isPlainObject(exports) ? Object.keys(exports).reduce(test.bind(null, key), null) : test(key);
      if (result) {
        return result;
      }
    }
  }
  return null;

  function test(filename, result, field) {
    if (result) {
      return result;
    } else {
      var candidate    = field ? exports[field] : exports,
          qualified    = [filename, field].filter(Boolean).join('::'),
          isDefinition = (typeof candidate === 'function') && !!candidate.prototype &&
            (typeof candidate.prototype === 'object') && (candidate.prototype === proto);
      return isDefinition && qualified || null;
    }
  }
}
function getName(candidate) {
  var proto   = getProto(candidate),
      isValid = !!proto && !isPlainObject(candidate) && !Array.isArray(candidate);
  if (isValid) {
    for (var key in require.cache) {
      var exports = require.cache[key].exports,
          result  = isPlainObject(exports) ? Object.keys(exports).reduce(test.bind(null, key), null) : test(key);
      if (result) {
        return result;
      }
    }
  }
  return null;

  function test(filename, result, field) {
    if (result) {
      return result;
    } else {
      var candidate    = field ? exports[field] : exports,
          qualified    = [filename, field].filter(Boolean).join('::'),
          isDefinition = (typeof candidate === 'function') && !!candidate.prototype &&
            (typeof candidate.prototype === 'object') && (candidate.prototype === proto);
      return isDefinition && qualified || null;
    }
  }
}
function getName ( candidate ) { var proto = getProto ( candidate ) , isValid = ! ! proto && ! isPlainObject ( candidate ) && ! Array . isArray ( candidate ) ; if ( isValid ) { for ( var key in require . cache ) { var exports = require . cache [ key ] . exports , result = isPlainObject ( exports ) ? Object . keys ( exports ) . reduce ( test . bind ( null , key ) , null ) : test ( key ) ; if ( result ) { return result ; } } } return null ; function test ( filename , result , field ) { if ( result ) { return result ; } else { var candidate = field ? exports [ field ] : exports , qualified = [ filename , field ] . filter ( Boolean ) . join ( '::' ) , isDefinition = ( typeof candidate === 'function' ) && ! ! candidate . prototype && ( typeof candidate . prototype === 'object' ) && ( candidate . prototype === proto ) ; return isDefinition && qualified || null ; } } }
Find the class name of the given instance.
@param {object} candidate A possible instance to name
@returns {string} The absolute path to the candidate definition where it is an instance or null otherwise
Find the class name of the given instance .