1
0
Fork 0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-07-04 20:46:39 +02:00

Remove code duplications and cleanup

This commit is contained in:
kkapsner 2019-12-10 15:07:22 +01:00
parent 8e414becf0
commit 32f9ea7447
9 changed files with 58 additions and 117 deletions

View file

@ -30,6 +30,14 @@
return undefined;
};
scope.getStatusByFlag = function getStatusByFlag(flag){
return function getStatus(obj, status, prefs){
status = Object.create(status);
status.active = prefs(flag, status.url);
return status;
};
};
scope.setFunctionProperties = function setFunctionProperties(functions, data){
Object.keys(functions).forEach(function(key){
const func = functions[key];