lib/ejs.js
function getIncludePath(path, options) {
  var includePath;
  var filePath;
  var views = options.views;

  // Abs path
  if (path.charAt(0) == '/') {
    includePath = exports.resolveInclude(path.replace(/^\/*/,''), options.root || '/', true);
  }
  // Relative paths
  else {
    // Look relative to a passed filename first
    if (options.filename) {
      filePath = exports.resolveInclude(path, options.filename);
      if (fs.existsSync(filePath)) {
        includePath = filePath;
      }
    }
    // Then look in any views directories
    if (!includePath) {
      if (Array.isArray(views) && views.some(function (v) {
        filePath = exports.resolveInclude(path, v, true);
        return fs.existsSync(filePath);
      })) {
        includePath = filePath;
      }
    }
    if (!includePath) {
      throw new Error('Could not find the include file "' +
          options.escapeFunction(path) + '"');
    }
  }
  return includePath;
}
function getIncludePath(path, options) {
  var includePath;
  var filePath;
  var views = options.views;

  // Abs path
  if (path.charAt(0) == '/') {
    includePath = exports.resolveInclude(path.replace(/^\/*/,''), options.root || '/', true);
  }
  // Relative paths
  else {
    // Look relative to a passed filename first
    if (options.filename) {
      filePath = exports.resolveInclude(path, options.filename);
      if (fs.existsSync(filePath)) {
        includePath = filePath;
      }
    }
    // Then look in any views directories
    if (!includePath) {
      if (Array.isArray(views) && views.some(function (v) {
        filePath = exports.resolveInclude(path, v, true);
        return fs.existsSync(filePath);
      })) {
        includePath = filePath;
      }
    }
    if (!includePath) {
      throw new Error('Could not find the include file "' +
          options.escapeFunction(path) + '"');
    }
  }
  return includePath;
}
function getIncludePath ( path , options ) { var includePath ; var filePath ; var views = options . views ; // Abs path if ( path . charAt ( 0 ) == '/' ) { includePath = exports . resolveInclude ( path . replace ( / ^\/* / , '' ) , options . root || '/' , true ) ; } // Relative paths else { // Look relative to a passed filename first if ( options . filename ) { filePath = exports . resolveInclude ( path , options . filename ) ; if ( fs . existsSync ( filePath ) ) { includePath = filePath ; } } // Then look in any views directories if ( ! includePath ) { if ( Array . isArray ( views ) && views . some ( function ( v ) { filePath = exports . resolveInclude ( path , v , true ) ; return fs . existsSync ( filePath ) ; } ) ) { includePath = filePath ; } } if ( ! includePath ) { throw new Error ( 'Could not find the include file "' + options . escapeFunction ( path ) + '"' ) ; } } return includePath ; }
Get the path to the included file by Options

@param  {String}  path    specified path
@param  {Options} options compilation options
@return {String}
Get the path to the included file by Options