All files / Scripts Poster.ts

60% Statements 3/5
0% Branches 0/1
66.66% Functions 2/3
60% Lines 3/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 149x 11x                 11x      
export class Poster {
    public static site() { return window.location.protocol + "//" + window.location.host; }
 
    public static postMessageToFrame(frame: Window, eventName: string, data?: unknown): void {
        Iif (frame) {
            frame.postMessage({ eventName: eventName, data: data }, Poster.site());
        }
    }
 
    public static postMessageToParent(eventName: string, data?: unknown): void {
        window.parent.postMessage({ eventName: eventName, data: data }, Poster.site());
    }
}