You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(strict-types): address blocking review requirements for PR#3
Changes to fix reviewer feedback:
1. **Generic Is2xx type** (section 2.2):
- Replaced hardcoded 2xx status list with template literal type
- `Is2xx<S> = \`${S}\` extends \`2${string}\` ? true : false`
- Added test fixture with non-standard 250 status to prove genericity
2. **Request-side type enforcement** (section 2.1):
- Added PathParamsFor, QueryParamsFor, RequestBodyFor types
- Added RequestOptionsFor to derive request options from operation
- Updated StrictApiClient to use PathsForMethod constraints
- Path/method now determines operation, which determines params/query/body
3. **any/unknown policy** (section 2.3):
- Consolidated all type casts into axioms.ts
- Added asStrictApiClient, asStrictRequestInit helpers
- Added ClassifyFn type for dispatcher functions
- Added lint:types script to enforce policy
4. **Compile-time tests** (section 2.4):
- Added type tests for Is2xx with 250 status
- Added PathsForMethod constraint tests
- Used expectTypeOf().not.toExtend() for negative tests
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
0 commit comments