MCPcopy Create free account
hub / github.com/CommE2E/comm / convertObjToBytes

Function convertObjToBytes

lib/utils/conversion-utils.js:199–202  ·  view source on GitHub ↗
(obj: T)

Source from the content-addressed store, hash-verified

197// NOTE: This function should not be called from native. On native, we should
198// use `convertObjToBytes` in native/backup/conversion-utils.js instead.
199function convertObjToBytes<T>(obj: T): Uint8Array {
200 const objStr = JSON.stringify(obj);
201 return new TextEncoder().encode(objStr ?? '');
202}
203
204// NOTE: This function should not be called from native. On native, we should
205// use `convertBytesToObj` in native/backup/conversion-utils.js instead.

Callers 3

tunnelbroker.jsFile · 0.90

Calls 1

encodeMethod · 0.80

Tested by

no test coverage detected