index.js
function getProvinceByName(name, useAlias) {
  if (!_.isString(name) || !_.isArray(this.provinces)) return undefined;

  return _.find(this.provinces, (province) => {
    if (useAlias) {
      return province.name.toUpperCase() === name.toUpperCase()
        ||  _.find(province.alias, (alias) => (alias.toUpperCase() === name.toUpperCase()));
    }
    return province.name.toUpperCase() === name.toUpperCase();
  });
}
function getProvinceByName(name, useAlias) {
  if (!_.isString(name) || !_.isArray(this.provinces)) return undefined;

  return _.find(this.provinces, (province) => {
    if (useAlias) {
      return province.name.toUpperCase() === name.toUpperCase()
        ||  _.find(province.alias, (alias) => (alias.toUpperCase() === name.toUpperCase()));
    }
    return province.name.toUpperCase() === name.toUpperCase();
  });
}
function getProvinceByName ( name , useAlias ) { if ( ! _ . isString ( name ) || ! _ . isArray ( this . provinces ) ) return undefined ; return _ . find ( this . provinces , ( province ) => { if ( useAlias ) { return province . name . toUpperCase ( ) === name . toUpperCase ( ) || _ . find ( province . alias , ( alias ) => ( alias . toUpperCase ( ) === name . toUpperCase ( ) ) ) ; } return province . name . toUpperCase ( ) === name . toUpperCase ( ) ; } ) ; }
Find the province object of the given province name

@param {String}  name              english province name
@param {Boolean} [useAlias]        use alias flag, default `false`
@return {Object} province          province object
Find the province object of the given province name