dist/scripts/scripts.js
function findDefinition(schema, ref) {
  var propertyPath = ref.split('/').slice(1); // Ignore the #/uri at the beginning.
  var currentProperty = propertyPath.splice(0, 1)[0];

  var currentValue = schema;

  while (currentProperty) {
    currentValue = currentValue[currentProperty];
    currentProperty = propertyPath.splice(0, 1)[0];
  }

  return currentValue;
}
function findDefinition(schema, ref) {
  var propertyPath = ref.split('/').slice(1); // Ignore the #/uri at the beginning.
  var currentProperty = propertyPath.splice(0, 1)[0];

  var currentValue = schema;

  while (currentProperty) {
    currentValue = currentValue[currentProperty];
    currentProperty = propertyPath.splice(0, 1)[0];
  }

  return currentValue;
}
function findDefinition ( schema , ref ) { var propertyPath = ref . split ( '/' ) . slice ( 1 ) ; // Ignore the #/uri at the beginning. var currentProperty = propertyPath . splice ( 0 , 1 ) [ 0 ] ; var currentValue = schema ; while ( currentProperty ) { currentValue = currentValue [ currentProperty ] ; currentProperty = propertyPath . splice ( 0 , 1 ) [ 0 ] ; } return currentValue ; }
Finds a definition in a schema.
Useful for finding references.

@param schema    The full schema object.
@param ref       The reference to find.
@return {*}      The object representing the ref.
Finds a definition in a schema . Useful for finding references .