sdk/src/Platform/cordova/sqliteSerializer.js
function deserializeMember(value, columnType) {
    
    // Handle this special case first.
    // Simply return 'value' if a corresponding columnType is not defined.   
    if (!columnType) {
        return value;
    }

    // Start by checking if the specified column type is valid.
    if (!isColumnTypeValid(columnType)) {
            throw new Error('Column type ' + columnType + ' is not supported');
    }

    // Now check if the specified value can be stored in a column of type columnType.
    if (!isSqliteValueCompatibleWithColumnType(value, columnType)) {
        throw new Error('Converting value ' + JSON.stringify(value) + ' of type ' + typeof value +
                            ' to type ' + columnType + ' is not supported.');
    }

    // If we are here, it means we are good to proceed with deserialization
    
    var deserializedValue, error;

    switch (columnType) {
        case ColumnType.Object:
            deserializedValue = typeConverter.convertToObject(value);
            break;
        case ColumnType.Array:
            deserializedValue = typeConverter.convertToArray(value);
            break;
        case ColumnType.String:
        case ColumnType.Text:
            deserializedValue = typeConverter.convertToText(value);
            break;
        case ColumnType.Integer:
        case ColumnType.Int:
            deserializedValue = typeConverter.convertToInteger(value);
            break;
        case ColumnType.Boolean:
        case ColumnType.Bool:
            deserializedValue = typeConverter.convertToBoolean(value);
            break;
        case ColumnType.Date:
            deserializedValue = typeConverter.convertToDate(value);
            break;
        case ColumnType.Real:
        case ColumnType.Float:
            deserializedValue = typeConverter.convertToReal(value);
            break;
        default:
            throw new Error(_.format(Platform.getResourceString("sqliteSerializer_UnsupportedColumnType"), columnType));
    }

    return deserializedValue;
}
function deserializeMember(value, columnType) {
    
    // Handle this special case first.
    // Simply return 'value' if a corresponding columnType is not defined.   
    if (!columnType) {
        return value;
    }

    // Start by checking if the specified column type is valid.
    if (!isColumnTypeValid(columnType)) {
            throw new Error('Column type ' + columnType + ' is not supported');
    }

    // Now check if the specified value can be stored in a column of type columnType.
    if (!isSqliteValueCompatibleWithColumnType(value, columnType)) {
        throw new Error('Converting value ' + JSON.stringify(value) + ' of type ' + typeof value +
                            ' to type ' + columnType + ' is not supported.');
    }

    // If we are here, it means we are good to proceed with deserialization
    
    var deserializedValue, error;

    switch (columnType) {
        case ColumnType.Object:
            deserializedValue = typeConverter.convertToObject(value);
            break;
        case ColumnType.Array:
            deserializedValue = typeConverter.convertToArray(value);
            break;
        case ColumnType.String:
        case ColumnType.Text:
            deserializedValue = typeConverter.convertToText(value);
            break;
        case ColumnType.Integer:
        case ColumnType.Int:
            deserializedValue = typeConverter.convertToInteger(value);
            break;
        case ColumnType.Boolean:
        case ColumnType.Bool:
            deserializedValue = typeConverter.convertToBoolean(value);
            break;
        case ColumnType.Date:
            deserializedValue = typeConverter.convertToDate(value);
            break;
        case ColumnType.Real:
        case ColumnType.Float:
            deserializedValue = typeConverter.convertToReal(value);
            break;
        default:
            throw new Error(_.format(Platform.getResourceString("sqliteSerializer_UnsupportedColumnType"), columnType));
    }

    return deserializedValue;
}
function deserializeMember ( value , columnType ) { // Handle this special case first. // Simply return 'value' if a corresponding columnType is not defined.    if ( ! columnType ) { return value ; } // Start by checking if the specified column type is valid. if ( ! isColumnTypeValid ( columnType ) ) { throw new Error ( 'Column type ' + columnType + ' is not supported' ) ; } // Now check if the specified value can be stored in a column of type columnType. if ( ! isSqliteValueCompatibleWithColumnType ( value , columnType ) ) { throw new Error ( 'Converting value ' + JSON . stringify ( value ) + ' of type ' + typeof value + ' to type ' + columnType + ' is not supported.' ) ; } // If we are here, it means we are good to proceed with deserialization var deserializedValue , error ; switch ( columnType ) { case ColumnType . Object : deserializedValue = typeConverter . convertToObject ( value ) ; break ; case ColumnType . Array : deserializedValue = typeConverter . convertToArray ( value ) ; break ; case ColumnType . String : case ColumnType . Text : deserializedValue = typeConverter . convertToText ( value ) ; break ; case ColumnType . Integer : case ColumnType . Int : deserializedValue = typeConverter . convertToInteger ( value ) ; break ; case ColumnType . Boolean : case ColumnType . Bool : deserializedValue = typeConverter . convertToBoolean ( value ) ; break ; case ColumnType . Date : deserializedValue = typeConverter . convertToDate ( value ) ; break ; case ColumnType . Real : case ColumnType . Float : deserializedValue = typeConverter . convertToReal ( value ) ; break ; default : throw new Error ( _ . format ( Platform . getResourceString ( "sqliteSerializer_UnsupportedColumnType" ) , columnType ) ) ; } return deserializedValue ; }
Deserializes a property of an object read from SQLite into a value of type columnType
Deserializes a property of an object read from SQLite into a value of type columnType