export const getArrayFromLocalStorage = (name: string, sep: string | RegExp = ','): T[] | null => { const raw = localStorage.getItem(name) if (!raw) return null return raw.split(sep).map(elm => elm as T) }