code: function checkOptions ( opts ) {
          var isNum, isNumWithUnit;
  
          if ( opts.direction && !( opts.direction === 'vertical' || opts.direction === 'horizontal' || opts.direction === 'both' ) ) {
              throw new Error( 'Invalid option value: direction = "' + opts.direction + '"' );
          }
  
          if ( opts.box && !( opts.box === 'border-box' || opts.box === 'content-box' ) ) {
              throw new Error( 'Invalid option value: box = "' + opts.box + '"' );
          }
  
          if ( opts.tolerance !== undefined ) {
              isNum = isNumber( opts.tolerance );
              isNumWithUnit = isString( opts.tolerance ) && ( /^[+-]?\d*\.?\d+(px|%)?$/.test( opts.tolerance ) );
              if ( ! ( isNum || isNumWithUnit ) ) throw new Error( 'Invalid option value: tolerance = "' + opts.tolerance + '"' );
          }
  
      }
docs: Spots likely option mistakes and throws appropriate errors.
  
  @param {Object} opts