Commit 00f73c1
chore(simplify): simplify recent changes in qurl-typescript (#17)
## Summary
Simplification sweep targeting the most complex file in the codebase
(`src/client.ts`).
### `src/client.ts`
- **`list()` param building**: Replaced 5 duplicated `!== null && !==
undefined` checks with a single `Object.entries` loop using `!= null`
(loose equality covers both null and undefined)
- **`rawRequest()` error handling**: Extracted `classifyFetchError()`
private method to reduce nesting depth in the catch block from 5 levels
to 3
### Files reviewed but not changed
- **`src/errors.ts`**: Error subclass hierarchy is standard boilerplate
needed for the public API (`instanceof` checks). No meaningful
simplification without changing behavior.
- **`src/types.ts`**: Pure type definitions, no logic.
- **`src/index.ts`**: Re-exports only.
All 46 tests pass. No behavior changes.
## Test plan
- [x] `npm test` — all 46 tests pass
- [x] `npm run format:check` — passes
- [x] Verified no behavior changes (only structural refactoring)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>1 parent 07781a2 commit 00f73c1
1 file changed
Lines changed: 18 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
141 | 139 | | |
142 | 140 | | |
143 | 141 | | |
| |||
255 | 253 | | |
256 | 254 | | |
257 | 255 | | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
268 | 263 | | |
269 | 264 | | |
270 | 265 | | |
| |||
337 | 332 | | |
338 | 333 | | |
339 | 334 | | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
340 | 343 | | |
0 commit comments