How to use merge-descriptors - 6 common examples

To help you get started, we’ve selected a few merge-descriptors examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Bartozzz / crawlerr / src / index.js View on Github external
const requestJar = request.jar();
  const requestObj = request.defaults({ jar: requestJar, ...config });
  setPrototypeOf(requestObj, requestJar);

  // Crawler base:
  const crawler: Object = {
    base: base,
    opts: config,
    req: SpiderRequest,
    res: SpiderResponse,
    request: requestObj
  };

  // Glues all the components together:
  mixin(crawler, SpiderQueue, false);
  mixin(crawler, SpiderRouter, false);
  mixin(crawler, EventEmitter.prototype);

  return crawler;
}
github Bartozzz / crawlerr / src / index.js View on Github external
// Will be used by retry-request:
  const requestJar = request.jar();
  const requestObj = request.defaults({ jar: requestJar, ...config });
  setPrototypeOf(requestObj, requestJar);

  // Crawler base:
  const crawler: Object = {
    base: base,
    opts: config,
    req: SpiderRequest,
    res: SpiderResponse,
    request: requestObj
  };

  // Glues all the components together:
  mixin(crawler, SpiderQueue, false);
  mixin(crawler, SpiderRouter, false);
  mixin(crawler, EventEmitter.prototype);

  return crawler;
}
github Bartozzz / crawlerr / src / routing / router.js View on Github external
callActions(uri: string, req: Object, res: Object): void {
    for (const index in this.callbacks) {
      const parameters: Object = wildcard(uri, index);
      const callback: Function = this.callbacks[index];

      if (uri === index || parameters) {
        // Merge request parameters with wildcard output:
        // NOTE: pheraps we should override params on each callback?
        mixin(req.params || {}, parameters || {});

        callback({ req, res, uri });
      }
    }
  }
};
github Bartozzz / crawlerr / src / index.js View on Github external
const requestObj = request.defaults({ jar: requestJar, ...config });
  setPrototypeOf(requestObj, requestJar);

  // Crawler base:
  const crawler: Object = {
    base: base,
    opts: config,
    req: SpiderRequest,
    res: SpiderResponse,
    request: requestObj
  };

  // Glues all the components together:
  mixin(crawler, SpiderQueue, false);
  mixin(crawler, SpiderRouter, false);
  mixin(crawler, EventEmitter.prototype);

  return crawler;
}
github oors / oors / packages / oors-express / src / ExpressApplication.js View on Github external
constructor(context = {}, settings = {}) {
    super();
    this.originalApp = application;
    mixin(this, omit(this.originalApp, ['listen']), false);
    this.init();
    this.request = request;
    this.request.app = this;
    this.response = response;
    this.response.app = this;
    Object.assign(this.request, context);
    this.merge(settings);
  }
github ghettovoice / vuelayers / src / util / multi-merge-descriptors.js View on Github external
    (dest, src, i) => mergeDescriptors(dest, src, redefine),
    args[0],

merge-descriptors

Merge objects using their property descriptors

MIT
Latest version published 5 months ago

Package Health Score

79 / 100
Full package analysis

Popular merge-descriptors functions