| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent de94611 commit 338189f
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -164,7 +164,7 @@ const validateObject = hideStackFrames( | |||
| 164 | 164 | } | |
| 165 | 165 | }); | |
| 166 | 166 | ||
| 167 | - const validateArray = hideStackFrames((value, name, { minLength = 0 } = {}) => { | ||
| 167 | + const validateArray = hideStackFrames((value, name, minLength = 0) => { | ||
| 168 | 168 | if (!ArrayIsArray(value)) { | |
| 169 | 169 | throw new ERR_INVALID_ARG_TYPE(name, 'Array', value); | |
| 170 | 170 | } | |
@@ -175,8 +175,7 @@ const validateArray = hideStackFrames((value, name, { minLength = 0 } = {}) => { | |||
| 175 | 175 | }); | |
| 176 | 176 | ||
| 177 | 177 | function validateSignalName(signal, name = 'signal') { | |
| 178 | - if (typeof signal !== 'string') | ||
| 179 | - throw new ERR_INVALID_ARG_TYPE(name, 'string', signal); | ||
| 178 | + validateString(signal, name); | ||
| 180 | 179 | ||
| 181 | 180 | if (signals[signal] === undefined) { | |
| 182 | 181 | if (signals[signal.toUpperCase()] !== undefined) { | |
@@ -208,7 +207,7 @@ function validateEncoding(data, encoding) { | |||
| 208 | 207 | ||
| 209 | 208 | // Check that the port number is not NaN when coerced to a number, | |
| 210 | 209 | // is an integer and that it falls within the legal range of port numbers. | |
| 211 | - function validatePort(port, name = 'Port', { allowZero = true } = {}) { | ||
| 210 | + function validatePort(port, name = 'Port', allowZero = true) { | ||
| 212 | 211 | if ((typeof port !== 'number' && typeof port !== 'string') || | |
| 213 | 212 | (typeof port === 'string' && port.trim().length === 0) || | |
| 214 | 213 | +port !== (+port >>> 0) || | |
| Back | FazBrowse Home | New Git URL |
0 commit comments