package com.example.base.extensions

import com.google.gson.Gson
import com.google.gson.reflect.TypeToken

inline fun <reified T> Gson.toList(str: String): List<T> {
    return try {
        Gson().fromJson(str, object : TypeToken<List<T>?>() {}.type)
    } catch (e: Exception) {
        emptyList()
    }
}
