MCPcopy Create free account
hub / github.com/subquery/subql / customCamelCaseGraphqlKey

Function customCamelCaseGraphqlKey

packages/node-core/src/utils/object.ts:39–45  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

37}
38
39export function customCamelCaseGraphqlKey(str: string) {
40 return str
41 .replace(/([a-z])([A-Z])/g, '$1_$2')
42 .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')
43 .toLowerCase()
44 .replace(/_([a-z])/g, (_, letter) => letter.toUpperCase());
45}

Callers 2

isIndexedMethod · 0.90
isIndexedHistoricalMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected