blakeembrey / blakeembrey/change-case

Type resulting object properties correctly when using change-case/keys

Open
#341 5 comments 2 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2.4k
Forks
106
PR merge metrics
No merged PRs in 30d

Description

When using `change-case/keys` I would love for the resulting object to be typed correctly without having to do an explicit cast. Currently all transformations produce `unknown`.

```ts
import { camelCase } from "change-case/keys"
import type { CamelCasedProperties } from 'type-fest';

const snake_cased = { foo_bar: 1 }

// Preferably the cast could be left off on the line below
const camelCased = camelCase(snake_cased) as CamelCasedProperties

console.log(camelCased.fooBar) // => 1
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by inspecting the change-case/keys entry point and its TypeScript type declarations. Reproduce the issue with the provided snake_cased example, then trace the existing typing and related tests. Done means the transformed result exposes fooBar without an explicit cast while preserving current behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.