cdk-common 2.0.35 → 2.0.39

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 (90) hide show
  1. package/.jsii +3 -3
  2. package/changelog.md +2 -0
  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/package.json +10 -6
  68. package/releasetag.txt +1 -0
  69. package/version.txt +1 -0
  70. package/node_modules/colors/LICENSE +0 -25
  71. package/node_modules/colors/README.md +0 -221
  72. package/node_modules/colors/examples/normal-usage.js +0 -82
  73. package/node_modules/colors/examples/safe-string.js +0 -79
  74. package/node_modules/colors/index.d.ts +0 -136
  75. package/node_modules/colors/lib/colors.js +0 -211
  76. package/node_modules/colors/lib/custom/trap.js +0 -46
  77. package/node_modules/colors/lib/custom/zalgo.js +0 -110
  78. package/node_modules/colors/lib/extendStringPrototype.js +0 -110
  79. package/node_modules/colors/lib/index.js +0 -13
  80. package/node_modules/colors/lib/maps/america.js +0 -10
  81. package/node_modules/colors/lib/maps/rainbow.js +0 -12
  82. package/node_modules/colors/lib/maps/random.js +0 -11
  83. package/node_modules/colors/lib/maps/zebra.js +0 -5
  84. package/node_modules/colors/lib/styles.js +0 -95
  85. package/node_modules/colors/lib/system/has-flag.js +0 -35
  86. package/node_modules/colors/lib/system/supports-colors.js +0 -151
  87. package/node_modules/colors/package.json +0 -45
  88. package/node_modules/colors/safe.d.ts +0 -48
  89. package/node_modules/colors/safe.js +0 -10
  90. package/node_modules/colors/themes/generic-logging.js +0 -12
