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

Function validateCloudOptions

lib/client-options.js:180–195  ·  view source on GitHub ↗

* Validates the options to connect to a cloud instance. * @private

(options)

Source from the content-addressed store, hash-verified

178 * @private
179 */
180function validateCloudOptions(options) {
181 const bundle = options.cloud.secureConnectBundle;
182
183 // eslint-disable-next-line no-undef
184 if (!(typeof bundle === 'string' || (typeof URL !== 'undefined' && bundle instanceof URL))) {
185 throw new TypeError('secureConnectBundle in cloud options must be of type string');
186 }
187
188 if (options.contactPoints) {
189 throw new TypeError('Contact points can not be defined when cloud settings are provided');
190 }
191
192 if (options.sslOptions) {
193 throw new TypeError('SSL options can not be defined when cloud settings are provided');
194 }
195}
196
197/**
198 * Validates the policies from the client options.

Callers 1

extendFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected