/**
 * @desc 生成唯一样式名
 * @author denghuan
 */
import classNames from 'classnames';
/**
 * @param names: Original class name.
 * @returns Unique class name.
 */
export const className = (() => {
    const classNameMap = new Map();
    return (...names) => {
        return classNames(names.map(n => {
            let className = classNameMap.get(n);
            let prefix = n.replace(/[aeiou]/g, '').slice(0, 2);
            if (prefix === '') {
                prefix = n.slice(0, 2);
            }
            if (!className) {
                className = `${prefix}-${Math.random().toString(36).slice(-6)}`;
                classNameMap.set(n, className);
            }
            return className;
        }));
    };
})();
