UNPKG

jsmodern

Version:

An extension to existing JavaScript, influenced by other great languages such as Rust, Dart, Java, Golang, etc.

11 lines 371 B
import { postCase, preCase } from './to-case'; export const toCamelCase = { label: 'toCamelCase', fn: function stringToCamelCase() { const ctx = this; return !ctx.length ? '' : postCase(preCase(ctx).replace(/([^a-zA-Z0-9]+)(\b[a-zA-z])/g, (_, __, c) => c.toUpperCase())); }, }; //# sourceMappingURL=to-camel-case.js.map