@@ -0,0 +1,39 @@
1
+ 'use strict';
2
+
3
+ const stringReplaceAll = (string, substring, replacer) => {
4
+ let index = string.indexOf(substring);
5
+ if (index === -1) {
6
+ return string;
7
+ }
8
+
9
+ const substringLength = substring.length;
10
+ let endIndex = 0;
11
+ let returnValue = '';
12
+ do {
13
+ returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
14
+ endIndex = index + substringLength;
15
+ index = string.indexOf(substring, endIndex);
16
+ } while (index !== -1);
17
+
18
+ returnValue += string.substr(endIndex);
19
+ return returnValue;
20
+ };
21
+
22
+ const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
23
+ let endIndex = 0;
24
+ let returnValue = '';
25
+ do {
26
+ const gotCR = string[index - 1] === '\r';
27
+ returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? '\r\n' : '\n') + postfix;
28
+ endIndex = index + 1;
29
+ index = string.indexOf('\n', endIndex);
30
+ } while (index !== -1);
31
+
32
+ returnValue += string.substr(endIndex);
33
+ return returnValue;
34
+ };
35
+
36
+ module.exports = {
37
+ stringReplaceAll,
38
+ stringEncaseCRLFWithFirstIndex
39
+ };
@@ -0,0 +1,39 @@
1
+ /**
2
+ Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag.
3
+
4
+ @param flag - CLI flag to look for. The `--` prefix is optional.
5
+ @param argv - CLI arguments. Default: `process.argv`.
6
+ @returns Whether the flag exists.
7
+
8
+ @example
9
+ ```
10
+ // $ ts-node foo.ts -f --unicorn --foo=bar -- --rainbow
11
+
12
+ // foo.ts
13
+ import hasFlag = require('has-flag');
14
+
15
+ hasFlag('unicorn');
16
+ //=> true
17
+
18
+ hasFlag('--unicorn');
19
+ //=> true
20
+
21
+ hasFlag('f');
22
+ //=> true
23
+
24
+ hasFlag('-f');
25
+ //=> true
26
+
27
+ hasFlag('foo=bar');
28
+ //=> true
29
+
30
+ hasFlag('foo');
31
+ //=> false
32
+
33
+ hasFlag('rainbow');
34
+ //=> false
35
+ ```
36
+ */
37
+ declare function hasFlag(flag: string, argv?: string[]): boolean;
38
+
39
+ export = hasFlag;
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ module.exports = (flag, argv = process.argv) => {
4
+ const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
5
+ const position = argv.indexOf(prefix + flag);
6
+ const terminatorPosition = argv.indexOf('--');
7
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
8
+ };
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "has-flag",
3
+ "version": "4.0.0",
4
+ "description": "Check if argv has a specific flag",
5
+ "license": "MIT",
6
+ "repository": "sindresorhus/has-flag",
7
+ "author": {
8
+ "name": "Sindre Sorhus",
9
+ "email": "sindresorhus@gmail.com",
10
+ "url": "sindresorhus.com"
11
+ },
12
+ "engines": {
13
+ "node": ">=8"
14
+ },
15
+ "scripts": {
16
+ "test": "xo && ava && tsd"
17
+ },
18
+ "files": [
19
+ "index.js",
20
+ "index.d.ts"
21
+ ],
22
+ "keywords": [
23
+ "has",
24
+ "check",
25
+ "detect",
26
+ "contains",
27
+ "find",
28
+ "flag",
29
+ "cli",
30
+ "command-line",
31
+ "argv",
32
+ "process",
33
+ "arg",
34
+ "args",
35
+ "argument",
36
+ "arguments",
37
+ "getopt",
38
+ "minimist",
39
+ "optimist"
40
+ ],
41
+ "devDependencies": {
42
+ "ava": "^1.4.1",
43
+ "tsd": "^0.7.2",
44
+ "xo": "^0.24.0"
45
+ }
46
+ }
@@ -0,0 +1,89 @@
1
+ # has-flag [![Build Status](https://travis-ci.org/sindresorhus/has-flag.svg?branch=master)](https://travis-ci.org/sindresorhus/has-flag)
2
+
3
+ > Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag
4
+
5
+ Correctly stops looking after an `--` argument terminator.
6
+
7
+ ---
8
+
9
+ <div align="center">
10
+ <b>
11
+ <a href="https://tidelift.com/subscription/pkg/npm-has-flag?utm_source=npm-has-flag&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
12
+ </b>
13
+ <br>
14
+ <sub>
15
+ Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
16
+ </sub>
17
+ </div>
18
+
19
+ ---
20
+
21
+
22
+ ## Install
23
+
24
+ ```
25
+ $ npm install has-flag
26
+ ```
27
+
28
+
29
+ ## Usage
30
+
31
+ ```js
32
+ // foo.js
33
+ const hasFlag = require('has-flag');
34
+
35
+ hasFlag('unicorn');
36
+ //=> true
37
+
38
+ hasFlag('--unicorn');
39
+ //=> true
40
+
41
+ hasFlag('f');
42
+ //=> true
43
+
44
+ hasFlag('-f');
45
+ //=> true
46
+
47
+ hasFlag('foo=bar');
48
+ //=> true
49
+
50
+ hasFlag('foo');
51
+ //=> false
52
+
53
+ hasFlag('rainbow');
54
+ //=> false
55
+ ```
56
+
57
+ ```
58
+ $ node foo.js -f --unicorn --foo=bar -- --rainbow
59
+ ```
60
+
61
+
62
+ ## API
63
+
64
+ ### hasFlag(flag, [argv])
65
+
66
+ Returns a boolean for whether the flag exists.
67
+
68
+ #### flag
69
+
70
+ Type: `string`
71
+
72
+ CLI flag to look for. The `--` prefix is optional.
73
+
74
+ #### argv
75
+
76
+ Type: `string[]`<br>
77
+ Default: `process.argv`
78
+
79
+ CLI arguments.
80
+
81
+
82
+ ## Security
83
+
84
+ To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
85
+
86
+
87
+ ## License
88
+
89
+ MIT © [Sindre Sorhus](https://sindresorhus.com)
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+ module.exports = {
3
+ stdout: false,
4
+ stderr: false
5
+ };
@@ -0,0 +1,135 @@
1
+ 'use strict';
2
+ const os = require('os');
3
+ const tty = require('tty');
4
+ const hasFlag = require('has-flag');
5
+
6
+ const {env} = process;
7
+
8
+ let forceColor;
9
+ if (hasFlag('no-color') ||
10
+ hasFlag('no-colors') ||
11
+ hasFlag('color=false') ||
12
+ hasFlag('color=never')) {
13
+ forceColor = 0;
14
+ } else if (hasFlag('color') ||
15
+ hasFlag('colors') ||
16
+ hasFlag('color=true') ||
17
+ hasFlag('color=always')) {
18
+ forceColor = 1;
19
+ }
20
+
21
+ if ('FORCE_COLOR' in env) {
22
+ if (env.FORCE_COLOR === 'true') {
23
+ forceColor = 1;
24
+ } else if (env.FORCE_COLOR === 'false') {
25
+ forceColor = 0;
26
+ } else {
27
+ forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
28
+ }
29
+ }
30
+
31
+ function translateLevel(level) {
32
+ if (level === 0) {
33
+ return false;
34
+ }
35
+
36
+ return {
37
+ level,
38
+ hasBasic: true,
39
+ has256: level >= 2,
40
+ has16m: level >= 3
41
+ };
42
+ }
43
+
44
+ function supportsColor(haveStream, streamIsTTY) {
45
+ if (forceColor === 0) {
46
+ return 0;
47
+ }
48
+
49
+ if (hasFlag('color=16m') ||
50
+ hasFlag('color=full') ||
51
+ hasFlag('color=truecolor')) {
52
+ return 3;
53
+ }
54
+
55
+ if (hasFlag('color=256')) {
56
+ return 2;
57
+ }
58
+
59
+ if (haveStream && !streamIsTTY && forceColor === undefined) {
60
+ return 0;
61
+ }
62
+
63
+ const min = forceColor || 0;
64
+
65
+ if (env.TERM === 'dumb') {
66
+ return min;
67
+ }
68
+
69
+ if (process.platform === 'win32') {
70
+ // Windows 10 build 10586 is the first Windows release that supports 256 colors.
71
+ // Windows 10 build 14931 is the first release that supports 16m/TrueColor.
72
+ const osRelease = os.release().split('.');
73
+ if (
74
+ Number(osRelease[0]) >= 10 &&
75
+ Number(osRelease[2]) >= 10586
76
+ ) {
77
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
78
+ }
79
+
80
+ return 1;
81
+ }
82
+
83
+ if ('CI' in env) {
84
+ if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
85
+ return 1;
86
+ }
87
+
88
+ return min;
89
+ }
90
+
91
+ if ('TEAMCITY_VERSION' in env) {
92
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
93
+ }
94
+
95
+ if (env.COLORTERM === 'truecolor') {
96
+ return 3;
97
+ }
98
+
99
+ if ('TERM_PROGRAM' in env) {
100
+ const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
101
+
102
+ switch (env.TERM_PROGRAM) {
103
+ case 'iTerm.app':
104
+ return version >= 3 ? 3 : 2;
105
+ case 'Apple_Terminal':
106
+ return 2;
107
+ // No default
108
+ }
109
+ }
110
+
111
+ if (/-256(color)?$/i.test(env.TERM)) {
112
+ return 2;
113
+ }
114
+
115
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
116
+ return 1;
117
+ }
118
+
119
+ if ('COLORTERM' in env) {
120
+ return 1;
121
+ }
122
+
123
+ return min;
124
+ }
125
+
126
+ function getSupportLevel(stream) {
127
+ const level = supportsColor(stream, stream && stream.isTTY);
128
+ return translateLevel(level);
129
+ }
130
+
131
+ module.exports = {
132
+ supportsColor: getSupportLevel,
133
+ stdout: translateLevel(supportsColor(true, tty.isatty(1))),
134
+ stderr: translateLevel(supportsColor(true, tty.isatty(2)))
135
+ };
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "supports-color",
3
+ "version": "7.2.0",
4
+ "description": "Detect whether a terminal supports color",
5
+ "license": "MIT",
6
+ "repository": "chalk/supports-color",
7
+ "author": {
8
+ "name": "Sindre Sorhus",
9
+ "email": "sindresorhus@gmail.com",
10
+ "url": "sindresorhus.com"
11
+ },
12
+ "engines": {
13
+ "node": ">=8"
14
+ },
15
+ "scripts": {
16
+ "test": "xo && ava"
17
+ },
18
+ "files": [
19
+ "index.js",
20
+ "browser.js"
21
+ ],
22
+ "keywords": [
23
+ "color",
24
+ "colour",
25
+ "colors",
26
+ "terminal",
27
+ "console",
28
+ "cli",
29
+ "ansi",
30
+ "styles",
31
+ "tty",
32
+ "rgb",
33
+ "256",
34
+ "shell",
35
+ "xterm",
36
+ "command-line",
37
+ "support",
38
+ "supports",
39
+ "capability",
40
+ "detect",
41
+ "truecolor",
42
+ "16m"
43
+ ],
44
+ "dependencies": {
45
+ "has-flag": "^4.0.0"
46
+ },
47
+ "devDependencies": {
48
+ "ava": "^1.4.1",
49
+ "import-fresh": "^3.0.0",
50
+ "xo": "^0.24.0"
51
+ },
52
+ "browser": "browser.js"
53
+ }
@@ -0,0 +1,76 @@
1
+ # supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color)
2
+
3
+ > Detect whether a terminal supports color
4
+
5
+
6
+ ## Install
7
+
8
+ ```
9
+ $ npm install supports-color
10
+ ```
11
+
12
+
13
+ ## Usage
14
+
15
+ ```js
16
+ const supportsColor = require('supports-color');
17
+
18
+ if (supportsColor.stdout) {
19
+ console.log('Terminal stdout supports color');
20
+ }
21
+
22
+ if (supportsColor.stdout.has256) {
23
+ console.log('Terminal stdout supports 256 colors');
24
+ }
25
+
26
+ if (supportsColor.stderr.has16m) {
27
+ console.log('Terminal stderr supports 16 million colors (truecolor)');
28
+ }
29
+ ```
30
+
31
+
32
+ ## API
33
+
34
+ Returns an `Object` with a `stdout` and `stderr` property for testing either streams. Each property is an `Object`, or `false` if color is not supported.
35
+
36
+ The `stdout`/`stderr` objects specifies a level of support for color through a `.level` property and a corresponding flag:
37
+
38
+ - `.level = 1` and `.hasBasic = true`: Basic color support (16 colors)
39
+ - `.level = 2` and `.has256 = true`: 256 color support
40
+ - `.level = 3` and `.has16m = true`: Truecolor support (16 million colors)
41
+
42
+
43
+ ## Info
44
+
45
+ It obeys the `--color` and `--no-color` CLI flags.
46
+
47
+ For situations where using `--color` is not possible, use the environment variable `FORCE_COLOR=1` (level 1), `FORCE_COLOR=2` (level 2), or `FORCE_COLOR=3` (level 3) to forcefully enable color, or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks.
48
+
49
+ Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively.
50
+
51
+
52
+ ## Related
53
+
54
+ - [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module
55
+ - [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
56
+
57
+
58
+ ## Maintainers
59
+
60
+ - [Sindre Sorhus](https://github.com/sindresorhus)
61
+ - [Josh Junon](https://github.com/qix-)
62
+
63
+
64
+ ---
65
+
66
+ <div align="center">
67
+ <b>
68
+ <a href="https://tidelift.com/subscription/pkg/npm-supports-color?utm_source=npm-supports-color&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
69
+ </b>
70
+ <br>
71
+ <sub>
72
+ Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
73
+ </sub>
74
+ </div>
75
+
76
+ ---
package/package.json CHANGED
@@ -15,7 +15,11 @@
15
15
  "docgen": "npx projen docgen",
16
16
  "eslint": "npx projen eslint",
17
17
  "package": "npx projen package",
18
+ "package-all": "npx projen package-all",
19
+ "package:js": "npx projen package:js",
20
+ "package:python": "npx projen package:python",
18
21
  "post-compile": "npx projen post-compile",
22
+ "post-upgrade": "npx projen post-upgrade",
19
23
  "pre-compile": "npx projen pre-compile",
20
24
  "release": "npx projen release",
21
25
  "release:cdkv1": "npx projen release:cdkv1",
@@ -49,10 +53,9 @@
49
53
  "jsii": "^1.52.1",
50
54
  "jsii-diff": "^1.52.1",
51
55
  "jsii-docgen": "^3.8.31",
52
- "jsii-pacmak": "^1.52.1",
53
56
  "json-schema": "^0.4.0",
54
57
  "npm-check-updates": "^12",
55
- "projen": "0.45.4",
58
+ "projen": "0.50.24",
56
59
  "standard-version": "^9",
57
60
  "ts-jest": "^27.1.2",
58
61
  "typescript": "^4.5.4"
@@ -62,7 +65,7 @@
62
65
  "constructs": "^10.0.5"
63
66
  },
64
67
  "dependencies": {
65
- "@aws-cdk/assert": "^2.5.0",
68
+ "@aws-cdk/assert": "^2.8.0",
66
69
  "case": "^1.6.3",
67
70
  "sync-request": "^6.1.0"
68
71
  },
@@ -80,11 +83,11 @@
80
83
  ],
81
84
  "main": "lib/index.js",
82
85
  "license": "Apache-2.0",
83
- "version": "2.0.35",
86
+ "version": "2.0.39",
84
87
  "jest": {
85
88
  "testMatch": [
86
- "**/__tests__/**/*.ts?(x)",
87
- "**/?(*.)+(spec|test).ts?(x)"
89
+ "<rootDir>/src/**/__tests__/**/*.ts?(x)",
90
+ "<rootDir>/(test|src)/**/?(*.)+(spec|test).ts?(x)"
88
91
  ],
89
92
  "clearMocks": true,
90
93
  "collectCoverage": true,
@@ -92,6 +95,7 @@
92
95
  "json",
93
96
  "lcov",
94
97
  "clover",
98
+ "cobertura",
95
99
  "text"
96
100
  ],
97
101
  "coverageDirectory": "coverage",
package/releasetag.txt ADDED
@@ -0,0 +1 @@
1
+ v2.0.39
package/version.txt ADDED
@@ -0,0 +1 @@
1
+ 2.0.39
@@ -1,25 +0,0 @@
1
- MIT License
2
-
3
- Original Library
4
- - Copyright (c) Marak Squires
5
-
6
- Additional Functionality
7
- - Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
8
-
9
- Permission is hereby granted, free of charge, to any person obtaining a copy
10
- of this software and associated documentation files (the "Software"), to deal
11
- in the Software without restriction, including without limitation the rights
12
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
- copies of the Software, and to permit persons to whom the Software is
14
- furnished to do so, subject to the following conditions:
15
-
16
- The above copyright notice and this permission notice shall be included in
17
- all copies or substantial portions of the Software.
18
-
19
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
- THE SOFTWARE.