lib/helpers.js
function getAttrValue(obj, attr, strictCase) {
  assert.object(obj);
  assert.string(attr);
  // Check for exact case match first
  if (obj.hasOwnProperty(attr)) {
    return obj[attr];
  } else if (strictCase) {
    return undefined;
  }

  // Perform case-insensitive enumeration after that
  var lower = attr.toLowerCase();
  var result;
  Object.getOwnPropertyNames(obj).some(function (name) {
    if (name.toLowerCase() === lower) {
      result = obj[name];
      return true;
    }
    return false;
  });
  return result;
}
function getAttrValue(obj, attr, strictCase) {
  assert.object(obj);
  assert.string(attr);
  // Check for exact case match first
  if (obj.hasOwnProperty(attr)) {
    return obj[attr];
  } else if (strictCase) {
    return undefined;
  }

  // Perform case-insensitive enumeration after that
  var lower = attr.toLowerCase();
  var result;
  Object.getOwnPropertyNames(obj).some(function (name) {
    if (name.toLowerCase() === lower) {
      result = obj[name];
      return true;
    }
    return false;
  });
  return result;
}
function getAttrValue ( obj , attr , strictCase ) { assert . object ( obj ) ; assert . string ( attr ) ; // Check for exact case match first if ( obj . hasOwnProperty ( attr ) ) { return obj [ attr ] ; } else if ( strictCase ) { return undefined ; } // Perform case-insensitive enumeration after that var lower = attr . toLowerCase ( ) ; var result ; Object . getOwnPropertyNames ( obj ) . some ( function ( name ) { if ( name . toLowerCase ( ) === lower ) { result = obj [ name ] ; return true ; } return false ; } ) ; return result ; }
Fetch value for named object attribute.

@param {Object} obj object to fetch value from
@param {String} attr name of attribute to fetch
@param {Boolean} strictCase attribute name is case-sensitive. default: false
Fetch value for named object attribute .