1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.getWindow = exports.getLocation = exports.redirect = exports.shouldRedirect = void 0;
|
4 | function shouldRedirect(frame) {
|
5 | return frame === window;
|
6 | }
|
7 | exports.shouldRedirect = shouldRedirect;
|
8 | function redirect(url) {
|
9 | var location = getLocation();
|
10 | if (!location) {
|
11 | return;
|
12 | }
|
13 | location.assign(url);
|
14 | }
|
15 | exports.redirect = redirect;
|
16 | function getLocation() {
|
17 | return hasWindow() ? window.location : undefined;
|
18 | }
|
19 | exports.getLocation = getLocation;
|
20 | function getWindow() {
|
21 | return hasWindow() ? window : undefined;
|
22 | }
|
23 | exports.getWindow = getWindow;
|
24 | function hasWindow() {
|
25 | return typeof window !== 'undefined';
|
26 | }
|