Skip to content

Commit

Permalink
Merge pull request #83 from bboysathish/master
Browse files Browse the repository at this point in the history
Cleanup: No need to duplicate the color keys

Can use Object.keys() to extract from colors object.
  • Loading branch information
rmg committed Nov 13, 2015
2 parents 239049a + 1f7545c commit 671373c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/colors.js
Expand Up @@ -34,12 +34,8 @@ function colorizer(color) {

module.exports.colors = [];

[
"cyan", "yellow", "green",
"magenta", "red", "blue",
"bright_cyan", "bright_yellow", "bright_green",
"bright_magenta", "bright_red", "bright_blue"
].forEach(function(name) {
var colorKeys = Object.keys(colors);
colorKeys.forEach(function(name) {
var colorFn = colorizer(name);
module.exports[name] = colorFn;
module.exports.colors.push(colorFn);
Expand Down

0 comments on commit 671373c

Please sign in to comment.