function findRefs(obj,options){var refs={};// Validate the provided document
if(!isType(obj,'Array')&&!isType(obj,'Object')){throw new TypeError('obj must be an Array or an Object');}// Validate options
options=validateOptions(options,obj);// Walk the document (or sub document) and find all JSON References
walk(findAncestors(obj,options.subDocPath),findValue(obj,options.subDocPath),clone(options.subDocPath),function(ancestors,node,path){var processChildren=true;var refDetails;if(isRefLike(node)){// Pre-process the node when necessary
if(!isType(options.refPreProcessor,'Undefined')){node=options.refPreProcessor(clone(node),path);}refDetails=getRefDetails(node);// Post-process the reference details
if(!isType(options.refPostProcessor,'Undefined')){refDetails=options.refPostProcessor(refDetails,path);}if(options.filter(refDetails,path)){refs[pathToPtr(path)]=refDetails;}// Whenever a JSON Reference has extra children, its children should not be processed.
//   See: http://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03#section-3
if(getExtraRefKeys(node).length>0){processChildren=false;}}return processChildren;});return refs;}
Finds JSON References defined within the provided array/object.

@param {array|object} obj - The structure to find JSON References within
@param {module:JsonRefs~JsonRefsOptions} [options] - The JsonRefs options

@returns {object} an object whose keys are JSON Pointers *(fragment version)* to where the JSON Reference is defined
and whose values are {@link module:JsonRefs~UnresolvedRefDetails}.

@throws {Error} when the input arguments fail validation or if `options.subDocPath` points to an invalid location

@alias module:JsonRefs.findRefs

@example
// Finding all valid references
var allRefs = JsonRefs.findRefs(obj);
// Finding all remote references
var remoteRefs = JsonRefs.findRefs(obj, {filter: ['relative', 'remote']});
// Finding all invalid references
var invalidRefs = JsonRefs.findRefs(obj, {filter: 'invalid', includeInvalid: true});