import { Type } from './Type.js';
/**
 * Type that maps an SQL DOUBLE to a JS string or number.
 */
export class DoubleType extends Type {
  /* v8 ignore next */
  convertToJSValue(value) {
    if (this.prop?.runtimeType === 'number') {
      return +value;
    }
    return String(value);
  }
  getColumnType(prop, platform) {
    return platform.getDoubleDeclarationSQL();
  }
  compareAsType() {
    return this.prop?.runtimeType ?? 'number';
  }
}
