Convert entity value in value to(> < " ')

@param {string} value
@returns {string}
977693
function escapeSpecial(value) {
    let specialMaps = {
        '&lt;': '<',
        '&gt;': '>',
        '&quote;': '"',
        '&#39;': '\''
    };
    for (let n in specialMaps) {
        value = value.replace(new RegExp(n, 'g'), specialMaps[n]);
    }
    return value;
}
36194
protected Object escape(Object value) {
        EscapeFunction function = ESCAPE_FUNCTION_MAP.get(this.type);
        return function != null ? function.escape(TagUtil.getRequest(this.pageContext), value) : CpnlElFunctions.text(toString(value));
    }
693560
public static String decodeAttributeValue(String value)
	{
		String _result = value.replaceAll(PATTERN__ENTITY_QUOTE, VALUE__CHAR_QUOTE);
		_result = _result.replaceAll(PATTERN__ENTITY_AMPERSAND, VALUE__CHAR_AMPERSAND);
		return _result;
	}
956328
function ( value ) {
            var result = Object.prototype.toString.call( value );
            result = result.match( /^\[\W*object\W+([a-zA-Z]+)\W*\]$/ );
    
            if ( result && result.length > 1 ) {
                result = result[1];
            }
    
            if ( result === 'String' ) {
                if ( $B.color.is(value) ) {
                    result = 'Color';
                }
            } else if ( result === 'Number' ) {
                if ( isNaN(value) ) {
                    result = 'NaN';
                }
            } else if ( result === 'Object' ) {
                if ( this.isUndefined(value) ) {
                    result = 'Undefined';
                } else if ( this.isNull(value) ) {
                    result = 'Null';
                } else if ( this.isElement(value) ) {
                    result = 'Element';
                }
            } else {
                if ( this.isElement(value) ) {
                    result = 'Element';
                }
            }
    
            return result;
        }
989944
protected String formatToString(Object value) {
        if (value == null) return null;
        if (value instanceof CharSequence) {
            return new StringBuilder().append('\'').append(value.toString().replace("'", "\\'")).append('\'').toString();
        } else if (!(value instanceof Number) && !(value instanceof java.util.Date)
            && !value.getClass().getName().startsWith("java.sql.") && !value.getClass().getName().startsWith("java.time.")) {
            return new StringBuilder().append('\'').append(jsonConvert.convertTo(value).replace("'", "\\'")).append('\'').toString();
        }
        return String.valueOf(value);
    }
158682
function(element, value) {
    var c, cl, className, classNames = [];
    if (typeof value === "string" && value) {
      classNames = value.split(/\s+/);
    }
    if (element && element.nodeType === 1 && classNames.length > 0) {
      className = (" " + (element.className || "") + " ").replace(/[\t\r\n\f]/g, " ");
      for (c = 0, cl = classNames.length; c < cl; c++) {
        if (className.indexOf(" " + classNames[c] + " ") === -1) {
          className += classNames[c] + " ";
        }
      }
      className = className.replace(/^\s+|\s+$/g, "");
      if (className !== element.className) {
        element.className = className;
      }
    }
    return element;
  }
452834
function (value) {
  if (typeof value === 'object' && value !== null) {
    if (_.size(value) <= 2
        && _.all(value, function (v, k) {
          return typeof k === 'string' && k.substr(0, 1) === '$';
        })) {
      for (var i = 0; i < builtinConverters.length; i++) {
        var converter = builtinConverters[i];
        if (converter.matchJSONValue(value)) {
          return converter.fromJSONValue(value);
        }
      }
    }
  }
  return value;
}
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);
  }
243652
function (value) {
		if (value === null) {
			return '';
		}
		if (value === undefined) {
			return '';
		}
		switch (typeof value) {
			case 'object' :
				if (value instanceof Blob) {
					return value;
				} else {
					return JSON.stringify(value);
				}
				break;
			case 'string':
				return value;
			default :
				return value;
		}
	}
1254716
function (value) {
    var parsedValue;
    if (typeof value !== 'string') { return value; }
    if (this.isSingleProperty) {
      parsedValue = this.schema.parse(value);
      /**
       * To avoid bogus double parsings. Cached values will be parsed when building
       * component data. For instance when parsing a src id to its url, we want to cache
       * original string and not the parsed one (#monster -> models/monster.dae)
       * so when building data we parse the expected value.
       */
      if (typeof parsedValue === 'string') { parsedValue = value; }
    } else {
      // Parse using the style parser to avoid double parsing of individual properties.
      utils.objectPool.clearObject(this.parsingAttrValue);
      parsedValue = styleParser.parse(value, this.parsingAttrValue);
    }
    return parsedValue;
  }
