Converts camel-case and dash-separated strings into Human readable forms

@param value
@returns {*}
776765
function humanizeValue(value) {
        if (value) {
            var text = value + '';
            if (Core.isBlank(text)) {
                return text;
            }
            try {
                text = _.snakeCase(text);
                text = _.capitalize(text.split('_').join(' '));
            }
            catch (e) {
                // ignore
            }
            return trimQuotes(text);
        }
        return value;
    }
235703
function valueToHtml(value) {
        if (angular.isArray(value)) {
            var size = value.length;
            if (!size) {
                return "";
            }
            else if (size === 1) {
                return valueToHtml(value[0]);
            }
            else {
                var buffer_1 = "<ul>";
                angular.forEach(value, function (childValue) {
                    buffer_1 += "<li>" + valueToHtml(childValue) + "</li>";
                });
                return buffer_1 + "</ul>";
            }
        }
        else if (angular.isObject(value)) {
            var buffer_2 = "<table>";
            angular.forEach(value, function (childValue, key) {
                buffer_2 += "<tr><td>" + key + "</td><td>" + valueToHtml(childValue) + "</td></tr>";
            });
            return buffer_2 + "</table>";
        }
        else if (angular.isString(value)) {
            var uriPrefixes = ["http://", "https://", "file://", "mailto:"];
            var answer_1 = value;
            angular.forEach(uriPrefixes, function (prefix) {
                if (_.startsWith(answer_1, prefix)) {
                    answer_1 = "<a href='" + value + "'>" + value + "</a>";
                }
            });
            return answer_1;
        }
        return value;
    }
394958
private static Map<String, String> extractHeaders(String value) {
        if (value == null) 
            return null;
        return Splitter.on("|").withKeyValueSeparator(":").split(value);
    }
185532
function getPascalCase(val) {
        var parts = val.split('.');
        var newVal = '';

        for (var i = 0; i < parts.length; i++) {
            newVal += parts[i].substring(0, 1).toUpperCase() + parts[i].substring(1);
        }

        return newVal;
    }
219578
private String formatDefaultValue(Object value) {
    if (value instanceof Boolean) {
      return ((Boolean) value) ? "true" : "false";
    }

    if (value instanceof Number) {
      return value.toString();
    }

    if (value instanceof Collection) {
      return formatCollectionValue((Collection) value);
    }

    String string = value.toString();

    if (string.startsWith("$")) {
      return string;
    }

    return SassString.escape(string);
  }
