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