| 118 | } |
| 119 | |
| 120 | std::vector<uint8_t> unmarshallBinary(const Value& value, const Ref<BridgeContext>& bridgeContext) { |
| 121 | auto typedArray = value.checkedTo<Ref<ValueTypedArray>>(*bridgeContext); |
| 122 | if (typedArray == nullptr) { |
| 123 | return {}; |
| 124 | } |
| 125 | |
| 126 | const auto& buffer = typedArray->getBuffer(); |
| 127 | |
| 128 | std::vector<uint8_t> out; |
| 129 | out.insert(out.begin(), buffer.begin(), buffer.end()); |
| 130 | return out; |
| 131 | } |
| 132 | |
| 133 | } // namespace Valdi |