/**
 * @module tgam-patterns/utils
 */
import isNil from "lodash/isNil";

/**
 * @method toArray
 * @description converts an array like (nodelist) to an array
 * @param {NodeList} val
 * @returns {Array}
 */
export function toArray(val) {
  return isNil(Array.from) ? [].slice.call(val) : Array.from(val);
}
