Skip to content

Commit

Permalink
Fix #180 - Custom with multi attr failure
Browse files Browse the repository at this point in the history
Fix #180 - Themes can have multiple attributes - but not in safe mode
  • Loading branch information
zucher committed Jun 25, 2018
1 parent a8ce90c commit dee3ab0
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions lib/extendStringPrototype.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,16 @@ module['exports'] = function() {
} else {
if (typeof(theme[prop]) === 'string') {
colors[prop] = colors[theme[prop]];
addProperty(prop, function() {
return colors[theme[prop]](this);
});
} else {
addProperty(prop, function() {
var ret = this;
for (var t = 0; t < theme[prop].length; t++) {
ret = colors[theme[prop][t]](ret);
}
return ret;
});
var tmp = colors[theme[prop][0]];
for (var t = 1; t < theme[prop].length; t++) {
tmp = tmp[theme[prop][t]];
}
colors[prop] = tmp;
}
addProperty(prop, function() {
return colors[prop](this);
});
}
});
}
Expand Down

0 comments on commit dee3ab0

Please sign in to comment.