lib/defaults.js
function(path, definitions) {
    path = path.replace(/^#\/definitions\//, '').split('/');

    var find = function(path, root) {
      var key = path.shift();
      if (!root[key]) {
        return {};
      } else if (!path.length) {
        return root[key];
      } else {
        return find(path, root[key]);
      }
    };

    var result = find(path, definitions);

    if (!isObject(result)) {
      return result;
    }
    return cloneJSON(result);
  }
function(path, definitions) {
    path = path.replace(/^#\/definitions\//, '').split('/');

    var find = function(path, root) {
      var key = path.shift();
      if (!root[key]) {
        return {};
      } else if (!path.length) {
        return root[key];
      } else {
        return find(path, root[key]);
      }
    };

    var result = find(path, definitions);

    if (!isObject(result)) {
      return result;
    }
    return cloneJSON(result);
  }
function ( path , definitions ) { path = path . replace ( / ^#\/definitions\/ / , '' ) . split ( '/' ) ; var find = function ( path , root ) { var key = path . shift ( ) ; if ( ! root [ key ] ) { return { } ; } else if ( ! path . length ) { return root [ key ] ; } else { return find ( path , root [ key ] ) ; } } ; var result = find ( path , definitions ) ; if ( ! isObject ( result ) ) { return result ; } return cloneJSON ( result ) ; }
get object by reference. works only with local references that points on
definitions object

@param {String} path
@param {Object} definitions
@return {Object}
get object by reference . works only with local references that points on definitions object