Build a Pa11y reporter.
@private
@param {Object} methods - The reporter methods.
@returns {Promise} Returns a promise which resolves with the new reporter.
519350
function buildReporter(methods) {
	return {
		supports: methods.supports,
		begin: buildReporterMethod(methods.begin),
		results: buildReporterMethod(methods.results),
		log: {
			debug: buildReporterMethod(methods.debug),
			error: buildReporterMethod(methods.error, 'error'),
			info: buildReporterMethod(methods.info)
		}
	};
}
165740
function buildDocs() {
  return Promise.resolve()
    .then(() => new Promise((resolve, reject) => {
      Metalsmith(__dirname)
        .source('./source/docs')
        .destination('./docs')
        .clean(true)
        .use(Markdown())
        .metadata({
          version: __version
        })
        .use(Layouts({
          engine: 'handlebars',
          directory: './source/layouts',
          rename: false
        }))
        // Update {{version}} in content since it's not processed with Handlebars
        .use((files, metalsmith, done) => {
          Object.keys(files).forEach((key) => {
            let file = files[key];

            file.contents = new Buffer(
              file.contents
                .toString()
                .replace(/\{\{version\}\}/g, __version)
            );
          });

          done();
        })
        .build((err) => {
          if(err) {
            reject(err);
            return;
          }
          console.log(Chalk.green('Docs generated! 📚'));

          resolve();
        });
    }));
}
1095156
function add(name, methods) {

  // Create a container class that extends Document for our methods.
  class ConcreteDocument extends Document {
    constructor(document, root) {
      super(name, document, root);
    }
  }

  // Assign the methods to the new classes prototype.
  assignIn(ConcreteDocument.prototype, methods);

  // Add a factory method for the new type.
  Document.factory[name] = (document, root) => new ConcreteDocument(document, root);
}
390662
function(method, args, options) {
            var that = this, methodHandler;

            options = options || {};

            var handler = this.getHandler(method);
            if (!handler) return Q.reject(new Error("No handler found for method: "+method));

            // Is offline
            if (!Offline.isConnected()) {
                methodHandler = handler.fallback;
            }
            methodHandler = methodHandler || handler.execute || this.defaultHandler.execute;

            // No default
            if (!methodHandler) {
                return Q.reject(new Error("No handler found for this method in this backend"));
            }

            return Q(methodHandler(args, options, method)).then(function(results) {
                if (handler.after) {
                    return Q.all([
                        Q(handler.after(args, results, options, method)),
                        Q((that.defaultHandler.after || function() {})(args, results, options, method))
                    ]).then(function() {
                        return Q(results);
                    }, function() {
                        return Q(results);
                    });
                }
                return results;
            });
        }
250808
function wrapCountingMethod(method) {
  DruidNode.prototype[method] = function() {
    var self = this
      , args = utils.args(arguments, 0)
      , callback = args.pop()

    self.active++

    debug('Active calls to Druid node ' + this.data.id + ': ' + this.active)

    function wrapper() {
      self.active--

      callback.apply(null, arguments)
    }

    args.push(wrapper)

    Client.prototype[method].apply(this, args)
  }
}
965645
function(object, methods) {
        _.each(methods, function(method, name) {
            if (!_.isFunction(method)) {
                throw new Error('Method "' + name + '" must be a function!');
            }
            object[name] = method
        });
    }
490488
function GENERATE_METHOD(name, spec, parent) {
  name = name.replace(/!+$/, '');
  return GENERATE_DOC(spec.description + '\n'
    + '@method ' + name + '\n'
    + (parent ? ('@for ' + parent + '\n') : '@for common\n')
    + _.reduce(spec.params, function(memo, paramSpec, paramName) {
        return memo + '@param {' + GENERATE_TYPE(paramSpec.type) + '} ' + paramName + ' ' + paramSpec.description + '\n'; 
      }, '')
    + ( !_.isEmpty(spec.return) ? ('@return {' + GENERATE_TYPE(spec.return.type) + '} ' + spec.return.description + '\n') : ''));
}
232090
function promisify() {
    var promiseLike = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

    if (promiseLike instanceof _es6Promise.Promise) {
        return promiseLike;
    }

    if (typeof promiseLike === "function") {
        return promisify(promiseLike());
    }

    return new _es6Promise.Promise(function (resolve, reject) {
        promiseLike === false ? reject() : resolve(promiseLike);
    });
}
1024547
function Method(name,signatures) {
  this.name = name || "";
  this.tree = {};
  this.functions = [];
  if (lib.type.isObject(signatures) || lib.type.isFunction(signatures)) {
    this.addSignature(signatures);
  }
}
313946
function extend_if_promise(methods, ret) {
		if(ret && ret.then) {                                 // Check if return value is promise compatible
			return extend.promise(methods, ret);              // ..and if so, extend it, too.
		}
		return ret;                                           // ..and if not, return the same value.
	}
950213
function(authMethods){
      var _method = {};
      var _methodName;

      try{
        _.each(authMethods, function(method){
          _methodName = method.name;
          method = _.merge(require('../../'+_methodName), method);
          _method[method.authType] = method;
        });
      }catch(e){
        this._errorHandler(_methodName);
      }

      return _method;
    }
1287039
function wrapObject(object, methods) {
      if (!(methods instanceof Array)) methods = Array.prototype.slice.call(arguments, 1);
      methods.forEach(function (method) {
        object[method] = wrap(object[method]);
      });
    }
169199
<O extends Message> JsonResponseFuture<O> newProvisionalResponse(ClientMethod<O> method) {
    long requestId = RANDOM.nextLong();
    JsonResponseFuture<O> outputFuture = new JsonResponseFuture<>(requestId, method);
    inFlightRequests.put(requestId, outputFuture);
    return outputFuture;
  }
1072411
function (method) {
    return (
      /* The core method implementation. */
      function () {
        if (api.enabled) {
          if (doesConsoleExistImpl()) {
            /* The common way. */
            if (typeof console[method] === "function") {
              console[method].apply(console, arguments);
            }
            /* The IE 8–9 way. */
            else {
              P_FUNCTION.apply.call(console[method], console, arguments);
            }
          }
          else {
            api.logs.push(P_ARRAY.slice.call(arguments));
          }
        }
        return api;
      }
    );
  }
1159213
function wrap(method) {
            return function() {
                // cast any arguments into an array, since they're
                // natively objects
                var args = Array.prototype.slice.apply(arguments);
                // make the first argument the array itself
                args.unshift(this);
                // return the result of the ss method
                return ss[method].apply(ss, args);
            };
        }
1042359
function Promise(resolver) {
  if (!(this instanceof InstrumentedPromise)) {
    throw new TypeError('Cannot call a class as a function');
  }
  const promise = new OriginalPromise((resolve, reject) =>
    resolver(resolve, arg => {
      OriginalPromise.resolve().then(() => {
        if (promise._hasDownstreams === undefined) {
          dispatchUnhandledRejectionEvent(promise, arg);
        }
      });
      return reject(arg);
    }));
  promise.__proto__ = InstrumentedPromise.prototype;
  return promise;
}
322442
function(method) {
                        return function(url, data, options, before) {
                            var index = ++method_index;
                            ++loading;
                            promises.push(qwest(method, pinky.base + url, data, options, before).then(function(xhr, response) {
                                values[index] = arguments;
                                if(!--loading) {
                                    pinky(true, values.length == 1 ? values[0] : [values]);
                                }
                            }, function() {
                                pinky(false, arguments);
                            }));
                            return pinky;
                        };
                    }