412876
public static String valueToString(Object value) {
		if (value == null) {
			return "null";
		} else if (!value.getClass().isArray()) {
			return value.toString();
		}

		StringBuilder sb = new StringBuilder();
		valueToString(sb, value);
		return sb.toString();
	}
1310957
public function transform($value): ?string
    {
        /** TODO add sanity check is array of Location object? */
        if (!is_array($value) || empty($value)) {
            return null;
        }

        return implode(',', array_column($value, 'id'));
    }
825002
private static String formatValue(String value)
	{
		if(value == null)
			return "";
		
		value = value.trim();
		
		if(value.startsWith("\"")|| value.startsWith("'"))
			value = value.substring(1);
		
		if(value.endsWith("\"")|| value.endsWith("'"))
			value = value.substring(0, value.length() -1);
		
		return value;
	}
563894
function getStringValue(value)
{
	var return_value = '';
	switch(typeof(value))
	{
		case 'string':
			return_value = "'" + value + "'";
			break;

		case 'number':
			return_value = value;
			break;

		case 'object':

			if(value==null)
					return_value = value;
			else
			{
					var valuestring = JSON.stringify(value);
					return_value = "'" + valuestring + "'";
			}
			break;

		default:
			return_value = "'" + value + "'";
			break;
	}
  return return_value;
}
891496
function encodeEntities(value) {
    return value.replace(/&/g, '&amp;')
        .replace(SURROGATE_PAIR_REGEXP, function (match) {
        var /** @type {?} */ hi = match.charCodeAt(0);
        var /** @type {?} */ low = match.charCodeAt(1);
        return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';';
    })
        .replace(NON_ALPHANUMERIC_REGEXP, function (match) { return '&#' + match.charCodeAt(0) + ';'; })
        .replace(/</g, '&lt;')
        .replace(/>/g, '&gt;');
}
56173
function formatValue(value) {
		
		var out;
		var type = util.sType(value);
		
		// if there is a type, check all sub items for types
		if (_.has(value, 'attributes.type') && _.has(value, '$value') && _.keys(value).length === 2) {
			out = util.moRef(value);
		}
		else if (type) {
			if (util.isArray(value)) {
				out = [];
				
				var subtype = type;
				
				if (subtype.match(/^ArrayOf/)) {
					subtype = subtype.replace(/^ArrayOf/, '');

					if (!Array.isArray(_.get(value, subtype)) && value[subtype]) {
						value[subtype] = [value[subtype]];
					}
				}
				
				_.forEach(value[_.keys(value)[1]], function(obj) {
					out.push(formatValue(obj));
				});
			}
			else if (util.isBoolean(value)) {
				
				// check for valid true values, otherwise false
				if (_.includes(['1', 'true'], _.lowerCase(value.$value))) {
					out = true;
				}
				else {
					out = false;
				}
			}
			else if (util.isInt(value)) {
				out = Number(value.$value);
			}
			else if (_.has(value, '$value')) {
				out = value.$value;
			}
			else {
				out = formatValue(_.omit(value, 'attributes'));
			}
			
		}
		else if (Array.isArray(value)) {
			out = [];
			_.forEach(value, function(val) {
				if (util.sType(val) || util.isArray(val) || util.hasKeys(val)) {
					out.push(formatValue(val));
				}
				else {
					out.push(cast(val));
				}
			});
		}
		else if (util.hasKeys(value)) {
			out = {};
			_.forEach(value, function(val, key) {
				if (util.sType(val) || util.isArray(val) || util.hasKeys(val)) {
					out[key] = formatValue(val);
				}
				else {
					out[key] = cast(val);
				}
			});
		}
		else {
			out = cast(value);
		}
		return out;
	}
771778
public String asString(Object value) {

        if (value == null) {
            return "";
        }

        if (!this.isArray(value)) {
            return String.valueOf(value);
        }

        Object[] array = this.asArray(value);

        StringBuilder builder = new StringBuilder();

        for (Object obj : array) {
            builder.append(this.asString(obj));
        }

        return builder.toString();
    }