lib/utils.js
function getAttr(obj, attr) {
  if (!obj) { return; }

  if (Array.isArray(obj)) {
    obj = obj[0];
  }

  return (attr && obj['@']) ? obj['@'][attr] : obj['@'];
}
function getAttr(obj, attr) {
  if (!obj) { return; }

  if (Array.isArray(obj)) {
    obj = obj[0];
  }

  return (attr && obj['@']) ? obj['@'][attr] : obj['@'];
}
function getAttr ( obj , attr ) { if ( ! obj ) { return ; } if ( Array . isArray ( obj ) ) { obj = obj [ 0 ] ; } return ( attr && obj [ '@' ] ) ? obj [ '@' ] [ attr ] : obj [ '@' ] ; }
Fetches a specific attribute or the whole attribute for an object

@param obj
@param attr
@returns {*}
Fetches a specific attribute or the whole attribute for an object