Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function generateOptions(settings) {
var clientOptions = cassandra.defaultOptions();
settings.hostname = (settings.hostname || settings.host || '127.0.0.1');
settings.port = (settings.port || 9042);
settings.database = (settings.keyspace || settings.database || settings.db || 'test');
if (settings.contactPoints) {
clientOptions.contactPoints = settings.contactPoints;
} else {
clientOptions.contactPoints = [
settings.hostname,
];
}
clientOptions.protocolOptions.port = settings.port;
clientOptions.keyspace = settings.database;
clientOptions.sslOptions = settings.sslOptions;