mirror of
https://github.com/Sevichecc/Urara-Blog.git
synced 2025-05-25 01:39:13 +08:00
8 lines
319 B
Text
8 lines
319 B
Text
const toLowerCase = Function.call.bind("".toLowerCase);
|
|
|
|
export default function formatBuilderName(type) {
|
|
// FunctionExpression -> functionExpression
|
|
// JSXIdentifier -> jsxIdentifier
|
|
// V8IntrinsicIdentifier -> v8IntrinsicIdentifier
|
|
return type.replace(/^([A-Z](?=[a-z0-9])|[A-Z]+(?=[A-Z]))/, toLowerCase);
|
|
}
|