lib/index.js
function registerLocales (headers) {
  var localesList = {
    indexes: {}
  };
  var i = headers.length - 1;
  var localeName;

  while (i >= 2) {
    localeName = headers[i].trim().split(/[\s\(]/)[0];
    localesList[localeName] = {
      localeName: localeName,
      messages: {}
    };
    localesList.indexes[i] = localeName;
    i--;
  }
  return localesList;
}
function registerLocales (headers) {
  var localesList = {
    indexes: {}
  };
  var i = headers.length - 1;
  var localeName;

  while (i >= 2) {
    localeName = headers[i].trim().split(/[\s\(]/)[0];
    localesList[localeName] = {
      localeName: localeName,
      messages: {}
    };
    localesList.indexes[i] = localeName;
    i--;
  }
  return localesList;
}
function registerLocales ( headers ) { var localesList = { indexes : { } } ; var i = headers . length - 1 ; var localeName ; while ( i >= 2 ) { localeName = headers [ i ] . trim ( ) . split ( / [\s\(] / ) [ 0 ] ; localesList [ localeName ] = { localeName : localeName , messages : { } } ; localesList . indexes [ i ] = localeName ; i -- ; } return localesList ; }
Returns an object with existed locales
@param {Array} headers
@returns {object}
Returns an object with existed locales