1201418
function(value)
	{
		if ( '*' == (value+'').charAt(0) )
		{
			if ( this.trim(value).charAt(0) == '#' )
			{
				value = (value+'').substr(1, value.indexOf('#') - 2);
			}
			else
			{
				value = (value+'').substr(1);
			}

			if ( this.refs[value] == undefined )
			{
				throw new YamlParseException('Reference "'+value+'" does not exist', this.getRealCurrentLineNb() + 1, this.currentLine);
			}
			return this.refs[value];
		}

		var matches = null;
		if ( matches = /^(\||>)(\+|\-|\d+|\+\d+|\-\d+|\d+\+|\d+\-)?( +#.*)?$/.exec(value) )
		{
			matches = {separator: matches[1], modifiers: matches[2], comments: matches[3]};
			var modifiers = this.isDefined(matches.modifiers) ? matches.modifiers : '';

			return this.parseFoldedScalar(matches.separator, modifiers.replace(/\d+/g, ''), Math.abs(parseInt(modifiers)));
		}
		try {
			return new YamlInline().parse(value);
		} catch (e) {
			if ( e instanceof YamlParseException ) {
				e.setParsedLine(this.getRealCurrentLineNb() + 1);
				e.setSnippet(this.currentLine);
			}
			throw e;
		}
	}
1090012
public static String stripDelimiters(final String value) {
        if (value != null && value.length() > 1) {
            if (value.charAt(0) == value.charAt(value.length() - 1)
                    && (value.charAt(0) == '\'')) {
                return value.substring(1, value.length() - 1);
            }
            if (value.charAt(0) == value.charAt(value.length() - 1)
                    && (value.charAt(0) == '\"')) {
                return value.substring(1, value.length() - 1);
            }
        }
        return value;
    }
549280
public static List<String> extractAsArrayOfString(String value) {
		Matcher matcher = arrayPattern.matcher(value);

		List<String> result = new ArrayList<String>();

		//	we need to unscape javascript format, otherwise string like " where id like '%' " will become " where id like \'%\' " 
		while (matcher.find()) {
			result.add(StringEscapeUtils.unescapeEcmaScript(matcher.group(1)));
		}

		return result;
	}
158142
public static String fromWellFormed(String value) {
        if (value == null) {
            return LogicalValue.ANY.getAbbreviation();
        }
        //return value.replaceAll("\\\\([^0-9A-Za-z])", "$1");
        StringBuilder buffer = new StringBuilder(value);
        char p = ' ';
        for (int x = 0; x < buffer.length() - 1; x++) {
            char c = buffer.charAt(x);
            if (c == '\\' && p != '\\') {
                buffer.delete(x, x + 1);
                x -= 1;
            }
            p = c;
        }
        return buffer.toString();
    }
965003
def stringify_value(value):
    
    if value is None:
        return u''
    isoformat = getattr(value, 'isoformat', None)
    if isoformat is not None:
        value = isoformat()
    return type(u'')(value)
4038
public String convertToUpperCase(String value) {
        String result = null;
        if (value != null) {
            result = value.toUpperCase();
        }
        return result;
    }
945149
private List<Character> asCharList(Object value) {
        char[] values = (char[]) value;
        List<Character> list = new ArrayList<Character>(values.length);
        for (char charValue : values) {
            list.add(charValue);
        }
        return list;
    }
117402
function formatValue (value) {
		if (typeof value == 'string') {
			value = value.replace(NEWLINE_PATTERN, '\\n');
			value = value.replace(APOS_PATTERN, '\\\'');
			return "'" + value + "'";
		}

		return value;
	}
1321330
function humanizeValueHtml(value) {
        var formattedValue = "";
        if (value === true) {
            formattedValue = '<i class="icon-check"></i>';
        }
        else if (value === false) {
            formattedValue = '<i class="icon-check-empty"></i>';
        }
        else {
            formattedValue = Core.humanizeValue(value);
        }
        return formattedValue;
    }
457219
public static String toCamelName(String value) {
        String[] partOfNames = value.split("_");

        StringBuilder sb = new StringBuilder(partOfNames[0]);
        for (int i = 1; i < partOfNames.length; i++) {
            sb.append(partOfNames[i].substring(0, 1).toUpperCase());
            sb.append(partOfNames[i].substring(1));
        }
        return sb.toString();
    }
206902
public static String valueString(final Object value) {
        StringBuilder val = new StringBuilder(""+value);
        if (null != value && value.getClass().isArray()) {
            val = new StringBuilder("{");
            for (int i = 0; i < Array.getLength(value); i++)
                val.append(valueString(Array.get(value, i))).append(", ");
            if (val.reverse().charAt(0) == ' ')
                val.delete(0, 2);
            return val.reverse().append("}").toString();
        }
        if (value instanceof Collection) {
            val = new StringBuilder("[");
            for (Object v : ((Collection<?>) value))
                val.append(valueString(v)).append(", ");
            if (val.reverse().charAt(0) == ' ')
                val.delete(0, 2);
            return val.reverse().append("]").toString();
        }
        if (value instanceof Map) {
            val = new StringBuilder("{");
            for (Entry<?, ?> e : ((Map<?, ?>) value).entrySet())
                val.append(valueString(e.getKey())).append("=")
                .append(valueString(e.getValue())).append(", ");
            if (val.reverse().charAt(0) == ' ')
                val.delete(0, 2);
            return val.reverse().append("}").toString();
        }
        if (value instanceof Entry) {
            return new StringBuilder(
                    valueString(((Entry<?, ?>) value).getKey()))
                .append("=").append(
                    valueString(((Entry<?, ?>) value).getValue()))
                .toString();
        }
        if (value instanceof String)
            return val.insert(0, "\"").append("\"").toString();
        if (Primitive.unwrap(value) instanceof Character)
            return val.insert(0, "'").append("'").toString();
        if (Primitive.unwrap(value) instanceof Number) {
            if (Primitive.unwrap(value) instanceof Byte)
                return val.append("o").toString();
            if (Primitive.unwrap(value) instanceof Short)
                return val.append("s").toString();
            if (Primitive.unwrap(value) instanceof Integer)
                return val.append("I").toString();
            if (Primitive.unwrap(value) instanceof Long)
                return val.append("L").toString();
            if (Primitive.unwrap(value) instanceof BigInteger)
                return val.append("W").toString();
            if (Primitive.unwrap(value) instanceof Float)
                return val.append("f").toString();
            if (Primitive.unwrap(value) instanceof Double)
                return val.append("d").toString();
            if (Primitive.unwrap(value) instanceof BigDecimal)
                return val.append("w").toString();
        }
        return val.toString();
    }

    /** Count region matches.
     * @param one string to compare
     * @param two string to compare with
     * @return return max common string */
    public static String maxCommonPrefix(String one, String two) {
        int i=0;
        while( one.regionMatches(0, two, 0, i ))
            i++;
        return one.substring(0, i-1);
    }

    /** Produce a method string from supplied value args.
     * @param name method name.
     * @param args the value to process.
     * @return still just a method string. */
    public static String methodString(String name, Object[] args) {
        return methodString(name, Types.getTypes(args));
    }

    /** Produce a simple string representation of a method name with args.
     * @param name the method name
     * @param types the parameter type names
     * @return string representation of a method */
    public static String methodString(String name, String[] types) {
        StringBuilder sb = new StringBuilder();
        sb.append(name).append('(');
        for( int i=0; i<types.length; i++ ) {
            if (i != 0)
                sb.append(", ");
            sb.append(types[i]);
        }
        sb.append(')');
        return sb.toString();
    }

    /** Produce a simple string representation of a method name with args.
     * @param name the method name
     * @param types the parameter type args
     * @return string representation of a method */
    public static String methodString(String name, Class<?>[] types) {
        return methodString(name, getTypeNames(types));
    }

    /** Produce a simple string representation of a method name with args.
     * @param name the method name
     * @param types the parameter type args
     * @param names the parameter names
     * @return string representation of a method */
    public static String methodString(String name, Class<?>[] types, String[] names) {
        return methodString(name, getTypeNames(types, names));
    }

    /** Get type names as stream.
     * @param types class[] of classes
     * @return Stream of type names */
    private static Stream<String> getTypeNamesStream(Class<?>[] types) {
        return Stream.of(types).map(StringUtil::getTypeName);
    }

    /** Get type names as string list.
     * @param types class[] of classes
     * @return List of type names */
    private static List<String> getTypeNamesList(Class<?>[] types) {
        return getTypeNamesStream(types).collect(Collectors.toList());
    }

    /** Get type names as string[].
     * @param types class[] of classes
     * @return String[] of type names */
    private static String[] getTypeNames(Class<?>[] types) {
        return getTypeNamesStream(types).toArray(String[]::new);
    }

    /** Get type names as string[].
     * @param types class[] of parameter classes
     * @param names string[] of parameter names
     * @return String[] of type names */
    private static String[] getTypeNames(Class<?>[] types, String[] names) {
        Iterator<String> namesIt = Stream.of(names).iterator();
        return getTypeNamesStream(types)
                .map(type -> type +" "+ namesIt.next())
                .toArray(String[]::new);
    }

    /** Get type name as string.
     * @param type class
     * @return simple name or Object if null */
    private static String getTypeName(Class<?> type) {
        return ( null == type ) ? "Object"
                : type.getSimpleName();
    }

    /** Get extends string for class.
     * @param type the class to interrogate.
     * @return if type isInterface return empty string
     *         else return extends superClass */
    private static String getTypeExtends(Class<?> type) {
        return type.isInterface() ? "" : " extends " + getTypeName(type.getSuperclass());
    }

    /** Get the implements/extends string for type.
     * @param type the class to interrogate.
     * @return string implements (for classes)/extends (for interfaces)
     *         and comma separated list of interfaces. */
    private static String getTypeImplements(Class<?> type) {
        StringBuilder sb = new StringBuilder();
        if ( type.getInterfaces().length > 0 )
            sb.append(type.isInterface() ? " extends " : " implements ")
             .append(String.join(", ", getTypeNamesList(type.getInterfaces())));
        return sb.toString();
    }

    /** Produce a complete string representation of a reflect method. Shows
     * modifiers, return type, name and parameter types.
     * @param method a java reflect method
     * @return string representation of a method */
    public static String methodString(Method method) {
        String mods = Modifier.toString(method.getModifiers());
        StringBuilder sb = new StringBuilder();
        return sb.append(mods).append(" ")
            .append(getTypeName(method.getReturnType())).append(" ")
            .append(methodString(method.getName(), method.getParameterTypes()))
            .append(mods.contains("abstract") ? ";" : " {}").toString();
    }

    /** Produce a complete string representation of a bsh method. Shows
     * modifiers, return type, name and parameter types.
     * @param method a bsh method
     * @return string representation of a method */
    public static String methodString(BshMethod method) {
        String mods = method.getModifiers().toString().substring(11);
        StringBuilder sb = new StringBuilder();
        return sb.append(mods).append(" ")
            .append(getTypeName(method.getReturnType())).append(" ")
            .append(methodString(method.getName(),
                    method.getParameterTypes(), method.getParameterNames()))
            .append(mods.contains("abstract") ? ";" : " {}").toString();
    }

    /** Produce a string representation of a bsh generated class declaration.
     * Shows modifiers, name, extends and implements.
     * @param type the class to reflect
     * @return string representation of a class declaration */
    private static String generatedClassString(Class<?> type) {
        StringBuilder sb = new StringBuilder();
        sb.append(Reflect.getClassModifiers(type).toString().substring(11))
          .append(type.isInterface() ? " interface" : " class")
          .append(" ").append(getTypeName(type))
          .append(getTypeExtends(type))
          .append(getTypeImplements(type));
        return sb.append(" {").toString().trim();
    }

    /** Produce a string representation of a class declaration.
     * Verifies if type is a generated class else builds a java
     * reflect class string definition.
     * Shows modifiers, name, extends and implements.
     * @param type the class to reflect
     * @return string representation of a class declaration */
    public static String classString(Class<?> type) {
        if (Reflect.isGeneratedClass(type))
            return generatedClassString(type);
        StringBuilder sb = new StringBuilder();
        sb.append(Modifier.toString(type.getModifiers()))
            .append(type.isInterface() ? "": " class")
            .append(" ").append(getTypeName(type))
            .append(getTypeExtends(type))
            .append(getTypeImplements(type));
        return sb.append(" {").toString().trim();
    }

    /** Produce a string representation of a bsh variable declaration.
     * Shows modifiers, type and name.
     * @param var the variable to reflect
     * @return string representation of variable declaration */
    public static String variableString(Variable var) {
        StringBuilder sb = new StringBuilder();
        sb.append(var.getModifiers().toString().substring(11))
            .append(" ").append(getTypeName(var.getType()))
            .append(" ").append(var.getName());
        return sb.append(";").toString();
    }

    /** Produce a string representation of a java field declaration.
     * Shows modifiers, type and name.
     * @param var the field to reflect
     * @return string representation of field declaration */
    public static String variableString(Field field) {
        StringBuilder sb = new StringBuilder();
        sb.append(Modifier.toString(field.getModifiers()))
            .append(" ").append(getTypeName(field.getType()))
            .append(" ").append(field.getName());
        return sb.append(";").toString();
    }
}
1347407
function caseInsensitivePart(value) {
    let result = [];
    for(let i=0; i<value.length; i++) {
        const c = value[i];
        const l = c.toLowerCase();
        const u = c.toUpperCase();

        if(l !== u) {
            result.push('[' + l + u + ']');
        } else {
            result.push(l);
        }
    }
    return result.join('');
}