Fix json serialization of bigints

This commit is contained in:
Kenny Daniel 2025-11-13 00:43:10 -08:00
parent bfb1d74bf8
commit 3c5714996e
No known key found for this signature in database
GPG Key ID: 90AB653A8CAD7E45
2 changed files with 8 additions and 7 deletions

@ -52,15 +52,15 @@
"test": "vitest run"
},
"dependencies": {
"hyparquet": "1.20.1"
"hyparquet": "1.20.2"
},
"devDependencies": {
"@babel/eslint-parser": "7.28.5",
"@types/node": "24.9.1",
"@vitest/coverage-v8": "4.0.3",
"eslint": "9.38.0",
"eslint-plugin-jsdoc": "61.1.9",
"@types/node": "24.10.1",
"@vitest/coverage-v8": "4.0.8",
"eslint": "9.39.1",
"eslint-plugin-jsdoc": "61.2.0",
"typescript": "5.9.3",
"vitest": "4.0.3"
"vitest": "4.0.8"
}
}

@ -1,3 +1,4 @@
import { toJson } from 'hyparquet'
import { geojsonToWkb } from './wkb.js'
const dayMillis = 86400000 // 1 day in milliseconds
@ -32,7 +33,7 @@ export function unconvert(element, values) {
if (ctype === 'JSON') {
if (!Array.isArray(values)) throw new Error('JSON must be an array')
const encoder = new TextEncoder()
return values.map(v => v === undefined ? undefined : encoder.encode(JSON.stringify(v)))
return values.map(v => v === undefined ? undefined : encoder.encode(JSON.stringify(toJson(v))))
}
if (ctype === 'UTF8') {
if (!Array.isArray(values)) throw new Error('strings must be an array')