{"version":3,"file":"arrays.js","sources":["../../../../packages/utils/arrays.ts"],"sourcesContent":["export const unique = (arr: T[]) => [...new Set(arr)]\n\ntype Many = T | ReadonlyArray\n// TODO: rename to `ensureArray`\n/** like `_.castArray`, except falsy value returns empty array. */\nexport const castArray = (arr: Many): T[] => {\n if (!arr && (arr as any) !== 0) return []\n return Array.isArray(arr) ? arr : [arr]\n}\n\n// TODO: remove import alias\n// avoid naming conflicts\nexport { castArray as ensureArray } from 'lodash-unified'\n"],"names":[],"mappings":";;;;;;AAAY,MAAC,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,EAAE;AACrC,MAAC,SAAS,GAAG,CAAC,GAAG,KAAK;AAClC,EAAE,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;AACvB,IAAI,OAAO,EAAE,CAAC;AACd,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;AAC1C;;;;;;;;;"}