@taybart/corvid 0.0.2 → 0.0.3

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.
package/dist/index.js CHANGED
@@ -245,10 +245,12 @@ class request {
245
245
  this.opts.body = body;
246
246
  return this;
247
247
  }
248
- async do({ path, overrideBody, overrideSuccess }) {
248
+ async do({ path, overrideBody, overrideSuccess } = {}) {
249
249
  if (this.opts.auth) this.opts.headers.Authorization = `Bearer ${this.opts.auth}`;
250
250
  const body = overrideBody || this.opts.body;
251
- const res = await fetch(`${this.opts.url}${path}`, {
251
+ let url = this.opts.url;
252
+ if (path) url = `${this.opts.url}${path}`;
253
+ const res = await fetch(url, {
252
254
  method: this.opts.method,
253
255
  headers: {
254
256
  accept: 'application/json',
package/dist/utils.d.ts CHANGED
@@ -40,9 +40,9 @@ export declare class request {
40
40
  auth(token: string): this;
41
41
  basicAuth(username: string, password: string): this;
42
42
  body(body: Object): this;
43
- do({ path, overrideBody, overrideSuccess, }: {
44
- path: string;
45
- overrideBody: Object;
46
- overrideSuccess: number;
43
+ do({ path, overrideBody, overrideSuccess, }?: {
44
+ path?: string;
45
+ overrideBody?: Object;
46
+ overrideSuccess?: number;
47
47
  }): Promise<any>;
48
48
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taybart/corvid",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "exports": {
@@ -14,13 +14,13 @@
14
14
  "files": [
15
15
  "dist"
16
16
  ],
17
- "scripts": {
18
- "build": "rslib build",
19
- "dev": "rslib build --watch"
20
- },
21
17
  "devDependencies": {
22
18
  "@rslib/core": "^0.6.2",
23
19
  "@types/node": "^22.8.1",
24
20
  "typescript": "^5.8.3"
21
+ },
22
+ "scripts": {
23
+ "build": "rslib build",
24
+ "dev": "rslib build --watch"
25
25
  }
26
- }
26
+ }