lib/api/FileArray.js
function findFile (schema, url) {
  if (schema.files.length === 0) {
    return null;
  }

  if (url instanceof File) {
    // Short-circuit behavior for File obejcts
    return findByURL(schema.files, url.url);
  }

  // Try to find an exact URL match
  var file = findByURL(schema.files, url);

  if (!file) {
    // Resolve the URL and see if we can find a match
    var absoluteURL = schema.plugins.resolveURL({ from: schema.rootURL, to: url });
    file = findByURL(schema.files, absoluteURL);
  }

  return file;
}
function findFile (schema, url) {
  if (schema.files.length === 0) {
    return null;
  }

  if (url instanceof File) {
    // Short-circuit behavior for File obejcts
    return findByURL(schema.files, url.url);
  }

  // Try to find an exact URL match
  var file = findByURL(schema.files, url);

  if (!file) {
    // Resolve the URL and see if we can find a match
    var absoluteURL = schema.plugins.resolveURL({ from: schema.rootURL, to: url });
    file = findByURL(schema.files, absoluteURL);
  }

  return file;
}
function findFile ( schema , url ) { if ( schema . files . length === 0 ) { return null ; } if ( url instanceof File ) { // Short-circuit behavior for File obejcts return findByURL ( schema . files , url . url ) ; } // Try to find an exact URL match var file = findByURL ( schema . files , url ) ; if ( ! file ) { // Resolve the URL and see if we can find a match var absoluteURL = schema . plugins . resolveURL ( { from : schema . rootURL , to : url } ) ; file = findByURL ( schema . files , absoluteURL ) ; } return file ; }
Finds the given file in the schema

@param {Schema} schema
@param {string|File} url
An absolute URL, or a relative URL (relative to the schema's root file), or a {@link File} object

@returns {?File}
Finds the given file in the schema