index.js 557 B

12345678910111213141516171819202122
  1. /* eslint-disable import/no-unresolved */
  2. import window from 'window';
  3. import * as common from './common';
  4. import * as jasmine from './jasmine';
  5. const exportToWindow = (helpersHolder) => {
  6. Object.keys(helpersHolder).forEach((key) => {
  7. if (key === '__esModule') {
  8. return;
  9. }
  10. if (window[key] !== void 0) {
  11. throw Error(`Cannot export "${key}" helper because this name is already assigned.`);
  12. }
  13. window[key] = helpersHolder[key];
  14. });
  15. };
  16. // Export all helpers to the window.
  17. exportToWindow(common);
  18. exportToWindow(jasmine);