commonUtil.js 559 B

123456789101112131415161718
  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. var isClient = typeof window !== 'undefined' && window.document && window.document.documentElement;
  14. /** Is client side and not jsdom */
  15. exports.isClient = isClient;
  16. var isBrowserClient = process.env.NODE_ENV !== 'test' && isClient;
  17. exports.isBrowserClient = isBrowserClient;