index.ts 606 B

12345678910111213141516171819
  1. import * as BSON from './bson';
  2. // Export all named properties from BSON to support
  3. // import { ObjectId, serialize } from 'bson';
  4. // const { ObjectId, serialize } = require('bson');
  5. export * from './bson';
  6. // Export BSON as a namespace to support:
  7. // import { BSON } from 'bson';
  8. // const { BSON } = require('bson');
  9. export { BSON };
  10. // BSON does **NOT** have a default export
  11. // The following will crash in es module environments
  12. // import BSON from 'bson';
  13. // The following will work as expected, BSON as a namespace of all the APIs (BSON.ObjectId, BSON.serialize)
  14. // const BSON = require('bson');