typedash
Version:
modern, type-safe collection of utility functions
15 lines (13 loc) • 471 B
JavaScript
import { capitalize } from './chunk-ZTFYJJRI.js';
// src/functions/camelCase/camelCase.ts
function camelCase(string) {
if (!/[a-z]+/i.test(string)) {
return string;
}
const words = string.trim().split(wordsRegex);
return words.map((word, index) => index === 0 ? word.toLowerCase() : capitalize(word)).join("");
}
var wordsRegex = /[\s_-]+|(?<=[a-z])(?=[A-Z])/;
export { camelCase };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=chunk-AH65ROFS.js.map