@viliaapro/apifetch 0.1.0 → 0.1.2
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/README.md +2 -2
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ npm install @viliaapro/apifetch @standard-schema/spec http-status-codes zod
|
|
|
20
20
|
## Usage
|
|
21
21
|
|
|
22
22
|
```typescript
|
|
23
|
-
import { apiFetch } from 'apifetch';
|
|
23
|
+
import { apiFetch } from '@viliaapro/apifetch';
|
|
24
24
|
import { StatusCodes } from 'http-status-codes';
|
|
25
25
|
import { z } from 'zod';
|
|
26
26
|
|
|
@@ -63,7 +63,7 @@ Two exceptions are thrown, both extending `ApiError`:
|
|
|
63
63
|
Both carry the original `Response` object and a `status` convenience getter.
|
|
64
64
|
|
|
65
65
|
```typescript
|
|
66
|
-
import { UnrecognizedStatusError, MalformedResponseError } from 'apifetch';
|
|
66
|
+
import { UnrecognizedStatusError, MalformedResponseError } from '@viliaapro/apifetch';
|
|
67
67
|
|
|
68
68
|
try {
|
|
69
69
|
const result = await apiFetch('/api/users/1', handlers);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viliaapro/apifetch",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
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",
|
|
@@ -26,6 +26,10 @@
|
|
|
26
26
|
"tsup": "^8.0.0",
|
|
27
27
|
"typescript": "^5.0.0"
|
|
28
28
|
},
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "https://github.com/viliaapro/apifetch"
|
|
32
|
+
},
|
|
29
33
|
"keywords": [
|
|
30
34
|
"fetch",
|
|
31
35
|
"typescript",
|