export const toArray = (x: T | T[] | null) => (x === null ? [] : Array.isArray(x) ? x : [x])