feat(smartjson): Add JSONL stringify and ordering comparator; fix empty buffer handling; refactor Smartjson folding/enfolding

This commit is contained in:
2025-09-12 19:30:15 +00:00
parent 58322d23f4
commit fe8b5ce7c0
6 changed files with 78 additions and 30 deletions

View File

@@ -52,11 +52,7 @@ const replacer: TParseReplacer = (key, value) => {
// Handle IBufferLike objects with a .data property
if ('data' in value && isArray(value.data)) {
if (value.data.length > 0) {
bufferData = new Uint8Array(value.data);
} else {
return ''; // Return empty string for empty data arrays
}
bufferData = new Uint8Array(value.data);
}
// Handle Uint8Array directly
else if (value instanceof Uint8Array) {