MCPcopy Index your code
hub / github.com/pywebio/PyWebIO / serialize_json

Function serialize_json

webiojs/src/utils.ts:166–171  ·  view source on GitHub ↗
(json_obj: any)

Source from the content-addressed store, hash-verified

164
165// make json object to Blob
166export function serialize_json(json_obj: any) {
167 let json_str = JSON.stringify(json_obj);
168 const encoder = new TextEncoder();
169 const json_buf = encoder.encode(json_str).buffer;
170 return new Blob([int2bytes(json_buf.byteLength), json_buf], {type: 'application/octet-stream'});
171}
172
173function int2bytes(num: number) {
174 const buf = new ArrayBuffer(8);

Callers 3

create_elementMethod · 0.90
submitMethod · 0.90
serialize_fileFunction · 0.85

Calls 1

int2bytesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…