| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6e7de37 commit a110409
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -44,14 +44,14 @@ const { | |||
| 44 | 44 | isStackOverflowError, | |
| 45 | 45 | codes: { | |
| 46 | 46 | ERR_CONSOLE_WRITABLE_STREAM, | |
| 47 | - ERR_INVALID_ARG_VALUE, | ||
| 48 | 47 | ERR_INCOMPATIBLE_OPTION_PAIR, | |
| 49 | 48 | }, | |
| 50 | 49 | } = require('internal/errors'); | |
| 51 | 50 | const { | |
| 52 | 51 | validateArray, | |
| 53 | 52 | validateInteger, | |
| 54 | 53 | validateObject, | |
| 54 | + validateOneOf, | ||
| 55 | 55 | } = require('internal/validators'); | |
| 56 | 56 | const { previewEntries } = internalBinding('util'); | |
| 57 | 57 | const { Buffer: { isBuffer } } = require('buffer'); | |
@@ -135,8 +135,7 @@ function Console(options /* or: stdout, stderr, ignoreErrors = true */) { | |||
| 135 | 135 | throw new ERR_CONSOLE_WRITABLE_STREAM('stderr'); | |
| 136 | 136 | } | |
| 137 | 137 | ||
| 138 | - if (typeof colorMode !== 'boolean' && colorMode !== 'auto') | ||
| 139 | - throw new ERR_INVALID_ARG_VALUE('colorMode', colorMode); | ||
| 138 | + validateOneOf(colorMode, 'colorMode', ['auto', true, false]); | ||
| 140 | 139 | ||
| 141 | 140 | if (groupIndentation !== undefined) { | |
| 142 | 141 | 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