|
1 | 1 | import * as os from 'os'; |
2 | 2 | import * as process from 'process'; |
3 | 3 |
|
4 | | -import { BSON, type Document, Int32 } from '../../bson'; |
| 4 | +import { BSON, type Document, Int32, NumberUtils } from '../../bson'; |
5 | 5 | import { MongoInvalidArgumentError } from '../../error'; |
6 | 6 | import type { DriverInfo, MongoOptions } from '../../mongo_client'; |
7 | 7 | import { fileIsAccessible } from '../../utils'; |
@@ -336,17 +336,18 @@ declare const Bun: { (): void; version?: string } | undefined; |
336 | 336 | * with a future change to these global objects. |
337 | 337 | */ |
338 | 338 | function getRuntimeInfo(): string { |
| 339 | + const endianness = NumberUtils.isBigEndian ? 'BE' : 'LE'; |
339 | 340 | if ('Deno' in globalThis) { |
340 | 341 | const version = typeof Deno?.version?.deno === 'string' ? Deno?.version?.deno : '0.0.0-unknown'; |
341 | 342 |
|
342 | | - return `Deno v${version}, ${os.endianness()}`; |
| 343 | + return `Deno v${version}, ${endianness}`; |
343 | 344 | } |
344 | 345 |
|
345 | 346 | if ('Bun' in globalThis) { |
346 | 347 | const version = typeof Bun?.version === 'string' ? Bun?.version : '0.0.0-unknown'; |
347 | 348 |
|
348 | | - return `Bun v${version}, ${os.endianness()}`; |
| 349 | + return `Bun v${version}, ${endianness}`; |
349 | 350 | } |
350 | 351 |
|
351 | | - return `Node.js ${process.version}, ${os.endianness()}`; |
| 352 | + return `Node.js ${process.version}, ${endianness}`; |
352 | 353 | } |
0 commit comments