MCPcopy Index your code
hub / github.com/ptmt/react-native-macos / onFileLoaded

Function onFileLoaded

packager/src/ModuleGraph/Graph.js:140–169  ·  view source on GitHub ↗
(
    error,
    file,
    dependencyIDs,
    id,
    parent,
    parentDependencyIndex,
  )

Source from the content-addressed store, hash-verified

138 }
139
140 function onFileLoaded(
141 error,
142 file,
143 dependencyIDs,
144 id,
145 parent,
146 parentDependencyIndex,
147 ) {
148 if (error) {
149 return;
150 }
151
152 const {path} = nullthrows(file);
153 dependencyIDs = nullthrows(dependencyIDs);
154
155 const parentModule = modules.get(parent);
156 invariant(parentModule, 'Invalid parent module: ' + String(parent));
157 parentModule.dependencies[parentDependencyIndex] = {id, path};
158
159 if ((!skip || !skip.has(path)) && !modules.has(path)) {
160 const module = {
161 dependencies: Array(dependencyIDs.length),
162 file: nullthrows(file),
163 };
164 modules.set(path, module);
165 for (let i = 0; i < dependencyIDs.length; ++i) {
166 loadModule(dependencyIDs[i], path, i);
167 }
168 }
169 }
170
171 return {collect, loadModule};
172}

Callers 1

loadModuleFunction · 0.85

Calls 5

invariantFunction · 0.85
hasMethod · 0.80
loadModuleFunction · 0.70
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…