@viliaapro/apifetch 0.1.3 → 0.1.4

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.d.mts CHANGED
@@ -8,9 +8,9 @@ type ResponseHandlers<R> = {
8
8
  [S in number]?: StatusHandler<StandardSchemaV1, R>;
9
9
  };
10
10
  declare class ApiError extends Error {
11
- readonly response?: Response | undefined;
12
- get status(): number | undefined;
13
- constructor(message: string, response?: Response | undefined, options?: ErrorOptions);
11
+ readonly response: Response;
12
+ get status(): number;
13
+ constructor(message: string, response: Response, options?: ErrorOptions);
14
14
  }
15
15
  declare class UnrecognizedStatusError extends ApiError {
16
16
  constructor(response: Response);
package/dist/index.d.ts CHANGED
@@ -8,9 +8,9 @@ type ResponseHandlers<R> = {
8
8
  [S in number]?: StatusHandler<StandardSchemaV1, R>;
9
9
  };
10
10
  declare class ApiError extends Error {
11
- readonly response?: Response | undefined;
12
- get status(): number | undefined;
13
- constructor(message: string, response?: Response | undefined, options?: ErrorOptions);
11
+ readonly response: Response;
12
+ get status(): number;
13
+ constructor(message: string, response: Response, options?: ErrorOptions);
14
14
  }
15
15
  declare class UnrecognizedStatusError extends ApiError {
16
16
  constructor(response: Response);
package/dist/index.js CHANGED
@@ -34,7 +34,7 @@ var ApiError = class extends Error {
34
34
  this.name = this.constructor.name;
35
35
  }
36
36
  get status() {
37
- return this.response?.status;
37
+ return this.response.status;
38
38
  }
39
39
  };
40
40
  var UnrecognizedStatusError = class extends ApiError {
package/dist/index.mjs CHANGED
@@ -6,7 +6,7 @@ var ApiError = class extends Error {
6
6
  this.name = this.constructor.name;
7
7
  }
8
8
  get status() {
9
- return this.response?.status;
9
+ return this.response.status;
10
10
  }
11
11
  };
12
12
  var UnrecognizedStatusError = class extends ApiError {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viliaapro/apifetch",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "A typed fetch wrapper with Standard Schema validation and status-code dispatch",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",