xLookupByAttrValue

Type: function
Returns the object contained in the outer object's children if its attrName key and subsequent value matches the attrName and attrValue arguments provided.

Body

function(outer,attrName,attrValue){
  if (outer === undefined || !('children' in outer)){
    return undefined;
  } else {
    return _.find(outer.children,function(child){ return 'attributes' in child && attrName in child.attributes && child.attributes[attrName] == attrValue; });
  }
}

Classpath

Children