Uploaded image for project: 'Couchbase node.js Client Library'
  1. Couchbase node.js Client Library
  2. JSCBC-687

check options argument for valid properties

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Won't Do
    • Minor
    • 3.0.6
    • None
    • library
    • None
    • 1

    Description

      It's easy to make a call with a typo in the name of an option property, resulting in that option being ignored.  We currently only check that the properties that are allowed have acceptable values. We could also check that the 'options' argument does not contain any unexpected arguments.  Something like this :

         
          this._checkKeyParam(key);

          for (const ky in options)

      {       const val = options[ky];       if(ky == 'timeout')         this._checkTimeoutOption(val);       else if( ky =='transcoder')         this._checkTranscoderOption(val);      else                throw new TypeError(  'unknown option '+ky+" : "+(val?val:"") );         }

         
          this._checkCallbackParam(callback);|

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            michael.reiche Michael Reiche
            michael.reiche Michael Reiche
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty