jbgtmartin opened a new issue, #362:
URL: https://github.com/apache/couchdb-nano/issues/362

   In  v11 (11.0.3), the Typescript declaration for nano()'s configuration 
object is missing the `parseUrl` parameter.
   
   `lib/nano.d.ts`:
   
   ```ts
     /** Nano configuration */
     interface Configuration {
       /** The URL of the CouchDB service, including username and password if 
required e.g.
        * http://username:password@hostname:port
        */
       url: string;
       /** For cookie authentication */
       cookie?: string;
       /** HTTP Agent options
        * @see README: {@link 
https://www.npmjs.com/package/nano#pool-size-and-open-sockets}
        */
       agentOptions?: AgentOptions | typeof undici.Agent | typeof 
undici.MockAgent | typeof undici.Dispatcher;
       /** Logging function 
        * @see README: {@link https://www.npmjs.com/package/nano#logging}
        */
       log?(id: string, args: any): void;
       /** Set to false to prevent parsing of url 
        * @see README: {@link https://www.npmjs.com/package/nano#configuration}
        */
       headers?: object;
       /** Custom request headers
        * @see README: {@link https://www.npmjs.com/package/nano#configuration}
        */
     }
   ```
   
   But `parseUrl` is still used in `lib/nano.js`, and documented in the README:
   ```js
   module.exports = exports = function dbScope (cfg) {
     let serverScope = {}
   
     if (typeof cfg === 'string') {
       cfg = { url: cfg }
     }
   
     assert.strictEqual(typeof cfg, 'object',
       'You must specify the endpoint url when invoking this module')
     assert.ok(/^https?:/.test(cfg.url), 'url is not valid')
   
     cfg = Object.assign({}, cfg)
     serverScope.config = cfg
     const dummyLogger = () => {}
     const log = typeof cfg.log === 'function' ? cfg.log : dummyLogger
     const parseUrl = 'parseUrl' in cfg ? cfg.parseUrl : true
   
   ...
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to