@based/db 0.0.40 → 0.0.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
Binary file
@@ -227,12 +227,12 @@ export const readAllFields = (q, result, offset, end, item, id) => {
227
227
  const t = edgeDef.typeIndex;
228
228
  if (t === JSON) {
229
229
  const size = readUint32(result, i);
230
- addField(edgeDef, global.JSON.parse(readUtf8(result, i + 6, size + i)), item);
230
+ addField(edgeDef, global.JSON.parse(read(result, i + 4, size, true)), item);
231
231
  i += size + 4;
232
232
  }
233
233
  else if (t === BINARY) {
234
234
  const size = readUint32(result, i);
235
- addField(edgeDef, result.subarray(i + 6, size + i), item);
235
+ addField(edgeDef, result.subarray(i + 6, size + i + 4), item);
236
236
  i += size + 4;
237
237
  }
238
238
  else if (t === STRING || t === ALIAS || t === ALIASES) {
@@ -302,13 +302,13 @@ export const readAllFields = (q, result, offset, end, item, id) => {
302
302
  else if (prop.typeIndex === JSON) {
303
303
  q.include.propsRead[index] = id;
304
304
  const size = readUint32(result, i);
305
- addField(prop, global.JSON.parse(readUtf8(result, i + 6, size - 6)), item);
305
+ addField(prop, global.JSON.parse(read(result, i + 4, size, true)), item);
306
306
  i += size + 4;
307
307
  }
308
308
  else if (prop.typeIndex === BINARY) {
309
309
  q.include.propsRead[index] = id;
310
310
  const size = readUint32(result, i);
311
- addField(prop, result.subarray(i + 6, i + size), item);
311
+ addField(prop, result.subarray(i + 6, i + size + 4), item);
312
312
  i += size + 4;
313
313
  }
314
314
  else if (prop.typeIndex === STRING) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@based/db",
3
- "version": "0.0.40",
3
+ "version": "0.0.41",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/src/index.js",