Skip to content

feat(object): export ToCamelCaseKeys and ToSnakeCaseKeys types#1651

Open
Gdm0714 wants to merge 1 commit intotoss:mainfrom
Gdm0714:feat/export-case-keys-types
Open

feat(object): export ToCamelCaseKeys and ToSnakeCaseKeys types#1651
Gdm0714 wants to merge 1 commit intotoss:mainfrom
Gdm0714:feat/export-case-keys-types

Conversation

@Gdm0714
Copy link
Copy Markdown

@Gdm0714 Gdm0714 commented Mar 17, 2026

Summary

  • Export ToCamelCaseKeys type from toCamelCaseKeys.ts (was defined but not exported)
  • Export ToSnakeCaseKeys type from object/index.ts (was exported from file but not re-exported)
  • Add type re-exports in src/object/index.ts

Motivation

Users currently have to use ReturnType<typeof toCamelCaseKeys> to reference these types, which is verbose and fragile. Exporting them directly allows clean usage:

import type { ToCamelCaseKeys, ToSnakeCaseKeys } from 'es-toolkit';

Closes #1624

Test plan

  • All 181 object tests pass
  • No breaking changes — only additive type exports

Export utility types so users can reference them directly instead of
using ReturnType<typeof toCamelCaseKeys>.

Closes toss#1624
Copilot AI review requested due to automatic review settings March 17, 2026 02:33
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
es-toolkit Ready Ready Preview, Comment Mar 17, 2026 2:39am

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Exports previously-internal key-transform utility types so consumers can reference the resulting shapes directly (instead of using ReturnType<typeof ...>), aligning the public API with user needs raised in #1624.

Changes:

  • Export ToCamelCaseKeys from src/object/toCamelCaseKeys.ts.
  • Re-export ToCamelCaseKeys and ToSnakeCaseKeys from src/object/index.ts for top-level package access.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/object/toCamelCaseKeys.ts Makes ToCamelCaseKeys a public exported type.
src/object/index.ts Re-exports ToCamelCaseKeys / ToSnakeCaseKeys types from the object module entrypoint.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

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.

Export ToCamelCaseKeys and other useful types

2 participants