MCPcopy Create free account
hub / github.com/mongodb/node-mongodb-native / parseToElementsToArray

Function parseToElementsToArray

src/bson.ts:37–40  ·  view source on GitHub ↗
(bytes: Uint8Array, offset?: number)

Source from the content-addressed store, hash-verified

35export type BSONElement = BSON.OnDemand['BSONElement'];
36
37export function parseToElementsToArray(bytes: Uint8Array, offset?: number): BSONElement[] {
38 const res = BSON.onDemand.parseToElements(bytes, offset);
39 return Array.isArray(res) ? res : [...res];
40}
41
42// validates buffer inputs, used for read operations
43const validateBufferInputs = (buffer: Uint8Array, offset: number, length: number) => {

Callers 2

makeMethod · 0.90
constructorMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected