cdk-common 2.0.37 → 2.0.41

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.
Files changed (108) hide show
  1. package/.jsii +3 -3
  2. package/changelog.md +1 -1
  3. package/lib/main.js +1 -1
  4. package/node_modules/@aws-cdk/assert/package.json +8 -8
  5. package/node_modules/@aws-cdk/cfnspec/coverage/build-tools/index.html +2 -2
  6. package/node_modules/@aws-cdk/cfnspec/coverage/build-tools/massage-spec.ts.html +2 -2
  7. package/node_modules/@aws-cdk/cfnspec/coverage/build-tools/patch-set.ts.html +2 -2
  8. package/node_modules/@aws-cdk/cfnspec/coverage/build-tools/scrutiny.ts.html +2 -2
  9. package/node_modules/@aws-cdk/cfnspec/coverage/build-tools/validate-cfn.ts.html +2 -2
  10. package/node_modules/@aws-cdk/cfnspec/coverage/index.html +2 -2
  11. package/node_modules/@aws-cdk/cfnspec/coverage/junit.xml +6261 -6261
  12. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/build-tools/index.html +2 -2
  13. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/build-tools/massage-spec.ts.html +2 -2
  14. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/build-tools/patch-set.ts.html +2 -2
  15. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/build-tools/scrutiny.ts.html +2 -2
  16. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/build-tools/validate-cfn.ts.html +2 -2
  17. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/index.html +2 -2
  18. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/canned-metrics/canned-metrics-schema.ts.html +2 -2
  19. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/canned-metrics/index.html +2 -2
  20. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/canned-metrics.ts.html +2 -2
  21. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/index.html +2 -2
  22. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/index.ts.html +2 -2
  23. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/schema/augmentation.ts.html +2 -2
  24. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/schema/base-types.ts.html +2 -2
  25. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/schema/index.html +2 -2
  26. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/schema/index.ts.html +2 -2
  27. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/schema/property.ts.html +2 -2
  28. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/schema/resource-type.ts.html +2 -2
  29. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/schema/specification.ts.html +2 -2
  30. package/node_modules/@aws-cdk/cfnspec/coverage/lib/canned-metrics/canned-metrics-schema.ts.html +2 -2
  31. package/node_modules/@aws-cdk/cfnspec/coverage/lib/canned-metrics/index.html +2 -2
  32. package/node_modules/@aws-cdk/cfnspec/coverage/lib/canned-metrics.ts.html +2 -2
  33. package/node_modules/@aws-cdk/cfnspec/coverage/lib/index.html +2 -2
  34. package/node_modules/@aws-cdk/cfnspec/coverage/lib/index.ts.html +2 -2
  35. package/node_modules/@aws-cdk/cfnspec/coverage/lib/schema/augmentation.ts.html +2 -2
  36. package/node_modules/@aws-cdk/cfnspec/coverage/lib/schema/base-types.ts.html +2 -2
  37. package/node_modules/@aws-cdk/cfnspec/coverage/lib/schema/index.html +2 -2
  38. package/node_modules/@aws-cdk/cfnspec/coverage/lib/schema/index.ts.html +2 -2
  39. package/node_modules/@aws-cdk/cfnspec/coverage/lib/schema/property.ts.html +2 -2
  40. package/node_modules/@aws-cdk/cfnspec/coverage/lib/schema/resource-type.ts.html +2 -2
  41. package/node_modules/@aws-cdk/cfnspec/coverage/lib/schema/specification.ts.html +2 -2
  42. package/node_modules/@aws-cdk/cfnspec/package.json +5 -5
  43. package/node_modules/@aws-cdk/cfnspec/spec/cfn-docs.json +371 -119
  44. package/node_modules/@aws-cdk/cfnspec/tsconfig.tsbuildinfo +30 -30
  45. package/node_modules/@aws-cdk/cloudformation-diff/lib/format-table.js +3 -3
  46. package/node_modules/@aws-cdk/cloudformation-diff/lib/format.js +29 -29
  47. package/node_modules/@aws-cdk/cloudformation-diff/lib/iam/iam-changes.js +7 -7
  48. package/node_modules/@aws-cdk/cloudformation-diff/lib/network/security-group-changes.js +3 -3
  49. package/node_modules/@aws-cdk/cloudformation-diff/package.json +9 -9
  50. package/node_modules/chalk/index.d.ts +415 -0
  51. package/node_modules/chalk/license +9 -0
  52. package/node_modules/chalk/package.json +68 -0
  53. package/node_modules/chalk/readme.md +341 -0
  54. package/node_modules/chalk/source/index.js +229 -0
  55. package/node_modules/chalk/source/templates.js +134 -0
  56. package/node_modules/chalk/source/util.js +39 -0
  57. package/node_modules/has-flag/index.d.ts +39 -0
  58. package/node_modules/has-flag/index.js +8 -0
  59. package/node_modules/has-flag/license +9 -0
  60. package/node_modules/has-flag/package.json +46 -0
  61. package/node_modules/has-flag/readme.md +89 -0
  62. package/node_modules/supports-color/browser.js +5 -0
  63. package/node_modules/supports-color/index.js +135 -0
  64. package/node_modules/supports-color/license +9 -0
  65. package/node_modules/supports-color/package.json +53 -0
  66. package/node_modules/supports-color/readme.md +76 -0
  67. package/node_modules/table/node_modules/ajv/README.md +1 -1
  68. package/node_modules/table/node_modules/ajv/dist/compile/codegen/code.d.ts +1 -0
  69. package/node_modules/table/node_modules/ajv/dist/compile/codegen/code.js +9 -1
  70. package/node_modules/table/node_modules/ajv/dist/compile/codegen/code.js.map +1 -1
  71. package/node_modules/table/node_modules/ajv/dist/core.d.ts +1 -0
  72. package/node_modules/table/node_modules/ajv/dist/core.js.map +1 -1
  73. package/node_modules/table/node_modules/ajv/dist/standalone/index.js +8 -1
  74. package/node_modules/table/node_modules/ajv/dist/standalone/index.js.map +1 -1
  75. package/node_modules/table/node_modules/ajv/dist/types/jtd-schema.d.ts +2 -1
  76. package/node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/index.js +10 -3
  77. package/node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -1
  78. package/node_modules/table/node_modules/ajv/lib/compile/codegen/code.ts +8 -0
  79. package/node_modules/table/node_modules/ajv/lib/core.ts +1 -0
  80. package/node_modules/table/node_modules/ajv/lib/standalone/index.ts +9 -2
  81. package/node_modules/table/node_modules/ajv/lib/types/json-schema.ts +1 -4
  82. package/node_modules/table/node_modules/ajv/lib/types/jtd-schema.ts +4 -5
  83. package/node_modules/table/node_modules/ajv/lib/vocabularies/discriminator/index.ts +11 -3
  84. package/node_modules/table/node_modules/ajv/package.json +4 -3
  85. package/package.json +3 -3
  86. package/releasetag.txt +1 -1
  87. package/version.txt +1 -1
  88. package/node_modules/colors/LICENSE +0 -25
  89. package/node_modules/colors/README.md +0 -221
  90. package/node_modules/colors/examples/normal-usage.js +0 -82
  91. package/node_modules/colors/examples/safe-string.js +0 -79
  92. package/node_modules/colors/index.d.ts +0 -136
  93. package/node_modules/colors/lib/colors.js +0 -211
  94. package/node_modules/colors/lib/custom/trap.js +0 -46
  95. package/node_modules/colors/lib/custom/zalgo.js +0 -110
  96. package/node_modules/colors/lib/extendStringPrototype.js +0 -110
  97. package/node_modules/colors/lib/index.js +0 -13
  98. package/node_modules/colors/lib/maps/america.js +0 -10
  99. package/node_modules/colors/lib/maps/rainbow.js +0 -12
  100. package/node_modules/colors/lib/maps/random.js +0 -11
  101. package/node_modules/colors/lib/maps/zebra.js +0 -5
  102. package/node_modules/colors/lib/styles.js +0 -95
  103. package/node_modules/colors/lib/system/has-flag.js +0 -35
  104. package/node_modules/colors/lib/system/supports-colors.js +0 -151
  105. package/node_modules/colors/package.json +0 -45
  106. package/node_modules/colors/safe.d.ts +0 -48
  107. package/node_modules/colors/safe.js +0 -10
  108. package/node_modules/colors/themes/generic-logging.js +0 -12
