import reg from "../shares/reg.js";

/**
 * @param el className
 */
export function $el(el){
    if(typeof el === 'string' && el?.match(reg.regEl)?.[1] !== null){
        return document.querySelector(el)
    }
    console.log('not dom');
    return 0
}
export function $elByClass(el){
    if(typeof el === 'string' && el?.match(reg.regEl)?.[1] === undefined){
        return [...document.getElementsByClassName(el)]
    }else{
        console.log('not dom');
        return 0
    }
}