MCPcopy
hub / github.com/vercel/next.js / camelCase

Function camelCase

packages/next-codemod/transforms/name-default-component.ts:13–18  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

11import { createParserFromPath } from '../lib/parser'
12
13const camelCase = (value: string): string => {
14 const val = value.replace(/[-_\s.]+(.)?/g, (_match, chr) =>
15 chr ? chr.toUpperCase() : ''
16 )
17 return val.slice(0, 1).toUpperCase() + val.slice(1)
18}
19
20const isValidIdentifier = (value: string): boolean =>
21 /^[a-zA-ZÀ-ÿ][0-9a-zA-ZÀ-ÿ]+$/.test(value)

Callers 1

nameFunctionComponentFunction · 0.70

Calls 3

toUpperCaseMethod · 0.80
replaceMethod · 0.65
sliceMethod · 0.45

Tested by

no test coverage detected