UNPKG

piral

Version:

The all-in-one piral package.

10 lines (9 loc) 306 B
export function getContainer(selector?: string | Element) { if (typeof selector === 'string') { return document.querySelector(selector); } else if (selector && selector instanceof Element) { return selector; } else { return document.body.appendChild(document.createElement('div')); } }