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

Method transform

valdi/src/valdi/runtime/Resources/Remote/RemoteModuleManager.cpp:47–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45// For modules, we keep them compressed on disk, we decompress them when we want to read them.
46
47Result<Value> ModuleBundleResultTransformer::transform(const StringBox& /*localFilename*/,
48 const BytesView& data) const {
49 Result<ValdiModuleArchive> decompressedBundleResult;
50 if (_decompressionDisabled) {
51 decompressedBundleResult = ValdiModuleArchive::deserialize(data);
52 } else {
53 decompressedBundleResult = ValdiModuleArchive::decompress(data.data(), data.size());
54 }
55
56 if (!decompressedBundleResult) {
57 return decompressedBundleResult.moveError();
58 }
59
60 return Value(Valdi::makeShared<ValdiModuleArchiveWrapper>(
61 Valdi::makeShared<ValdiModuleArchive>(decompressedBundleResult.moveValue())));
62}
63
64std::string_view ModuleBundleResultTransformer::getItemTypeDescription() const {
65 return "module";

Callers 2

micromatch.jsFile · 0.45
transformLoadResultMethod · 0.45

Calls 11

rethrowMethod · 0.80
endMethod · 0.65
valueMethod · 0.65
errorMethod · 0.65
ValueClass · 0.50
VoidClass · 0.50
dataMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
getEntriesMethod · 0.45
failureMethod · 0.45

Tested by

no test coverage detected