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

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 4.0.0
    • Affects Version/s: 4.0.0
    • Component/s: None
    • Not Needed

      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';
      

       

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

              Created:
              Updated:
              Resolved: