@loaders.gl/bson
Version:
Framework-independent loader for JSON and streaming JSON formats
10 lines (9 loc) • 307 B
JavaScript
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors
import * as BSON from 'bson';
export function encodeBSONSync(value, options) {
const uint8Array = BSON.serialize(value);
// TODO - make sure the uint8array occupies the entire buffer.
return uint8Array.buffer;
}