UNPKG

penpal

Version:

A promise-based library for communicating with iframes via postMessage.

9 lines (8 loc) 267 B
import { ErrorCode } from '../enums'; export default (iframe) => { if (!iframe.src && !iframe.srcdoc) { const error = new Error('Iframe must have src or srcdoc property defined.'); error.code = ErrorCode.NoIframeSrc; throw error; } };