index.js
function camelcase(str) {
  if (!/[\s\W]/.test(str)) return str;
  if (str.length === 1) {
    return str.toLowerCase();
  }
  str = str.replace(/^[\W_]+|[\W_]+$/g, '').toLowerCase();
  return str.replace(/[\W_]+(\w|$)/g, function(_, ch) {
    return ch.toUpperCase();
  });
}
function camelcase(str) {
  if (!/[\s\W]/.test(str)) return str;
  if (str.length === 1) {
    return str.toLowerCase();
  }
  str = str.replace(/^[\W_]+|[\W_]+$/g, '').toLowerCase();
  return str.replace(/[\W_]+(\w|$)/g, function(_, ch) {
    return ch.toUpperCase();
  });
}
function camelcase ( str ) { if ( ! / [\s\W] / . test ( str ) ) return str ; if ( str . length === 1 ) { return str . toLowerCase ( ) ; } str = str . replace ( / ^[\W_]+|[\W_]+$ / g , '' ) . toLowerCase ( ) ; return str . replace ( / [\W_]+(\w|$) / g , function ( _ , ch ) { return ch . toUpperCase ( ) ; } ) ; }
Used to camelcase the module if a variable is not defined.

@param  {String} `str` String containing `_`, `.`, `-` or whitespace that will be camelcased.
@return {String} camelcased string.
Used to camelcase the module if a variable is not defined .