blob: f00a3c4a610e22eb9711fa986f2dcf089f7cfda1 (
plain)
1
2
3
4
5
6
7
8
|
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);
}
|