@medusajs/utils
Version:
Medusa utilities functions shared by Medusa core and Modules
11 lines • 367 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.toCamelCase = toCamelCase;
function toCamelCase(str) {
return /^([a-zA-Z]+)(([A-Z]([a-z]+))+)$/.test(str)
? str
: str
.toLowerCase()
.replace(/[^a-zA-Z0-9]+(.)/g, (_, chr) => chr.toUpperCase());
}
//# sourceMappingURL=to-camel-case.js.map
;