Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
break;
case s.Value.LIST:
p = value.getList();
break;
case s.Value.STRUCT:
p = value.getStruct();
break;
case s.Value.INTERFACE:
default:
throw new Error(
format(E.GEN_SERIALIZE_UNKNOWN_VALUE, s.Value_Which[value.which()])
);
}
const m = new capnp.Message();
m.setRoot(p);
const buf = new Uint8Array(m.toPackedArrayBuffer());
const bytes = new Array(buf.byteLength);
for (let i = 0; i < buf.byteLength; i++) {
bytes[i] = ts.createNumericLiteral(`0x${pad(buf[i].toString(16), 2)}`);
}
return ts.createCall(ts.createPropertyAccess(CAPNP, "readRawPointer"), __, [
ts.createPropertyAccess(
ts.createNew(ts.createIdentifier("Uint8Array"), __, [