Skip to content

Remove requirement for "as const" assertion in default options - #56

Merged
L-Blondy merged 5 commits into
masterfrom
improve-types
Jun 3, 2025
Merged

L-Blondy merged 5 commits into
masterfrom
improve-types

Conversation

@L-Blondy

Copy link
Copy Markdown
Owner

Users have to manually add as const assertion when providing default options.

The goal of this PR is to infer the default options type as const automatically

// Before: "as const" is currently required
const upfetch = up(fetch, () => ({ credentials: 'include' }) as const)
// After: "as const" is not needed
const upfetch = up(fetch, () => ({ credentials: 'include' }))

@L-Blondy
L-Blondy merged commit 0857f26 into master Jun 3, 2025
@L-Blondy
L-Blondy deleted the improve-types branch June 3, 2025 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant