src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Helper.js
function (vValue, sType) {
			if (vValue === undefined) {
				throw new Error("Illegal value: undefined");
			}
			if (vValue === null) {
				return "null";
			}

			switch (sType) {
			case "Edm.Binary":
				return "binary'" + vValue + "'";

			case "Edm.Boolean":
			case "Edm.Byte":
			case "Edm.Double":
			case "Edm.Int16":
			case "Edm.Int32":
			case "Edm.SByte":
			case "Edm.Single":
				return String(vValue);

			case "Edm.Date":
			case "Edm.DateTimeOffset":
			case "Edm.Decimal":
			case "Edm.Guid":
			case "Edm.Int64":
			case "Edm.TimeOfDay":
				return vValue;

			case "Edm.Duration":
				return "duration'" + vValue + "'";

			case "Edm.String":
				return "'" + vValue.replace(rSingleQuote, "''") + "'";

			default:
				throw new Error("Unsupported type: " + sType);
			}
		}
function (vValue, sType) {
			if (vValue === undefined) {
				throw new Error("Illegal value: undefined");
			}
			if (vValue === null) {
				return "null";
			}

			switch (sType) {
			case "Edm.Binary":
				return "binary'" + vValue + "'";

			case "Edm.Boolean":
			case "Edm.Byte":
			case "Edm.Double":
			case "Edm.Int16":
			case "Edm.Int32":
			case "Edm.SByte":
			case "Edm.Single":
				return String(vValue);

			case "Edm.Date":
			case "Edm.DateTimeOffset":
			case "Edm.Decimal":
			case "Edm.Guid":
			case "Edm.Int64":
			case "Edm.TimeOfDay":
				return vValue;

			case "Edm.Duration":
				return "duration'" + vValue + "'";

			case "Edm.String":
				return "'" + vValue.replace(rSingleQuote, "''") + "'";

			default:
				throw new Error("Unsupported type: " + sType);
			}
		}
function ( vValue , sType ) { if ( vValue === undefined ) { throw new Error ( "Illegal value: undefined" ) ; } if ( vValue === null ) { return "null" ; } switch ( sType ) { case "Edm.Binary" : return "binary'" + vValue + "'" ; case "Edm.Boolean" : case "Edm.Byte" : case "Edm.Double" : case "Edm.Int16" : case "Edm.Int32" : case "Edm.SByte" : case "Edm.Single" : return String ( vValue ) ; case "Edm.Date" : case "Edm.DateTimeOffset" : case "Edm.Decimal" : case "Edm.Guid" : case "Edm.Int64" : case "Edm.TimeOfDay" : return vValue ; case "Edm.Duration" : return "duration'" + vValue + "'" ; case "Edm.String" : return "'" + vValue . replace ( rSingleQuote , "''" ) + "'" ; default : throw new Error ( "Unsupported type: " + sType ) ; } }
Formats a given internal value into a literal suitable for usage in URLs.

@param {any} vValue
The value according to "OData JSON Format Version 4.0" section "7.1 Primitive Value"
@param {string} sType
The OData Edm type, e.g. "Edm.String"
@returns {string}
The literal according to "OData Version 4.0 Part 2: URL Conventions" section
"5.1.1.6.1 Primitive Literals"
@throws {Error}
If the value is undefined or the type is not supported
Formats a given internal value into a literal suitable for usage in URLs .