MCPcopy Index your code
hub / github.com/nodejs/node / validateBaseConsumerOptions

Function validateBaseConsumerOptions

lib/internal/streams/iter/consumers.js:187–204  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

185// =============================================================================
186
187function 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
206function validateConsumerOptions(options) {
207 validateBaseConsumerOptions(options);

Callers 2

validateConsumerOptionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…