@@ -1,82 +0,0 @@
1
- var colors = require('../lib/index');
2
-
3
- console.log('First some yellow text'.yellow);
4
-
5
- console.log('Underline that text'.yellow.underline);
6
-
7
- console.log('Make it bold and red'.red.bold);
8
-
9
- console.log(('Double Raindows All Day Long').rainbow);
10
-
11
- console.log('Drop the bass'.trap);
12
-
13
- console.log('DROP THE RAINBOW BASS'.trap.rainbow);
14
-
15
- // styles not widely supported
16
- console.log('Chains are also cool.'.bold.italic.underline.red);
17
-
18
- // styles not widely supported
19
- console.log('So '.green + 'are'.underline + ' ' + 'inverse'.inverse
20
- + ' styles! '.yellow.bold);
21
- console.log('Zebras are so fun!'.zebra);
22
-
23
- //
24
- // Remark: .strikethrough may not work with Mac OS Terminal App
25
- //
26
- console.log('This is ' + 'not'.strikethrough + ' fun.');
27
-
28
- console.log('Background color attack!'.black.bgWhite);
29
- console.log('Use random styles on everything!'.random);
30
- console.log('America, Heck Yeah!'.america);
31
-
32
- console.log('Blindingly '.brightCyan + 'bright? '.brightRed + 'Why '.brightYellow + 'not?!'.brightGreen);
33
-
34
- console.log('Setting themes is useful');
35
-
36
- //
37
- // Custom themes
38
- //
39
- console.log('Generic logging theme as JSON'.green.bold.underline);
40
- // Load theme with JSON literal
41
- colors.setTheme({
42
- silly: 'rainbow',
43
- input: 'grey',
44
- verbose: 'cyan',
45
- prompt: 'grey',
46
- info: 'green',
47
- data: 'grey',
48
- help: 'cyan',
49
- warn: 'yellow',
50
- debug: 'blue',
51
- error: 'red',
52
- });
53
-
54
- // outputs red text
55
- console.log('this is an error'.error);
56
-
57
- // outputs yellow text
58
- console.log('this is a warning'.warn);
59
-
60
- // outputs grey text
61
- console.log('this is an input'.input);
62
-
63
- console.log('Generic logging theme as file'.green.bold.underline);
64
-
65
- // Load a theme from file
66
- try {
67
- colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));
68
- } catch (err) {
69
- console.log(err);
70
- }
71
-
72
- // outputs red text
73
- console.log('this is an error'.error);
74
-
75
- // outputs yellow text
76
- console.log('this is a warning'.warn);
77
-
78
- // outputs grey text
79
- console.log('this is an input'.input);
80
-
81
- // console.log("Don't summon".zalgo)
82
-
@@ -1,79 +0,0 @@
1
- var colors = require('../safe');
2
-
3
- console.log(colors.yellow('First some yellow text'));
4
-
5
- console.log(colors.yellow.underline('Underline that text'));
6
-
7
- console.log(colors.red.bold('Make it bold and red'));
8
-
9
- console.log(colors.rainbow('Double Raindows All Day Long'));
10
-
11
- console.log(colors.trap('Drop the bass'));
12
-
13
- console.log(colors.rainbow(colors.trap('DROP THE RAINBOW BASS')));
14
-
15
- // styles not widely supported
16
- console.log(colors.bold.italic.underline.red('Chains are also cool.'));
17
-
18
- // styles not widely supported
19
- console.log(colors.green('So ') + colors.underline('are') + ' '
20
- + colors.inverse('inverse') + colors.yellow.bold(' styles! '));
21
-
22
- console.log(colors.zebra('Zebras are so fun!'));
23
-
24
- console.log('This is ' + colors.strikethrough('not') + ' fun.');
25
-
26
-
27
- console.log(colors.black.bgWhite('Background color attack!'));
28
- console.log(colors.random('Use random styles on everything!'));
29
- console.log(colors.america('America, Heck Yeah!'));
30
-
31
- console.log(colors.brightCyan('Blindingly ') + colors.brightRed('bright? ') + colors.brightYellow('Why ') + colors.brightGreen('not?!'));
32
-
33
- console.log('Setting themes is useful');
34
-
35
- //
36
- // Custom themes
37
- //
38
- // console.log('Generic logging theme as JSON'.green.bold.underline);
39
- // Load theme with JSON literal
40
- colors.setTheme({
41
- silly: 'rainbow',
42
- input: 'blue',
43
- verbose: 'cyan',
44
- prompt: 'grey',
45
- info: 'green',
46
- data: 'grey',
47
- help: 'cyan',
48
- warn: 'yellow',
49
- debug: 'blue',
50
- error: 'red',
51
- });
52
-
53
- // outputs red text
54
- console.log(colors.error('this is an error'));
55
-
56
- // outputs yellow text
57
- console.log(colors.warn('this is a warning'));
58
-
59
- // outputs blue text
60
- console.log(colors.input('this is an input'));
61
-
62
-
63
- // console.log('Generic logging theme as file'.green.bold.underline);
64
-
65
- // Load a theme from file
66
- colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));
67
-
68
- // outputs red text
69
- console.log(colors.error('this is an error'));
70
-
71
- // outputs yellow text
72
- console.log(colors.warn('this is a warning'));
73
-
74
- // outputs grey text
75
- console.log(colors.input('this is an input'));
76
-
77
- // console.log(colors.zalgo("Don't summon him"))
78
-
79
-
@@ -1,136 +0,0 @@
1
- // Type definitions for Colors.js 1.2
2
- // Project: https://github.com/Marak/colors.js
3
- // Definitions by: Bart van der Schoor <https://github.com/Bartvds>, Staffan Eketorp <https://github.com/staeke>
4
- // Definitions: https://github.com/Marak/colors.js
5
-
6
- export interface Color {
7
- (text: string): string;
8
-
9
- strip: Color;
10
- stripColors: Color;
11
-
12
- black: Color;
13
- red: Color;
14
- green: Color;
15
- yellow: Color;
16
- blue: Color;
17
- magenta: Color;
18
- cyan: Color;
19
- white: Color;
20
- gray: Color;
21
- grey: Color;
22
-
23
- bgBlack: Color;
24
- bgRed: Color;
25
- bgGreen: Color;
26
- bgYellow: Color;
27
- bgBlue: Color;
28
- bgMagenta: Color;
29
- bgCyan: Color;
30
- bgWhite: Color;
31
-
32
- reset: Color;
33
- bold: Color;
34
- dim: Color;
35
- italic: Color;
36
- underline: Color;
37
- inverse: Color;
38
- hidden: Color;
39
- strikethrough: Color;
40
-
41
- rainbow: Color;
42
- zebra: Color;
43
- america: Color;
44
- trap: Color;
45
- random: Color;
46
- zalgo: Color;
47
- }
48
-
49
- export function enable(): void;
50
- export function disable(): void;
51
- export function setTheme(theme: any): void;
52
-
53
- export let enabled: boolean;
54
-
55
- export const strip: Color;
56
- export const stripColors: Color;
57
-
58
- export const black: Color;
59
- export const red: Color;
60
- export const green: Color;
61
- export const yellow: Color;
62
- export const blue: Color;
63
- export const magenta: Color;
64
- export const cyan: Color;
65
- export const white: Color;
66
- export const gray: Color;
67
- export const grey: Color;
68
-
69
- export const bgBlack: Color;
70
- export const bgRed: Color;
71
- export const bgGreen: Color;
72
- export const bgYellow: Color;
73
- export const bgBlue: Color;
74
- export const bgMagenta: Color;
75
- export const bgCyan: Color;
76
- export const bgWhite: Color;
77
-
78
- export const reset: Color;
79
- export const bold: Color;
80
- export const dim: Color;
81
- export const italic: Color;
82
- export const underline: Color;
83
- export const inverse: Color;
84
- export const hidden: Color;
85
- export const strikethrough: Color;
86
-
87
- export const rainbow: Color;
88
- export const zebra: Color;
89
- export const america: Color;
90
- export const trap: Color;
91
- export const random: Color;
92
- export const zalgo: Color;
93
-
94
- declare global {
95
- interface String {
96
- strip: string;
97
- stripColors: string;
98
-
99
- black: string;
100
- red: string;
101
- green: string;
102
- yellow: string;
103
- blue: string;
104
- magenta: string;
105
- cyan: string;
106
- white: string;
107
- gray: string;
108
- grey: string;
109
-
110
- bgBlack: string;
111
- bgRed: string;
112
- bgGreen: string;
113
- bgYellow: string;
114
- bgBlue: string;
115
- bgMagenta: string;
116
- bgCyan: string;
117
- bgWhite: string;
118
-
119
- reset: string;
120
- // @ts-ignore
121
- bold: string;
122
- dim: string;
123
- italic: string;
124
- underline: string;
125
- inverse: string;
126
- hidden: string;
127
- strikethrough: string;
128
-
129
- rainbow: string;
130
- zebra: string;
131
- america: string;
132
- trap: string;
133
- random: string;
134
- zalgo: string;
135
- }
136
- }
@@ -1,211 +0,0 @@
1
- /*
2
-
3
- The MIT License (MIT)
4
-
5
- Original Library
6
- - Copyright (c) Marak Squires
7
-
8
- Additional functionality
9
- - Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
10
-
11
- Permission is hereby granted, free of charge, to any person obtaining a copy
12
- of this software and associated documentation files (the "Software"), to deal
13
- in the Software without restriction, including without limitation the rights
14
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
- copies of the Software, and to permit persons to whom the Software is
16
- furnished to do so, subject to the following conditions:
17
-
18
- The above copyright notice and this permission notice shall be included in
19
- all copies or substantial portions of the Software.
20
-
21
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27
- THE SOFTWARE.
28
-
29
- */
30
-
31
- var colors = {};
32
- module['exports'] = colors;
33
-
34
- colors.themes = {};
35
-
36
- var util = require('util');
37
- var ansiStyles = colors.styles = require('./styles');
38
- var defineProps = Object.defineProperties;
39
- var newLineRegex = new RegExp(/[\r\n]+/g);
40
-
41
- colors.supportsColor = require('./system/supports-colors').supportsColor;
42
-
43
- if (typeof colors.enabled === 'undefined') {
44
- colors.enabled = colors.supportsColor() !== false;
45
- }
46
-
47
- colors.enable = function() {
48
- colors.enabled = true;
49
- };
50
-
51
- colors.disable = function() {
52
- colors.enabled = false;
53
- };
54
-
55
- colors.stripColors = colors.strip = function(str) {
56
- return ('' + str).replace(/\x1B\[\d+m/g, '');
57
- };
58
-
59
- // eslint-disable-next-line no-unused-vars
60
- var stylize = colors.stylize = function stylize(str, style) {
61
- if (!colors.enabled) {
62
- return str+'';
63
- }
64
-
65
- var styleMap = ansiStyles[style];
66
-
67
- // Stylize should work for non-ANSI styles, too
68
- if(!styleMap && style in colors){
69
- // Style maps like trap operate as functions on strings;
70
- // they don't have properties like open or close.
71
- return colors[style](str);
72
- }
73
-
74
- return styleMap.open + str + styleMap.close;
75
- };
76
-
77
- var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
78
- var escapeStringRegexp = function(str) {
79
- if (typeof str !== 'string') {
80
- throw new TypeError('Expected a string');
81
- }
82
- return str.replace(matchOperatorsRe, '\\$&');
83
- };
84
-
85
- function build(_styles) {
86
- var builder = function builder() {
87
- return applyStyle.apply(builder, arguments);
88
- };
89
- builder._styles = _styles;
90
- // __proto__ is used because we must return a function, but there is
91
- // no way to create a function with a different prototype.
92
- builder.__proto__ = proto;
93
- return builder;
94
- }
95
-
96
- var styles = (function() {
97
- var ret = {};
98
- ansiStyles.grey = ansiStyles.gray;
99
- Object.keys(ansiStyles).forEach(function(key) {
100
- ansiStyles[key].closeRe =
101
- new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
102
- ret[key] = {
103
- get: function() {
104
- return build(this._styles.concat(key));
105
- },
106
- };
107
- });
108
- return ret;
109
- })();
110
-
111
- var proto = defineProps(function colors() {}, styles);
112
-
113
- function applyStyle() {
114
- var args = Array.prototype.slice.call(arguments);
115
-
116
- var str = args.map(function(arg) {
117
- // Use weak equality check so we can colorize null/undefined in safe mode
118
- if (arg != null && arg.constructor === String) {
119
- return arg;
120
- } else {
121
- return util.inspect(arg);
122
- }
123
- }).join(' ');
124
-
125
- if (!colors.enabled || !str) {
126
- return str;
127
- }
128
-
129
- var newLinesPresent = str.indexOf('\n') != -1;
130
-
131
- var nestedStyles = this._styles;
132
-
133
- var i = nestedStyles.length;
134
- while (i--) {
135
- var code = ansiStyles[nestedStyles[i]];
136
- str = code.open + str.replace(code.closeRe, code.open) + code.close;
137
- if (newLinesPresent) {
138
- str = str.replace(newLineRegex, function(match) {
139
- return code.close + match + code.open;
140
- });
141
- }
142
- }
143
-
144
- return str;
145
- }
146
-
147
- colors.setTheme = function(theme) {
148
- if (typeof theme === 'string') {
149
- console.log('colors.setTheme now only accepts an object, not a string. ' +
150
- 'If you are trying to set a theme from a file, it is now your (the ' +
151
- 'caller\'s) responsibility to require the file. The old syntax ' +
152
- 'looked like colors.setTheme(__dirname + ' +
153
- '\'/../themes/generic-logging.js\'); The new syntax looks like '+
154
- 'colors.setTheme(require(__dirname + ' +
155
- '\'/../themes/generic-logging.js\'));');
156
- return;
157
- }
158
- for (var style in theme) {
159
- (function(style) {
160
- colors[style] = function(str) {
161
- if (typeof theme[style] === 'object') {
162
- var out = str;
163
- for (var i in theme[style]) {
164
- out = colors[theme[style][i]](out);
165
- }
166
- return out;
167
- }
168
- return colors[theme[style]](str);
169
- };
170
- })(style);
171
- }
172
- };
173
-
174
- function init() {
175
- var ret = {};
176
- Object.keys(styles).forEach(function(name) {
177
- ret[name] = {
178
- get: function() {
179
- return build([name]);
180
- },
181
- };
182
- });
183
- return ret;
184
- }
185
-
186
- var sequencer = function sequencer(map, str) {
187
- var exploded = str.split('');
188
- exploded = exploded.map(map);
189
- return exploded.join('');
190
- };
191
-
192
- // custom formatter methods
193
- colors.trap = require('./custom/trap');
194
- colors.zalgo = require('./custom/zalgo');
195
-
196
- // maps
197
- colors.maps = {};
198
- colors.maps.america = require('./maps/america')(colors);
199
- colors.maps.zebra = require('./maps/zebra')(colors);
200
- colors.maps.rainbow = require('./maps/rainbow')(colors);
201
- colors.maps.random = require('./maps/random')(colors);
202
-
203
- for (var map in colors.maps) {
204
- (function(map) {
205
- colors[map] = function(str) {
206
- return sequencer(colors.maps[map], str);
207
- };
208
- })(map);
209
- }
210
-
211
- defineProps(colors, init());
@@ -1,46 +0,0 @@
1
- module['exports'] = function runTheTrap(text, options) {
2
- var result = '';
3
- text = text || 'Run the trap, drop the bass';
4
- text = text.split('');
5
- var trap = {
6
- a: ['\u0040', '\u0104', '\u023a', '\u0245', '\u0394', '\u039b', '\u0414'],
7
- b: ['\u00df', '\u0181', '\u0243', '\u026e', '\u03b2', '\u0e3f'],
8
- c: ['\u00a9', '\u023b', '\u03fe'],
9
- d: ['\u00d0', '\u018a', '\u0500', '\u0501', '\u0502', '\u0503'],
10
- e: ['\u00cb', '\u0115', '\u018e', '\u0258', '\u03a3', '\u03be', '\u04bc',
11
- '\u0a6c'],
12
- f: ['\u04fa'],
13
- g: ['\u0262'],
14
- h: ['\u0126', '\u0195', '\u04a2', '\u04ba', '\u04c7', '\u050a'],
15
- i: ['\u0f0f'],
16
- j: ['\u0134'],
17
- k: ['\u0138', '\u04a0', '\u04c3', '\u051e'],
18
- l: ['\u0139'],
19
- m: ['\u028d', '\u04cd', '\u04ce', '\u0520', '\u0521', '\u0d69'],
20
- n: ['\u00d1', '\u014b', '\u019d', '\u0376', '\u03a0', '\u048a'],
21
- o: ['\u00d8', '\u00f5', '\u00f8', '\u01fe', '\u0298', '\u047a', '\u05dd',
22
- '\u06dd', '\u0e4f'],
23
- p: ['\u01f7', '\u048e'],
24
- q: ['\u09cd'],
25
- r: ['\u00ae', '\u01a6', '\u0210', '\u024c', '\u0280', '\u042f'],
26
- s: ['\u00a7', '\u03de', '\u03df', '\u03e8'],
27
- t: ['\u0141', '\u0166', '\u0373'],
28
- u: ['\u01b1', '\u054d'],
29
- v: ['\u05d8'],
30
- w: ['\u0428', '\u0460', '\u047c', '\u0d70'],
31
- x: ['\u04b2', '\u04fe', '\u04fc', '\u04fd'],
32
- y: ['\u00a5', '\u04b0', '\u04cb'],
33
- z: ['\u01b5', '\u0240'],
34
- };
35
- text.forEach(function(c) {
36
- c = c.toLowerCase();
37
- var chars = trap[c] || [' '];
38
- var rand = Math.floor(Math.random() * chars.length);
39
- if (typeof trap[c] !== 'undefined') {
40
- result += trap[c][rand];
41
- } else {
42
- result += c;
43
- }
44
- });
45
- return result;
46
- };
@@ -1,110 +0,0 @@
1
- // please no
2
- module['exports'] = function zalgo(text, options) {
3
- text = text || ' he is here ';
4
- var soul = {
5
- 'up': [
6
- '̍', '̎', '̄', '̅',
7
- '̿', '̑', '̆', '̐',
8
- '͒', '͗', '͑', '̇',
9
- '̈', '̊', '͂', '̓',
10
- '̈', '͊', '͋', '͌',
11
- '̃', '̂', '̌', '͐',
12
- '̀', '́', '̋', '̏',
13
- '̒', '̓', '̔', '̽',
14
- '̉', 'ͣ', 'ͤ', 'ͥ',
15
- 'ͦ', 'ͧ', 'ͨ', 'ͩ',
16
- 'ͪ', 'ͫ', 'ͬ', 'ͭ',
17
- 'ͮ', 'ͯ', '̾', '͛',
18
- '͆', '̚',
19
- ],
20
- 'down': [
21
- '̖', '̗', '̘', '̙',
22
- '̜', '̝', '̞', '̟',
23
- '̠', '̤', '̥', '̦',
24
- '̩', '̪', '̫', '̬',
25
- '̭', '̮', '̯', '̰',
26
- '̱', '̲', '̳', '̹',
27
- '̺', '̻', '̼', 'ͅ',
28
- '͇', '͈', '͉', '͍',
29
- '͎', '͓', '͔', '͕',
30
- '͖', '͙', '͚', '̣',
31
- ],
32
- 'mid': [
33
- '̕', '̛', '̀', '́',
34
- '͘', '̡', '̢', '̧',
35
- '̨', '̴', '̵', '̶',
36
- '͜', '͝', '͞',
37
- '͟', '͠', '͢', '̸',
38
- '̷', '͡', ' ҉',
39
- ],
40
- };
41
- var all = [].concat(soul.up, soul.down, soul.mid);
42
-
43
- function randomNumber(range) {
44
- var r = Math.floor(Math.random() * range);
45
- return r;
46
- }
47
-
48
- function isChar(character) {
49
- var bool = false;
50
- all.filter(function(i) {
51
- bool = (i === character);
52
- });
53
- return bool;
54
- }
55
-
56
-
57
- function heComes(text, options) {
58
- var result = '';
59
- var counts;
60
- var l;
61
- options = options || {};
62
- options['up'] =
63
- typeof options['up'] !== 'undefined' ? options['up'] : true;
64
- options['mid'] =
65
- typeof options['mid'] !== 'undefined' ? options['mid'] : true;
66
- options['down'] =
67
- typeof options['down'] !== 'undefined' ? options['down'] : true;
68
- options['size'] =
69
- typeof options['size'] !== 'undefined' ? options['size'] : 'maxi';
70
- text = text.split('');
71
- for (l in text) {
72
- if (isChar(l)) {
73
- continue;
74
- }
75
- result = result + text[l];
76
- counts = {'up': 0, 'down': 0, 'mid': 0};
77
- switch (options.size) {
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
- }
94
-
95
- var arr = ['up', 'mid', 'down'];
96
- for (var d in arr) {
97
- var index = arr[d];
98
- for (var i = 0; i <= counts[index]; i++) {
99
- if (options[index]) {
100
- result = result + soul[index][randomNumber(soul[index].length)];
101
- }
102
- }
103
- }
104
- }
105
- return result;
106
- }
107
- // don't summon him
108
- return heComes(text, options);
109
- };
110
-