Skip to content

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

Open
tryonelove wants to merge 5 commits intoaxios:v1.xfrom
tryonelove:feat/improve-method-types
Open

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

Conversation

@tryonelove
Copy link

@tryonelove tryonelove commented Mar 16, 2026

Fixes #7519


Summary by cubic

Simplified axios Method and responseEncoding types using TypeScript string utilities to remove duplicates while keeping case-insensitive support. Types-only change with no runtime impact; fixes #7519.

Description

  • Replace duplicated unions with UppercaseMethod/UppercaseResponseEncoding + Lowercase<> in index.d.ts and index.d.cts.
  • Revert the temporary responseEncoding export in index.d.cts (public API unchanged).
  • Requires TypeScript 4.1+ intrinsic string utilities.

Testing

  • No tests added.
  • Suggest dtslint/type tests to confirm upper/lowercase values are accepted for Method and responseEncoding.

Written for commit 5b54575. 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
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

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.

Types Refactor: Duplicating literal types in Method & responseEncoding

1 participant