colors 1.3.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/colors.js +1 -1
- package/lib/custom/trap.js +2 -2
- package/lib/custom/zalgo.js +15 -15
- package/lib/extendStringPrototype.js +15 -9
- package/lib/maps/random.js +1 -1
- package/package.json +3 -3
- package/lib/.colors.js.swp +0 -0
package/lib/colors.js
CHANGED
@@ -105,7 +105,7 @@ function applyStyle() {
|
|
105
105
|
var args = Array.prototype.slice.call(arguments);
|
106
106
|
|
107
107
|
var str = args.map(function(arg) {
|
108
|
-
if (arg
|
108
|
+
if (arg !== undefined && arg.constructor === String) {
|
109
109
|
return arg;
|
110
110
|
} else {
|
111
111
|
return util.inspect(arg);
|
package/lib/custom/trap.js
CHANGED
@@ -8,7 +8,7 @@ module['exports'] = function runTheTrap(text, options) {
|
|
8
8
|
c: ['\u00a9', '\u023b', '\u03fe'],
|
9
9
|
d: ['\u00d0', '\u018a', '\u0500', '\u0501', '\u0502', '\u0503'],
|
10
10
|
e: ['\u00cb', '\u0115', '\u018e', '\u0258', '\u03a3', '\u03be', '\u04bc',
|
11
|
-
|
11
|
+
'\u0a6c'],
|
12
12
|
f: ['\u04fa'],
|
13
13
|
g: ['\u0262'],
|
14
14
|
h: ['\u0126', '\u0195', '\u04a2', '\u04ba', '\u04c7', '\u050a'],
|
@@ -19,7 +19,7 @@ module['exports'] = function runTheTrap(text, options) {
|
|
19
19
|
m: ['\u028d', '\u04cd', '\u04ce', '\u0520', '\u0521', '\u0d69'],
|
20
20
|
n: ['\u00d1', '\u014b', '\u019d', '\u0376', '\u03a0', '\u048a'],
|
21
21
|
o: ['\u00d8', '\u00f5', '\u00f8', '\u01fe', '\u0298', '\u047a', '\u05dd',
|
22
|
-
|
22
|
+
'\u06dd', '\u0e4f'],
|
23
23
|
p: ['\u01f7', '\u048e'],
|
24
24
|
q: ['\u09cd'],
|
25
25
|
r: ['\u00ae', '\u01a6', '\u0210', '\u024c', '\u0280', '\u042f'],
|
package/lib/custom/zalgo.js
CHANGED
@@ -75,21 +75,21 @@ module['exports'] = function zalgo(text, options) {
|
|
75
75
|
result = result + text[l];
|
76
76
|
counts = {'up': 0, 'down': 0, 'mid': 0};
|
77
77
|
switch (options.size) {
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
78
|
+
case 'mini':
|
79
|
+
counts.up = randomNumber(8);
|
80
|
+
counts.mid = randomNumber(2);
|
81
|
+
counts.down = randomNumber(8);
|
82
|
+
break;
|
83
|
+
case 'maxi':
|
84
|
+
counts.up = randomNumber(16) + 3;
|
85
|
+
counts.mid = randomNumber(4) + 1;
|
86
|
+
counts.down = randomNumber(64) + 3;
|
87
|
+
break;
|
88
|
+
default:
|
89
|
+
counts.up = randomNumber(8) + 1;
|
90
|
+
counts.mid = randomNumber(6) / 2;
|
91
|
+
counts.down = randomNumber(8) + 1;
|
92
|
+
break;
|
93
93
|
}
|
94
94
|
|
95
95
|
var arr = ['up', 'mid', 'down'];
|
@@ -73,16 +73,22 @@ module['exports'] = function() {
|
|
73
73
|
} else {
|
74
74
|
if (typeof(theme[prop]) === 'string') {
|
75
75
|
colors[prop] = colors[theme[prop]];
|
76
|
+
addProperty(prop, function() {
|
77
|
+
return colors[prop](this);
|
78
|
+
});
|
76
79
|
} else {
|
77
|
-
var
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
80
|
+
var themePropApplicator = function(str) {
|
81
|
+
var ret = str || this;
|
82
|
+
for (var t = 0; t < theme[prop].length; t++) {
|
83
|
+
ret = colors[theme[prop][t]](ret);
|
84
|
+
}
|
85
|
+
return ret;
|
86
|
+
};
|
87
|
+
addProperty(prop, themePropApplicator);
|
88
|
+
colors[prop] = function(str) {
|
89
|
+
return themePropApplicator(str);
|
90
|
+
};
|
82
91
|
}
|
83
|
-
addProperty(prop, function() {
|
84
|
-
return colors[prop](this);
|
85
|
-
});
|
86
92
|
}
|
87
93
|
});
|
88
94
|
}
|
@@ -96,7 +102,7 @@ module['exports'] = function() {
|
|
96
102
|
'\'/../themes/generic-logging.js\'); The new syntax looks like '+
|
97
103
|
'colors.setTheme(require(__dirname + ' +
|
98
104
|
'\'/../themes/generic-logging.js\'));');
|
99
|
-
|
105
|
+
return;
|
100
106
|
} else {
|
101
107
|
applyTheme(theme);
|
102
108
|
}
|
package/lib/maps/random.js
CHANGED
@@ -4,7 +4,7 @@ module['exports'] = function(colors) {
|
|
4
4
|
return function(letter, i, exploded) {
|
5
5
|
return letter === ' ' ? letter :
|
6
6
|
colors[
|
7
|
-
|
7
|
+
available[Math.round(Math.random() * (available.length - 2))]
|
8
8
|
](letter);
|
9
9
|
};
|
10
10
|
};
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "colors",
|
3
3
|
"description": "get colors in your node.js console",
|
4
|
-
"version": "1.3.
|
4
|
+
"version": "1.3.3",
|
5
5
|
"author": "Marak Squires",
|
6
6
|
"contributors": [
|
7
7
|
{
|
@@ -39,7 +39,7 @@
|
|
39
39
|
"safe.d.ts"
|
40
40
|
],
|
41
41
|
"devDependencies": {
|
42
|
-
"eslint
|
43
|
-
"eslint": "^
|
42
|
+
"eslint": "^5.2.0",
|
43
|
+
"eslint-config-google": "^0.11.0"
|
44
44
|
}
|
45
45
|
}
|
package/lib/.colors.js.swp
DELETED
Binary file
|