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