1
0
Fork 0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-07-04 20:46:39 +02:00
This commit is contained in:
kkapsner 2019-01-24 15:43:20 +01:00
parent 1dc9b50242
commit f38e55b538
4 changed files with 33 additions and 23 deletions

View file

@ -24,4 +24,30 @@
check.notify("blocked");
return undefined;
};
scope.setFunctionProperties = function setFunctionProperties(functions, data){
Object.keys(functions).forEach(function(key){
var func = functions[key];
["type", "api", "getStatus"].forEach(function(property){
if (data[property] && !func[property]){
func[property] = data[property];
}
});
});
};
scope.setGetterProperties = function setGetterProperties(getters, data){
getters.forEach(function(getter){
["type", "api", "getStatus"].forEach(function(property){
if (data[property] && !getter[property]){
getter[property] = data[property];
}
});
});
};
scope.setProperties = function setProperties(functions, getters, data){
scope.setFunctionProperties(functions, data);
scope.setGetterProperties(getters, data);
};
}());