MCPcopy Create free account
hub / github.com/formkit/formkit / toCamelCase

Function toCamelCase

scripts/utils.mjs:39–45  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

37
38/** Given a string, convert it to camelCase */
39export function toCamelCase(str) {
40 return str
41 .replace(/(?:^\w|[A-Z]|\b\w)/g, function (word, index) {
42 return index === 0 ? word.toLowerCase() : word.toUpperCase()
43 })
44 .replace(/\s+/g, '')
45}
46
47/**
48 * Given a directory return all files recursively from subdirectories

Callers 1

getIconsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected