@taybart/corvid 0.1.8 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +4 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -495,7 +495,8 @@ class request {
495
495
  if (path) url = `${this.opts.url}${path}`;
496
496
  let reqParams = this.opts.params;
497
497
  if (override.params) reqParams = new network_params(override.params);
498
- if (passedParams) reqParams = reqParams ? new network_params(reqParams).set(passedParams) : new network_params(passedParams);
498
+ if (passedParams) if (reqParams) reqParams.set(passedParams);
499
+ else reqParams = new network_params(passedParams);
499
500
  if (reqParams) {
500
501
  this.log.debug(`params: ${reqParams.toString()}`);
501
502
  url = `${url}?${reqParams.toString()}`;
@@ -529,9 +530,9 @@ class request {
529
530
  if (!this.opts.method) this.opts.method = 'GET';
530
531
  if (!this.opts.headers) this.opts.headers = {};
531
532
  if (!this.opts.credentials) this.opts.credentials = 'omit';
532
- if (!this.opts.params && 'object' == typeof opts.params) {
533
+ if (this.opts.params && !(this.opts.params instanceof network_params)) {
533
534
  this.log.debug("converting object params to class");
534
- this.opts.params = new network_params(opts.params);
535
+ this.opts.params = new network_params(this.opts.params);
535
536
  }
536
537
  this.log.debug(`with options: ${JSON.stringify(this.opts)}`);
537
538
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taybart/corvid",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "exports": {