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.
This commit is contained in:
2026-06-07 16:29:18 +07:00
parent 96f4cba4a8
commit a7e668ced8
19 changed files with 1759 additions and 233 deletions
+12
View File
@@ -131,6 +131,18 @@ describe('buildURL', () => {
it('returns the URL unchanged when all params are omitted', () => {
expect(buildURL('https://api.example.com', { a: null })).toBe('https://api.example.com');
});
it('inserts the query string before a fragment', () => {
expect(buildURL('https://api.example.com/p#section', { a: 1 })).toBe(
'https://api.example.com/p?a=1#section',
);
});
it('appends to an existing query string before a fragment', () => {
expect(buildURL('https://api.example.com/p?foo=bar#section', { baz: 'qux' })).toBe(
'https://api.example.com/p?foo=bar&baz=qux#section',
);
});
});
// ---------------------------------------------------------------------------