How to use the utility.assign function in utility

To help you get started, we’ve selected a few utility 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 eggjs / egg / lib / core / dnscache_httpclient.js View on Github external
function formatDnsLookupUrl(host, url, address) {
  if (typeof url === 'string') return url.replace(host, address);
  const urlObj = utility.assign({}, url);
  urlObj.hostname = urlObj.hostname.replace(host, address);
  if (urlObj.host) {
    urlObj.host = urlObj.host.replace(host, address);
  }
  return urlObj;
}
github node-modules / urllib / lib / httpclient.js View on Github external
HttpClient.prototype.requestThunk = function (url, args) {
  args = args || {};
  if (this.defaultArgs) {
    args = utility.assign({}, [ this.defaultArgs, args ]);
  }
  args.emitter = this;
  args.agent = getAgent(args.agent, this.agent);
  args.httpsAgent = getAgent(args.httpsAgent, this.httpsAgent);
  return urllib.requestThunk(url, args);
};
github node-modules / urllib / lib / httpclient.js View on Github external
HttpClient.prototype.request = HttpClient.prototype.curl = function (url, args, callback) {
  if (typeof args === 'function') {
    callback = args;
    args = null;
  }
  args = args || {};
  if (this.defaultArgs) {
    args = utility.assign({}, [ this.defaultArgs, args ]);
  }
  args.emitter = this;
  args.agent = getAgent(args.agent, this.agent);
  args.httpsAgent = getAgent(args.httpsAgent, this.httpsAgent);
  return urllib.request(url, args, callback);
};
github eggjs / egg / app / extend / context.js View on Github external
get locals() {
    if (!this[LOCALS]) {
      this[LOCALS] = assign({}, this.app.locals);
    }
    if (this[LOCALS_LIST] && this[LOCALS_LIST].length) {
      assign(this[LOCALS], this[LOCALS_LIST]);
      this[LOCALS_LIST] = null;
    }
    return this[LOCALS];
  },
github qiushi123 / xiaochengxu_demos / 014云开发实现小程序支付 / cloud / pay / node_modules / urllib / lib / httpclient.js View on Github external
HttpClient.prototype.request = HttpClient.prototype.curl = function (url, args, callback) {
    if (typeof args === 'function') {
        callback = args;
        args = null;
    }
    args = args || {};
    if (this.defaultArgs) {
        args = utility.assign({}, [this.defaultArgs, args]);
    }
    args.emitter = this;
    args.agent = getAgent(args.agent, this.agent);
    args.httpsAgent = getAgent(args.httpsAgent, this.httpsAgent);
    return urllib.request(url, args, callback);
};
github qiushi123 / xiaochengxu_demos / 014云开发实现小程序支付 / cloud / pay / node_modules / urllib / lib / httpclient.js View on Github external
HttpClient.prototype.requestThunk = function (url, args) {
    args = args || {};
    if (this.defaultArgs) {
        args = utility.assign({}, [this.defaultArgs, args]);
    }
    args.emitter = this;
    args.agent = getAgent(args.agent, this.agent);
    args.httpsAgent = getAgent(args.httpsAgent, this.httpsAgent);
    return urllib.requestThunk(url, args);
};
github eggjs / egg / app / extend / context.js View on Github external
get locals() {
    if (!this[LOCALS]) {
      this[LOCALS] = assign({}, this.app.locals);
    }
    if (this[LOCALS_LIST] && this[LOCALS_LIST].length) {
      assign(this[LOCALS], this[LOCALS_LIST]);
      this[LOCALS_LIST] = null;
    }
    return this[LOCALS];
  },
github eggjs / egg / lib / application.js View on Github external
set locals(val) {
    if (!this[LOCALS]) {
      this[LOCALS] = {};
    }

    assign(this[LOCALS], val);
  }