/**
 * @param  {String} str A string of words
 * @return {Number}     Returns the number of words in `str`.
 */
export default str => {
  str = str ? str.trim() : '';
  return str.length ? str.split(' ').length : 0;
};
