Skip to content

refactor(types): use TypeScript utils to transform duplicated literals#7520

Merged
jasonsaayman merged 8 commits intoaxios:v1.xfrom
tryonelove:feat/improve-method-types
Apr 8, 2026
Merged

refactor(types): use TypeScript utils to transform duplicated literals#7520
jasonsaayman merged 8 commits intoaxios:v1.xfrom
tryonelove:feat/improve-method-types

Conversation

@tryonelove
Copy link
Copy Markdown
Contributor

@tryonelove tryonelove commented Mar 16, 2026

Fixes #7519


Summary by cubic

Refactors axios types to derive lowercase variants from a single uppercase union, removing duplicated literals while keeping case-insensitive Method and responseEncoding. Types-only change with no runtime impact; fixes #7519.

Description

  • Use internal UppercaseMethod/UppercaseResponseEncoding plus Lowercase<> in index.d.ts and index.d.cts.
  • Revert the temporary responseEncoding export in index.d.cts; public API unchanged.
  • Synced with latest v1.x; requires TypeScript 4.1+.

Testing

  • No tests added.
  • Recommend dtslint/type tests to confirm both upper and lower case values are accepted for Method and responseEncoding.

Written for commit aca5565. Summary will update on new commits.

@tryonelove tryonelove changed the title Feat/improve method types refactor(types): use TypeScript utils to transform duplicated literals Mar 16, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

@jasonsaayman jasonsaayman added priority::medium A medium priority commit::refactor The PR is related to refactoring labels Apr 8, 2026
@jasonsaayman jasonsaayman merged commit c44f4d7 into axios:v1.x Apr 8, 2026
28 of 29 checks passed
@tryonelove tryonelove deleted the feat/improve-method-types branch April 8, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commit::refactor The PR is related to refactoring priority::medium A medium priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Types Refactor: Duplicating literal types in Method & responseEncoding

2 participants