MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / defaultObjcModuleName

Function defaultObjcModuleName

src/resolution/frameworks/react-native.ts:93–97  ·  view source on GitHub ↗

* Default ObjC module name when `RCT_EXPORT_MODULE()` has no argument: * strip a leading `RCT` prefix from the class name (Apple's convention) * and treat the rest as the JS-visible module name. `RCTGeolocation` → * `Geolocation`. Class names without an `RCT` prefix are returned * unchanged.

(className: string)

Source from the content-addressed store, hash-verified

91 * unchanged.
92 */
93function defaultObjcModuleName(className: string): string {
94 return className.startsWith('RCT') && className.length > 3
95 ? className.slice(3)
96 : className;
97}
98
99/**
100 * Parse an ObjC `.m`/`.mm` file's source for `RCT_EXPORT_MODULE` and

Callers 1

parseObjcRNExportsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected