Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports.castValue = function(dakota, value) {
// cassandra tuple
if (value instanceof nmCassandraTypes.Tuple) {
value = value.values();
}
// cassandra types
if (value instanceof nmCassandraTypes.BigDecimal) {
return value.toNumber();
}
else if (value instanceof nmCassandraTypes.InetAddress) {
return value.toString();
}
else if (value instanceof nmCassandraTypes.Integer) {
return value.toNumber();
}
else if (value instanceof nmCassandraTypes.LocalDate) {
return value.toString();
}
else if (value instanceof nmCassandraTypes.LocalTime) {
return value.toString();
}
else if (value instanceof nmCassandraTypes.TimeUuid) {
return value.toString();
}
else if (value instanceof nmCassandraTypes.Uuid) {
return value.toString();
var types = require('cassandra-driver').types,
Uuid = types.Uuid,
TimeUuid = types.TimeUuid,
Integer = types.Integer,
BigDecimal = types.BigDecimal,
InetAddress = types.InetAddress,
LocalDate = types.LocalDate,
LocalTime = types.LocalTime,
Long = types.Long;
/**
* Cast value from Cassandra data type to Waterline type
*
* @param value
* @returns {*}
*/
exports.castFromCassandraToWaterline = function(value) {
var cast = function(value) {
var ret = value;