jiren 1.0.3 → 1.0.5

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.
@@ -176,6 +176,10 @@ export class JirenClient {
176
176
  status,
177
177
  body: bodyString,
178
178
  headers,
179
+ get ok() {
180
+ return status >= 200 && status < 300;
181
+ },
182
+ text: async () => bodyString,
179
183
  json: <T = any>() => {
180
184
  if (!bodyString) return null as T;
181
185
  return JSON.parse(bodyString) as T;
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "jiren",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "author": "",
5
5
  "main": "index.ts",
6
6
  "module": "index.ts",
7
7
  "types": "index.ts",
8
- "devDependencies": {
8
+ "dependencies": {
9
9
  "@types/bun": "^1.3.4"
10
10
  },
11
+ "devDependencies": {},
11
12
  "peerDependencies": {
12
13
  "typescript": "^5"
13
14
  },
package/types/index.ts CHANGED
@@ -52,6 +52,10 @@ export interface HttpResponse {
52
52
  body: string;
53
53
  /** Response headers */
54
54
  headers?: Record<string, string>;
55
+ /** True if status is 2xx */
56
+ ok: boolean;
57
+ /** Helper to get body as string (Promise for Fetch compatibility) */
58
+ text: () => Promise<string>;
55
59
  /** Helper to parse JSON body */
56
60
  json: <T = any>() => T;
57
61
  }