Last active
May 30, 2019 09:05
-
-
Save cschuff/f5ce22a17ad4d9223bb3653d42126f84 to your computer and use it in GitHub Desktop.
Valid SAPUI5 property types
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// found in https://github.com/SAP/openui5/blob/master/src/sap.ui.core/src/sap/ui/base/DataType.js | |
"any" | |
"boolean" | |
"int" | |
"float" | |
"string" | |
"object" | |
"function" | |
// arrays like this | |
"string[]" | |
// Formerly (from sap-ui-core-dbg.js) | |
var PREDEFINED_TYPES = { | |
"any" : | |
createType("any", { | |
defaultValue : null, | |
isValid : function(vValue) { | |
return true; | |
} | |
}), | |
"boolean" : | |
createType("boolean", { | |
defaultValue : false, | |
isValid : function(vValue) { | |
return typeof vValue === "boolean"; | |
} | |
}), | |
"int" : | |
createType("int", { | |
defaultValue : 0, | |
isValid : function(vValue) { | |
return typeof vValue === "number" && Math.floor(vValue) == vValue; | |
} | |
}), | |
"float" : | |
createType("float", { | |
defaultValue : 0.0, | |
isValid : function(vValue) { | |
return typeof vValue === "number"; | |
} | |
}), | |
"string" : | |
createType("string", { | |
defaultValue : "", | |
isValid : function(vValue) { | |
return typeof vValue === "string" || vValue instanceof String; | |
} | |
}), | |
"object" : | |
createType("object", { | |
defaultValue : null, | |
isValid : function(vValue) { | |
return typeof vValue === "object" || typeof vValue === "function"; | |
} | |
}) | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment