/**
 * @since Last modified: 2023-12-14 12:23:01
 * @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 getDataType from "./getDataType";
import trim from "./trim";
const getClasses = (data: string | string[]) => {
    let dataType = getDataType(data), separator: string, result: string[] = [];
    if (dataType === 'Array') {
        result = (data as string[]).filter((k: any) => k && typeof k === 'string');
    } else {
        data = trim((data as string));
        separator = data.includes(',') ? ',' : ' ';
        result = data.split(separator);
    }
    return result;
}
export default getClasses;
