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
    • Status: Resolved
    • Minor
    • Resolution: Won't Do
    • None
    • 3.0.6
    • 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

        For Gerrit Dashboard: JSCBC-687
        # Subject Branch Project Status CR V

        Activity

          There are no comments yet on this issue.

          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