Commit Graph

7 Commits

Author SHA1 Message Date
robonen 1cab48ca48 fix(fetch): accept a named interface as request body without a cast
FetchOptions['body'] listed `Record<string, unknown>`, which a named interface
is not assignable to (interfaces carry no implicit index signature), so every
caller passing a typed body had to cast it. Widen the object member to `object`:
named interfaces and arrays now assign directly, `any` is not introduced, and
bare primitives (number/boolean) are still rejected. Runtime is unchanged — the
serializer already narrows the body with its own casts.

Guard it with a type test (src/types.test-d.ts, run under vitest --typecheck):
a named interface must assign to the body type and flow through the method
shortcuts with no cast, while bare primitives stay rejected. Enable typecheck
for the package's vitest project so the assertions are enforced by tsc.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 22:13:04 +07:00
robonen ab6d8f6ce0 build: bump new versions
Publish to NPM / Check version changes and publish (push) Failing after 10m34s
2026-06-18 02:57:03 +07:00
robonen 9a912f7a77 fix(core): update encoding QR constants and fetch utils 2026-06-08 15:50:59 +07:00
robonen a7e668ced8 feat(fetch): plugin system + eslint/tsconfig migration
- Add fetch plugin API (definePlugin, plugins) with type-level option flow.
- Migrate to eslint flat config and composite tsconfig.
2026-06-07 16:29:18 +07:00
robonen 1db475c982 refactor(core/fetch): optimize perfomance, improve types 2026-03-26 16:10:19 +07:00
copilot-swe-agent[bot] 1111848728 refactor: remove unnecessary eslint-disable comments from const Set declarations
Co-authored-by: robonen <26167508+robonen@users.noreply.github.com>
2026-03-13 17:12:12 +00:00
copilot-swe-agent[bot] 170093a039 feat: add @robonen/fetch package - lightweight fetch wrapper with V8 optimizations
Co-authored-by: robonen <26167508+robonen@users.noreply.github.com>
2026-03-13 17:09:49 +00:00