| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5e10112 commit 5afdc1f
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -155,7 +155,7 @@ const validateObject = hideStackFrames( | |||
| 155 | 155 | } | |
| 156 | 156 | }); | |
| 157 | 157 | ||
| 158 | - const validateArray = hideStackFrames((value, name, { minLength = 0 } = {}) => { | ||
| 158 | + const validateArray = hideStackFrames((value, name, minLength = 0) => { | ||
| 159 | 159 | if (!ArrayIsArray(value)) { | |
| 160 | 160 | throw new ERR_INVALID_ARG_TYPE(name, 'Array', value); | |
| 161 | 161 | } | |
@@ -166,8 +166,7 @@ const validateArray = hideStackFrames((value, name, { minLength = 0 } = {}) => { | |||
| 166 | 166 | }); | |
| 167 | 167 | ||
| 168 | 168 | function validateSignalName(signal, name = 'signal') { | |
| 169 | - if (typeof signal !== 'string') | ||
| 170 | - throw new ERR_INVALID_ARG_TYPE(name, 'string', signal); | ||
| 169 | + validateString(signal, name); | ||
| 171 | 170 | ||
| 172 | 171 | if (signals[signal] === undefined) { | |
| 173 | 172 | if (signals[StringPrototypeToUpperCase(signal)] !== undefined) { | |
@@ -199,7 +198,7 @@ function validateEncoding(data, encoding) { | |||
| 199 | 198 | ||
| 200 | 199 | // Check that the port number is not NaN when coerced to a number, | |
| 201 | 200 | // is an integer and that it falls within the legal range of port numbers. | |
| 202 | - function validatePort(port, name = 'Port', { allowZero = true } = {}) { | ||
| 201 | + function validatePort(port, name = 'Port', allowZero = true) { | ||
| 203 | 202 | if ((typeof port !== 'number' && typeof port !== 'string') || | |
| 204 | 203 | (typeof port === 'string' && StringPrototypeTrim(port).length === 0) || | |
| 205 | 204 | +port !== (+port >>> 0) || | |
| Back | FazBrowse Home | New Git URL |
0 commit comments