code: function getWidth(stringWidth, str) {
  	if (!stringWidth || !stringWidth.toLowerCase)
  		return str.length;
  	switch (stringWidth.toLowerCase()) {
  		case "wcwidth":
  			return wcwidth(str);
  		case "dbcs":
  			return dbcswidth(str);
  		case "length":
  			return str.length;
  		default:
  			return str.length;
  	}
  }
docs: calculate width of string.
  @params {string} str - string to calculate
  @params {boolean} stringWidth - calculate width by wcwidth or String.length