commonUtil.js 536 B

12345678910111213141516
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.isClient = exports.isBrowserClient = void 0;
  6. exports.toArray = toArray;
  7. function toArray(value) {
  8. if (Array.isArray(value)) {
  9. return value;
  10. }
  11. return value !== undefined ? [value] : [];
  12. }
  13. const isClient = exports.isClient = typeof window !== 'undefined' && window.document && window.document.documentElement;
  14. /** Is client side and not jsdom */
  15. const isBrowserClient = exports.isBrowserClient = process.env.NODE_ENV !== 'test' && isClient;