| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b0c768d commit 37960a6
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -39,14 +39,14 @@ const { | |||
| 39 | 39 | codes: { | |
| 40 | 40 | ERR_CONSOLE_WRITABLE_STREAM, | |
| 41 | 41 | ERR_INCOMPATIBLE_OPTION_PAIR, | |
| 42 | - ERR_INVALID_ARG_VALUE, | ||
| 43 | 42 | }, | |
| 44 | 43 | isStackOverflowError, | |
| 45 | 44 | } = require('internal/errors'); | |
| 46 | 45 | const { | |
| 47 | 46 | validateArray, | |
| 48 | 47 | validateInteger, | |
| 49 | 48 | validateObject, | |
| 49 | + validateOneOf, | ||
| 50 | 50 | } = require('internal/validators'); | |
| 51 | 51 | const { previewEntries } = internalBinding('util'); | |
| 52 | 52 | const { Buffer: { isBuffer } } = require('buffer'); | |
@@ -124,8 +124,7 @@ function Console(options /* or: stdout, stderr, ignoreErrors = true */) { | |||
| 124 | 124 | throw new ERR_CONSOLE_WRITABLE_STREAM('stderr'); | |
| 125 | 125 | } | |
| 126 | 126 | ||
| 127 | - if (typeof colorMode !== 'boolean' && colorMode !== 'auto') | ||
| 128 | - throw new ERR_INVALID_ARG_VALUE('colorMode', colorMode); | ||
| 127 | + validateOneOf(colorMode, 'colorMode', ['auto', true, false]); | ||
| 129 | 128 | ||
| 130 | 129 | if (groupIndentation !== undefined) { | |
| 131 | 130 | validateInteger(groupIndentation, 'groupIndentation', | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -67,7 +67,7 @@ check(false, false, false); | |||
| 67 | 67 | }); | |
| 68 | 68 | }, | |
| 69 | 69 | { | |
| 70 | - message: `The argument 'colorMode' is invalid. Received ${received}`, | ||
| 70 | + message: `The argument 'colorMode' must be one of: 'auto', true, false. Received ${received}`, | ||
| 71 | 71 | code: 'ERR_INVALID_ARG_VALUE' | |
| 72 | 72 | } | |
| 73 | 73 | ); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments