Skip to content

fix(runtime-core): preserve snake case keys - #1657

Merged
joshunrau merged 1 commit into
DouglasNeuroInformatics:mainfrom
misaelalves99:fix/1635-preserve-snake-case-keys
Oct 6, 2026
Merged

joshunrau merged 1 commit into
DouglasNeuroInformatics:mainfrom
misaelalves99:fix/1635-preserve-snake-case-keys

Conversation

@misaelalves99

Copy link
Copy Markdown

What changed

  • Preserve object properties that are already in snake_case when converting keys with asSnakeCase.
  • Keep camelCase-to-snake_case conversion behaviour unchanged.
  • Promote the existing regression case from an expected failure to a normal passing test.

Fixes #1635

Regression proof

Before the implementation change, enabling the existing regression test produced:

  • expected: { age: 30, first_name: "Jane", last_name: "Doe" }
  • received: { last_name: "Doe" }

After the fix, the regression test passes normally.

Validation

  • pnpm exec vitest run --project runtime-core — 5 test files passed, 35 tests passed.
  • pnpm --filter @opendatacapture/runtime-core exec tsc --noEmit — passed.
  • pnpm --filter @opendatacapture/runtime-core exec eslint src — passed.
  • pnpm exec prettier --check packages/runtime-core/src/utils.ts packages/runtime-core/src/__tests__/utils.test.ts — passed.
  • pnpm --filter @opendatacapture/runtime-core build — passed, including API Extractor.
  • pnpm-lock.yaml remained unchanged.

@joshunrau
joshunrau merged commit 755295f into DouglasNeuroInformatics:main Oct 6, 2026
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.

asSnakeCase drops keys that are already snake_case

2 participants