node_modules/bson/dist/bson.browser.esm.js
/**
 * Serialize a Javascript object using a predefined Buffer and index into the buffer,
 * useful when pre-allocating the space for serialization.
 *
 * @param object - the Javascript object to serialize.
 * @param finalBuffer - the Buffer you pre-allocated to store the serialized BSON object.
 * @returns the index pointing to the last written byte in the buffer.
 * @public
 */
Serialize a Javascript object using a predefined Buffer and index into the buffer,
useful when pre-allocating the space for serialization.

@param object - the Javascript object to serialize.
@param finalBuffer - the Buffer you pre-allocated to store the serialized BSON object.
@returns the index pointing to the last written byte in the buffer.
@public
Serialize a Javascript object using a predefined Buffer and index into the buffer useful when pre - allocating the space for serialization . @param object - the Javascript object to serialize . @param finalBuffer - the Buffer you pre - allocated to store the serialized BSON object . @returns the index pointing to the last written byte in the buffer . @public
function serializeWithBufferAndIndex(object, finalBuffer, options) {
    if (options === void 0) { options = {}; }
    var checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false;
    var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false;
    var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true;
    var startIndex = typeof options.index === 'number' ? options.index : 0;
    var serializationIndex = serializeInto(buffer, object, checkKeys, 0, 0, serializeFunctions, ignoreUndefined);
    buffer.copy(finalBuffer, startIndex, 0, serializationIndex);
    return startIndex + serializationIndex - 1;
}
function serializeWithBufferAndIndex ( object , finalBuffer , options ) { if ( options === void 0 ) { options = { } ; } var checkKeys = typeof options . checkKeys === 'boolean' ? options . checkKeys : false ; var serializeFunctions = typeof options . serializeFunctions === 'boolean' ? options . serializeFunctions : false ; var ignoreUndefined = typeof options . ignoreUndefined === 'boolean' ? options . ignoreUndefined : true ; var startIndex = typeof options . index === 'number' ? options . index : 0 ; var serializationIndex = serializeInto ( buffer , object , checkKeys , 0 , 0 , serializeFunctions , ignoreUndefined ) ; buffer . copy ( finalBuffer , startIndex , 0 , serializationIndex ) ; return startIndex + serializationIndex - 1 ; }
Serialize a Javascript object using a predefined Buffer and index into the buffer,
 useful when pre-allocating the space for serialization.
Serialize a Javascript object using a predefined Buffer and index into the buffer useful when pre - allocating the space for serialization .
// Unpack the options // Attempt to serialize // Return the index