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

Function defaultObjcModuleName

src/resolution/frameworks/react-native.ts:74–78  ·  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

72 * unchanged.
73 */
74function defaultObjcModuleName(className: string): string {
75 return className.startsWith('RCT') && className.length > 3
76 ? className.slice(3)
77 : className;
78}
79
80/**
81 * 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