MCPcopy Create free account
hub / github.com/apache/cassandra-nodejs-driver / validateEncodingOptions

Function validateEncodingOptions

lib/client-options.js:283–305  ·  view source on GitHub ↗

* Validates the encoding options. * @param {ClientOptions.encoding} encodingOptions * @private

(encodingOptions)

Source from the content-addressed store, hash-verified

281 * @private
282 */
283function validateEncodingOptions(encodingOptions) {
284 if (encodingOptions.map) {
285 const mapConstructor = encodingOptions.map;
286 if (typeof mapConstructor !== 'function' ||
287 typeof mapConstructor.prototype.forEach !== 'function' ||
288 typeof mapConstructor.prototype.set !== 'function') {
289 throw new TypeError('Map constructor not valid');
290 }
291 }
292
293 if (encodingOptions.set) {
294 const setConstructor = encodingOptions.set;
295 if (typeof setConstructor !== 'function' ||
296 typeof setConstructor.prototype.forEach !== 'function' ||
297 typeof setConstructor.prototype.add !== 'function') {
298 throw new TypeError('Set constructor not valid');
299 }
300 }
301
302 if ((encodingOptions.useBigIntAsLong || encodingOptions.useBigIntAsVarint) && typeof BigInt === 'undefined') {
303 throw new TypeError('BigInt is not supported by the JavaScript engine');
304 }
305}
306
307function validateApplicationInfo(options) {
308 function validateString(key) {

Callers 1

extendFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected