MCPcopy Create free account
hub / github.com/dwgx/WindsurfAPI / writeStringField

Function writeStringField

src/proto.js:79–83  ·  view source on GitHub ↗
(field, str)

Source from the content-addressed store, hash-verified

77
78/** Write a length-delimited string field (wire type 2). */
79export function writeStringField(field, str) {
80 if (!str && str !== '') return Buffer.alloc(0);
81 const data = Buffer.from(str, 'utf-8');
82 return Buffer.concat([makeTag(field, 2), encodeVarint(data.length), data]);
83}
84
85/** Write a length-delimited bytes field (wire type 2). */
86export function writeBytesField(field, data) {

Callers 15

startCascadeResponseFunction · 0.90
viewFileWrapperStepFunction · 0.90
errorStepFunction · 0.90
startCascadeResponseFunction · 0.90
trajectoryInfoResponseFunction · 0.90
trajectoryStepsResponseFunction · 0.90
runCommandStepResponseFunction · 0.90

Calls 2

makeTagFunction · 0.85
encodeVarintFunction · 0.85

Tested by 10

startCascadeResponseFunction · 0.72
viewFileWrapperStepFunction · 0.72
errorStepFunction · 0.72
startCascadeResponseFunction · 0.72
trajectoryInfoResponseFunction · 0.72
trajectoryStepsResponseFunction · 0.72
runCommandStepResponseFunction · 0.72