Skip to content

Commit

Permalink
Make validation happen in order, fix extendedStringify for Uint8Array
Browse files Browse the repository at this point in the history
  • Loading branch information
guilledk committed May 28, 2024
1 parent 0d82142 commit fc00dc6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@guilledk/arrowbatch-nodejs",
"version": "1.0.0-rc15",
"version": "1.0.0-rc16",
"description": "Arrow Batch Storage protocol",
"main": "./build/src/index.js",
"bin": {
Expand Down
2 changes: 1 addition & 1 deletion src/reader/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ export class ArrowBatchReader extends ArrowBatchContext {
}

async validate() {
for (const adjustedOrdinal of this.tableFileMap.keys()) {
for (const adjustedOrdinal of [...this.tableFileMap.keys()].sort()) {
const [bucketMeta, _] = await this.cache.getMetadataFor(adjustedOrdinal, 'root');

for (const [batchIndex, batchMeta] of bucketMeta.meta.batches.entries()) {
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export function extendedStringify(obj: any, indent?: number): string {
return JSON.stringify(obj, (key, value) => {
if (typeof value === "bigint") {
return value.toString();
} else if (typeof value === "object" && value.type === "Buffer") {
} else if (typeof value === "object" && (value.type === "Buffer" || value instanceof Uint8Array)) {
return Buffer.from(value).toString('hex')
}
return value;
Expand Down

0 comments on commit fc00dc6

Please sign in to comment.