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

Function bind

src/resolution/frameworks/react-native.ts:235–244  ·  view source on GitHub ↗
(alias: string, moduleName: string)

Source from the content-addressed store, hash-verified

233 ambiguous: Set<string>
234): void {
235 const bind = (alias: string, moduleName: string): void => {
236 if (ambiguous.has(alias)) return;
237 const prior = aliases.get(alias);
238 if (prior !== undefined && prior !== moduleName) {
239 aliases.delete(alias);
240 ambiguous.add(alias);
241 return;
242 }
243 aliases.set(alias, moduleName);
244 };
245 const direct = /\b(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*(?::[^=;]+)?=\s*NativeModules\.([A-Z][\w$]*)/g;
246 let m: RegExpExecArray | null;
247 while ((m = direct.exec(source)) !== null) bind(m[1]!, m[2]!);

Callers 1

Calls 5

hasMethod · 0.80
getMethod · 0.65
deleteMethod · 0.65
addMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected