function $(selector: string) { const nodes = document.querySelectorAll(selector); if (nodes.length === 0) { return undefined; } if (nodes.length === 1) { return nodes[0]; } return nodes; } export default $;