Replaces all spaces in a string with dashes

@method hyphenate
@param  {String} obj   String to hyphenate
@param {Boolean} camel [Optional] Hyphenate camelCase
@return {String}       String with dashes instead of spaces
542192
function ( obj, camel ) {
		var result = string.trim( obj ).replace( /\s+/g, "-" );

		if ( camel === true ) {
			result = result.replace( /([A-Z])/g, "-$1" ).toLowerCase();
		}

		return result;
	}
849028
function camelise(str) { var re
        re = /[\s\-_]+(\w)/g
        return downcase(str).replace(re, function(match, letter) {
            return upcase(letter) })
    }
1059824
function camelCase (str) {
  return str
    .replace(/_/g, (_, index) => index === 0 ? _ : '-')
    .replace(/(?:^\w|[A-Z]|\b\w)/g, (letter, index) =>
      index === 0 ? letter.toLowerCase() : letter.toUpperCase()
    )
    .replace(invalidChars, '')
}
79751
function pad(obj, width)
{
	var objstr, rv, i;

	if (obj === undefined)
		objstr = '';
	else
		objstr = obj.toString();

	rv = '';

	if (typeof (obj) != 'number')
		rv += objstr;

	for (i = objstr.length; i < width; i++)
		rv += ' ';

	if (typeof (obj) == 'number')
		rv += objstr;

	return (rv);
}
1282525
function camelize(obj, opts) {
    for (let key in obj) {
        if (Array.isArray(obj[key])) {
            obj[key] = obj[key].map((item) => {
                return camelize(item, opts);
            });
        } else if (typeof obj === 'string') {
            return obj;
        } else if (typeof obj[key] === 'object' &&
            !(obj[key] instanceof Date) &&
            obj[key] !== null) {
            obj[key] = camelize(obj[key], opts);
        }
    }

    return camelcaseKeys(obj, opts);
}
479241
function replace(obj, prefix) {
    const retObj = {}
    const dot = prefix ? '.' : ''
    for (const key in obj) {
      if (key === 'description') {
        retObj[key] = obj[key]
      } else if (key === 'script') {
        retObj[key] = series(
          `cd ${relativeDir}`,
          `npm start ${prefix}`,
          `cd "${relativeReturn}"`,
        )
      } else if (typeof obj[key] === 'string') {
        retObj[key] = series(
          `cd ${relativeDir}`,
          `npm start ${prefix}${dot}${key}`,
        )
      } else {
        retObj[key] = Object.assign(
          {},
          replace(obj[key], `${prefix}${dot}${key}`, `cd "${startingDir}"`),
        )
      }
    }
    return retObj
  }
414467
function camelCase(str) {
  if (str.indexOf('-') > -1) {
    str = str.replace(/-\w/g, function (letter) {
      return letter.substr(1).toUpperCase();
    });
  }

  return str;
}
844977
function (obj, key) {
    var tokens = key.replace(/\{|\}/g, '').split(".") || [],
      currVal = obj || {};
    for (var ix = 0, len = tokens.length; ix < len; ix++) {
      if ((typeof currVal === 'undefined') || (currVal === null)) {
        break;
      }
      var currentToken = tokens[ix];
      currVal = currVal[currentToken];
    }
    return currVal;
  }
355916
function stringify (obj) {
  var s = [];
  Object.keys(obj).forEach(function (key) {
    s.push(key);
    s.push('=\'');
    s.push(obj[key]);
    s.push('\';');
  });
  return s.join('');
}
532063
function (obj) {
        var str = ['{'];
        for (var key in obj) {
            if (!_.isUndefined(key)) {
                if (!_.isFunction(obj[key])) {
                    str.push(key + ':');
                    str.push(_.isUndefined(obj[key]) ? '""' : '"' + obj[key] + '"');
                    str.push(', ');
                }
            }
        }
        str.pop();
        str.push('}');
        return str.join('');
    }
93275
function camelCase(text) {
    text = text || '';
    return text.replace(/(?:^\w|[A-Z]|\b\w)/g, (letter, index) => {
        return index === 0 ? letter.toLowerCase() : letter.toUpperCase();
    }).replace(/\s+/g, '');
}
1004696
function objectToQueryString (obj) {
    let qs = reduce(obj, (result, value, key) => {
        if (!isNull(value) && !isUndefined(value)) {
            if (isArray(value)) {
                result += reduce(value, (result1, value1) => {
                    if (!isNull(value1) && !isUndefined(value1)) {
                        result1 += key + '=' + value1 + '&';
                        return result1
                    } else {
                        return result1;
                    }
                }, '')
            } else {
                result += key + '=' + value + '&';
            }
            return result;
        } else {
            return result
        }
    }, '').slice(0, -1);
    return qs;
}
639752
function sanitizeKey(obj) {
  if (typeof obj !== 'object') return obj;
  if (Array.isArray(obj)) return obj;
  if (obj === null) return null;
  if (obj instanceof Boolean) return obj;
  if (obj instanceof Number) return obj;
  if (obj instanceof Buffer) return obj.toString();
  for (const k in obj) {
    const escapedK = sjs(k);
    if (escapedK !== k) {
      obj[escapedK] = sanitizeKey(obj[k]);
      obj[k] = undefined;
    } else {
      obj[k] = sanitizeKey(obj[k]);
    }
  }
  return obj;
}
264017
function dashProperCase(str) {
        if ( !str.length ) {
            return str;
        }
        return str.split('-').map(function (piece) {
            if ( piece.length ) {
                return piece.substring(0, 1).toUpperCase() + piece.substring(1);
            }
            return piece;
        }).join('-');
    }
737830
function makeDocString(obj) {
        var docStr = obj
        if (Array.isArray(docStr)) {
            docStr = docStr.join('\n');
        }
        return docStr;
    }
1352334
function(str) {
    var camelized = Ember.String.camelize(str);
    return camelized.charAt(0).toUpperCase() + camelized.substr(1);
  }
1158559
function stringify (obj, replacer, spacer) {
  decirc(obj, '', [], undefined)
  var res = JSON.stringify(obj, replacer, spacer)
  while (arr.length !== 0) {
    var part = arr.pop()
    part[0][part[1]] = part[2]
  }
  return res
}