Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-3275

Export enum types with the same name as the enum object

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Unknown
    • Resolution: Fixed
    • 4.0.0
    • 4.0.0
    • None
    • Not Needed

    Description

      The following enums are currently exported from src/index.ts as objects with corresponding types defined via a separate name. This is not necessary - typescript allows exporting both a real js entity and a type aliased to the same name, so wherever possible we should try to use the same name to represent the object and the type, (e.g., batchType instead of batchType AND batchTypeId).

      export { ProfilingLevel } from './operations/set_profiling_level';
      export { ServerType, TopologyType } from './sdam/common';
      export { LoggerLevel } from './logger';
      export { AutoEncryptionLoggerLevel } from './deps';
      export { BatchType } from './bulk/common';
      export { AuthMechanism } from './cmap/auth/defaultAuthProviders';
      export { CURSOR_FLAGS } from './cursor/abstract_cursor';
      export { Compressor } from './cmap/wire_protocol/compression';
      export { ExplainVerbosity } from './explain';
      export { ReadConcernLevel } from './read_concern';
      export { ReadPreferenceMode } from './read_preference';
      export { ServerApiVersion } from './mongo_client';
      

       

      Attachments

        Issue Links

          Activity

            People

              daria.pardue@mongodb.com Daria Pardue
              daria.pardue@mongodb.com Daria Pardue
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: