import { $ } from 'iflyjs' console.log($('#test')) // output: div node
function $(selector: string) { const nodes = document.querySelectorAll(selector) if (nodes.length === 0) { return undefined } if (nodes.length === 1) { return nodes[0] } return nodes }