MCPcopy Create free account
hub / github.com/Snapchat/Valdi / getJs

Method getJs

valdi/src/valdi/runtime/Resources/Bundle.cpp:171–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169}
170
171Result<JavaScriptFile> Bundle::getJs(const StringBox& jsPath) {
172 std::lock_guard<std::recursive_mutex> guard(_mutex);
173 const auto& it = _jsFilesByPath.find(jsPath);
174 if (it != _jsFilesByPath.end()) {
175 return it->second;
176 }
177
178 auto key = jsPath.append(".js");
179 auto entryResult = getEntry(key);
180 if (!entryResult) {
181 return entryResult.moveError();
182 }
183
184 auto entry = entryResult.moveValue();
185
186 auto jsFile = JavaScriptFile(entryResult.value(), StringBox::emptyString());
187
188 _jsFilesByPath[jsPath] = jsFile;
189
190 return jsFile;
191}
192
193std::vector<StringBox> Bundle::getAllEntryPaths() {
194 std::lock_guard<std::recursive_mutex> guard(_mutex);

Callers 4

hotReloadMethod · 0.80
populateSourceMapMethod · 0.80
loadJsModuleMethod · 0.80
runtimeGetSourceMapMethod · 0.80

Calls 5

JavaScriptFileClass · 0.85
endMethod · 0.65
appendMethod · 0.65
valueMethod · 0.65
findMethod · 0.45

Tested by 1

hotReloadMethod · 0.64