index.js
function js(file) {
  var type = is(file);

  return 'function' === type
  || 'string' === type && path.extname(file) === '.js';
}
function js(file) {
  var type = is(file);

  return 'function' === type
  || 'string' === type && path.extname(file) === '.js';
}
Make sure only valid JavaScript files are used as source. Ignore other files,
like .log files. Also allow constructors.

@param {String|Function} file Path or constructor function.
@returns {Boolean} allow entity to be used or not.
@api private