import { CHECK_CAMEL_CASE } from '../../validations/regex.js';

const toCamelCase = (str) => {
    if (CHECK_CAMEL_CASE.test(str)) {
        return str;
    }
    return str
        .toLowerCase()
        .split(/[\s_-]+/)
        .map((word, index) => index === 0 ? word : word.charAt(0).toUpperCase() + word.slice(1))
        .join('');
};

export { toCamelCase };
//# sourceMappingURL=toCamelCase.js.map
