/**
 * @since Last modified: 2024/03/19 09:16:10
 * @function hide
 * @description Let the hidden element be displayed.
 * @param {object} options  - The parameters of hide.
 * @param {getEl} [options.el]  - The target node.The writing is the same as getEl.
 * @param {string} [options.display=none]  - The hide method of box.Can be filled in:'none'|'hidden'.
 * @param {function} [options.done]  - The call back after completion.No parameters.
 * @returns {*} - The the target dom.
 * @see {@link https://codepen.io/axui/pen/BaMbGXR|demo @ codepen}
 * @example
 * ax.hide({el:'#demo'});
 * <!--return the target dom-->
 */
'use strict';
import getEl from "./getEl";
let hide = ({ el, display = 'none', done }) => {
    let target = getEl(el);
    if (!target) {
        throw new Error('The target node does not exist!');
    }
    if (display === 'hidden') {
        target.style.visibility = 'hidden';
    }
    else {
        target.style.display = 'none';
    }
    done && done.call(target);
    return target;
};
export default hide;
