Commit 6713884f authored by Prince Gupta's avatar Prince Gupta Committed by Pierre Lamot
Browse files

qml/Helpers: add get function

parent 6e65b0e3
......@@ -44,3 +44,11 @@ function clamp(num, min, max) {
function isValidInstanceOf(object, type) {
return (!!object && (object instanceof type))
// Returns the value associated with the key.
// If the hash contains no item with the key,
// or the value is invalid, returns defaultValue
function get(dict, key, defaultValue) {
var v = typeof dict !== "undefined" ? dict[key] : undefined
return !v ? defaultValue : v
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment