/**
 * @since Last modified: 2024-08-01 18:15:25
 * @function contains
 * @description Determine whether the two nodes contain or equal relationships.
 * @param  {getEl} child - Child node.
 * @param  {getEl} parent - Parent node.
 * @returns {boolean} Return true or false.
 * @see {@link https://codepen.io/axui/pen/bGzQOYP|demo @ codepen}
 * @example
 * ax.contains('#child','#parent');
 * <!--return true / false-->
 */
'use strict';
import getEl from "./getEl";
const contains = (child, parent) => {
    let childDom = getEl(child), result = false;
    if (!childDom) {
        return result;
    }
    if (Array.isArray(parent)) {
        for (let k of parent) {
            let parentDom = getEl(k);
            if (!parentDom) {
                continue;
            }
            if (parentDom.contains(childDom)) {
                result = true;
                break;
            }
        }
    }
    else {
        let parentDom = getEl(parent);
        result = parentDom && parentDom.contains(childDom) ? true : false;
    }
    return result;
};
export default contains;
