/**
 * @since Last modified: 2024-01-18 16:12:20
 * @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';
import Observe from '../modules/Observe';
const elProps = (el) => {
    let target = getEl(el);
    if (target) {
        return {
            add: (key, value = true) => {
                !target.hasOwnProperty('ax') ? target.ax = {} : null;
                target.ax[key] = value;
                return target;
            },
            remove: (key) => {
                delete target?.ax[key];
                return target;
            },
            observer: new Observe(target.ax || {}),
        };
    }
    else {
        return null;
    }
};
export default elProps;
