a zip code crypto-currency system good for red ONLY

JoinRequestPlugin.js 673B

12345678910111213141516171819202122
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. function JoinRequestPlugin(source, target) {
  6. this.source = source;
  7. this.target = target;
  8. }
  9. module.exports = JoinRequestPlugin;
  10. JoinRequestPlugin.prototype.apply = function(resolver) {
  11. var target = this.target;
  12. resolver.plugin(this.source, function(request, callback) {
  13. var obj = Object.assign({}, request, {
  14. path: resolver.join(request.path, request.request),
  15. relativePath: request.relativePath && resolver.join(request.relativePath, request.request),
  16. request: undefined
  17. });
  18. resolver.doResolve(target, obj, null, callback);
  19. });
  20. };