import {toArray} from "@peryl/utils/toArray"; export function ids2map(id: string | string[]): Record { if (typeof id === "string") { return { [id]: true }; } return toArray(id).reduce((prev, i) => { prev[i] = true; return prev; }, {} as Record); }