UNPKG

riot

Version:

Simple and elegant component-based UI library

18 lines (15 loc) 609 B
/* Riot WIP, @license MIT */ import domToArray from '../bianco.dom-to-array/index.next.js'; /** * Simple helper to find DOM nodes returning them as array like loopable object * @param { string|DOMNodeList } selector - either the query or the DOM nodes to arraify * @param { HTMLElement } scope - context defining where the query will search for the DOM nodes * @returns { Array } DOM nodes found as array */ function $(selector, scope) { return domToArray(typeof selector === 'string' ? (scope || document).querySelectorAll(selector) : selector ) } export { $ as default };