function parseStringAsType (value, type) {
    switch (type) {
    case String:
        return String(value);
    case Number:
        return parseFloat(value);
    case Boolean:
        return value.toLowerCase() === 'true';
    default:
        throw new CordovaError('Invalid type: ' + type);
    }
}
Converts given string to given type