/**
 * @since Last modified: 2024-08-13 20:16:45
 * @function elProps
 * @description Operate on the ax propperty of the node.
 * @param {getEl} el  - Target node or node selector, please refer to the util : getEl.
 * @returns {null|object} - Return the operation methods.
 * @see {@link https://codepen.io/axui/pen/rNPmEqz|demo @ codepen}
 * @example
 * ax.elProps('#demo').add('isBoy');
 * <!--return target dom-->
 */
'use strict';
import getEl from './getEl';
const elProps = (el) => {
    let target = getEl(el), result = null;
    if (target) {
        !target.hasOwnProperty('ax') ? target.ax = {} : null;
        result = {
            add: (key, value = true) => {
                key && (target.ax[key] = value);
                return target;
            },
            remove: (key) => {
                key && (delete target.ax[key]);
                return target;
            }
        };
    }
    return result;
};
export default elProps;
