| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 651c58b commit e87cd45
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -75,6 +75,7 @@ const { getValidatedPath } = require('internal/fs/utils'); | |||
| 75 | 75 | const { | |
| 76 | 76 | isInt32, | |
| 77 | 77 | validateAbortSignal, | |
| 78 | + validateBoolean, | ||
| 78 | 79 | validateObject, | |
| 79 | 80 | validateString, | |
| 80 | 81 | } = require('internal/validators'); | |
@@ -459,10 +460,8 @@ function normalizeSpawnArguments(file, args, options) { | |||
| 459 | 460 | } | |
| 460 | 461 | ||
| 461 | 462 | // Validate detached, if present. | |
| 462 | - if (options.detached != null && | ||
| 463 | - typeof options.detached !== 'boolean') { | ||
| 464 | - throw new ERR_INVALID_ARG_TYPE('options.detached', | ||
| 465 | - 'boolean', options.detached); | ||
| 463 | + if (options.detached != null) { | ||
| 464 | + validateBoolean(options.detached, 'options.detached'); | ||
| 466 | 465 | } | |
| 467 | 466 | ||
| 468 | 467 | // Validate the uid, if present. | |
@@ -489,19 +488,15 @@ function normalizeSpawnArguments(file, args, options) { | |||
| 489 | 488 | } | |
| 490 | 489 | ||
| 491 | 490 | // Validate windowsHide, if present. | |
| 492 | - if (options.windowsHide != null && | ||
| 493 | - typeof options.windowsHide !== 'boolean') { | ||
| 494 | - throw new ERR_INVALID_ARG_TYPE('options.windowsHide', | ||
| 495 | - 'boolean', options.windowsHide); | ||
| 491 | + if (options.windowsHide != null) { | ||
| 492 | + validateBoolean(options.windowsHide, 'options.windowsHide'); | ||
| 496 | 493 | } | |
| 497 | 494 | ||
| 498 | 495 | // Validate windowsVerbatimArguments, if present. | |
| 499 | 496 | let { windowsVerbatimArguments } = options; | |
| 500 | - if (windowsVerbatimArguments != null && | ||
| 501 | - typeof windowsVerbatimArguments !== 'boolean') { | ||
| 502 | - throw new ERR_INVALID_ARG_TYPE('options.windowsVerbatimArguments', | ||
| 503 | - 'boolean', | ||
| 504 | - windowsVerbatimArguments); | ||
| 497 | + if (windowsVerbatimArguments != null) { | ||
| 498 | + validateBoolean(windowsVerbatimArguments, | ||
| 499 | + 'options.windowsVerbatimArguments'); | ||
| 505 | 500 | } | |
| 506 | 501 | ||
| 507 | 502 | if (options.shell) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments