| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent cc08d30 commit ca3cb96
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,10 +29,7 @@ const { | |||
| 29 | 29 | StringPrototypeToLowerCase, | |
| 30 | 30 | } = primordials; | |
| 31 | 31 | ||
| 32 | - const { | ||
| 33 | - ERR_INVALID_ARG_TYPE, | ||
| 34 | - ERR_OUT_OF_RANGE | ||
| 35 | - } = require('internal/errors').codes; | ||
| 32 | + const { validateInteger } = require('internal/validators'); | ||
| 36 | 33 | ||
| 37 | 34 | let OSRelease; | |
| 38 | 35 | ||
@@ -221,13 +218,9 @@ function hasColors(count, env) { | |||
| 221 | 218 | env = count; | |
| 222 | 219 | count = 16; | |
| 223 | 220 | } else { | |
| 224 | - if (typeof count !== 'number') { | ||
| 225 | - throw new ERR_INVALID_ARG_TYPE('count', 'number', count); | ||
| 226 | - } | ||
| 227 | - if (count < 2) { | ||
| 228 | - throw new ERR_OUT_OF_RANGE('count', '>= 2', count); | ||
| 229 | - } | ||
| 221 | + validateInteger(count, 'count', 2); | ||
| 230 | 222 | } | |
| 223 | + | ||
| 231 | 224 | return count <= 2 ** getColorDepth(env); | |
| 232 | 225 | } | |
| 233 | 226 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments