(options)
| 185 | // ============================================================================= |
| 186 | |
| 187 | function validateBaseConsumerOptions(options) { |
| 188 | validateObject(options, 'options'); |
| 189 | if (options.limit !== undefined) { |
| 190 | validateInteger(options.limit, 'options.limit', 0); |
| 191 | } |
| 192 | if (options.encoding !== undefined) { |
| 193 | if (typeof options.encoding !== 'string') { |
| 194 | throw new ERR_INVALID_ARG_TYPE('options.encoding', 'string', |
| 195 | options.encoding); |
| 196 | } |
| 197 | try { |
| 198 | new TextDecoder(options.encoding); |
| 199 | } catch { |
| 200 | throw new ERR_INVALID_ARG_VALUE.RangeError( |
| 201 | 'options.encoding', options.encoding); |
| 202 | } |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | function validateConsumerOptions(options) { |
| 207 | validateBaseConsumerOptions(options); |
no outgoing calls
no test coverage detected
searching dependent graphs…