commonUtil.js 352 B

123456789
  1. export function toArray(value) {
  2. if (Array.isArray(value)) {
  3. return value;
  4. }
  5. return value !== undefined ? [value] : [];
  6. }
  7. export const isClient = typeof window !== 'undefined' && window.document && window.document.documentElement;
  8. /** Is client side and not jsdom */
  9. export const isBrowserClient = process.env.NODE_ENV !== 'test' && isClient;