Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/aether/deps.ts>Bson.serializeWithBufferAndIndex

A Deno library to interface with the Discord API
Latest
function Bson.serializeWithBufferAndIndex
import { Bson } from "https://deno.land/x/aether@v0.0.3/deps.ts";
const { serializeWithBufferAndIndex } = Bson;

Serialize a Javascript object using a predefined Buffer and index into the buffer, useful when pre-allocating the space for serialization.

Parameters

object: Document
  • the Javascript object to serialize.
finalBuffer: Uint8Array
  • the Buffer you pre-allocated to store the serialized BSON object.
optional
options: SerializeOptions = [UNSUPPORTED]

Returns

number

the index pointing to the last written byte in the buffer.