src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperBasics.js
function (oPathValue, sExpectedType) {
			var bError,
				vValue = oPathValue.value;

			if (sExpectedType === "array") {
				bError = !Array.isArray(vValue);
			} else {
				bError = typeof vValue !== sExpectedType
					|| vValue === null
					|| Array.isArray(vValue);
			}
			if (bError) {
				Basics.error(oPathValue, "Expected " + sExpectedType);
			}
		}
function (oPathValue, sExpectedType) {
			var bError,
				vValue = oPathValue.value;

			if (sExpectedType === "array") {
				bError = !Array.isArray(vValue);
			} else {
				bError = typeof vValue !== sExpectedType
					|| vValue === null
					|| Array.isArray(vValue);
			}
			if (bError) {
				Basics.error(oPathValue, "Expected " + sExpectedType);
			}
		}
function ( oPathValue , sExpectedType ) { var bError , vValue = oPathValue . value ; if ( sExpectedType === "array" ) { bError = ! Array . isArray ( vValue ) ; } else { bError = typeof vValue !== sExpectedType || vValue === null || Array . isArray ( vValue ) ; } if ( bError ) { Basics . error ( oPathValue , "Expected " + sExpectedType ) ; } }
Logs an error and throws an error if the value is not of the expected type.

@param {object} oPathValue
a path/value pair
@param {string} oPathValue.path
the meta model path to start at
@param {any} oPathValue.value
the value at this path
@param {string} sExpectedType
the expected type (tested w/ typeof) or the special value "array" for an array
@throws {SyntaxError}
if the result is not of the expected type
Logs an error and throws an error if the value is not of the expected type .