mirror of
https://github.com/cerc-io/watcher-ts
synced 2026-09-08 16:54:08 +00:00
Replace null values when converting bytes to string in graph-node host API (#523)
* Replace null value in strings for postgres text data type * Upgrade package versions to 0.2.99
This commit is contained in:
@@ -340,7 +340,11 @@ export const instantiate = async (
|
||||
},
|
||||
'typeConversion.bytesToString': async (bytes: number) => {
|
||||
const byteArray = __getArray(bytes);
|
||||
const string = utils.toUtf8String(byteArray, utils.Utf8ErrorFuncs.replace);
|
||||
let string = utils.toUtf8String(byteArray, utils.Utf8ErrorFuncs.replace);
|
||||
|
||||
// Replace \x00 with empty string as Postgres DB text data type does not support it
|
||||
string = string.replaceAll('\x00', '');
|
||||
|
||||
const ptr = await __newString(string);
|
||||
|
||||
return ptr;
|
||||
|
||||
Reference in New Issue
Block a user