Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function toGraknDatatype(dataTypeParam) {
switch (dataTypeParam) {
case 'string': return dataType.STRING;
case 'date': return dataType.DATE;
case 'boolean': return dataType.BOOLEAN;
case 'long': return dataType.LONG;
case 'double': return dataType.DOUBLE;
default: throw new Error(`Datatype not recognised. Received [${dataTypeParam}]`);
}
}