/**
 * @since Last modified: 2024/05/22 22:40:43
 * @function getClasses
 * @param {string|array} data  - Class string or class array.
 * @returns {array} - Return a classes array.
 * @see {@link https://codepen.io/axui/pen/dyaEQyd|demo @ codepen}
 * @example
 * ax.getClasses('demo01,demo02');
 * <!--return ['demo01','demo02']-->
 */
'use strict';
import ax from "../ax";
import getDataType from "./getDataType";
import trim from "./trim";
const getClasses = (data) => {
    let dataType = getDataType(data), separator, result = [];
    if (dataType === 'Array') {
        result = data.filter((k) => k && typeof k === 'string');
    }
    else {
        data = trim(data);
        separator = data.includes(ax.config.splitHyphen) ? ax.config.splitHyphen : ax.config.wordHyphen;
        result = data.split(separator);
    }
    return result.map((k) => trim(k, 'global')).filter(Boolean);
};
export default getClasses;
