Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add ts2swift Record to Dictionary mapping#582

Merged
kateinoigakukun merged 1 commit into
mainswiftwasm/JavaScriptKit:mainfrom
katei/3cb0-please-add-recorswiftwasm/JavaScriptKit:katei/3cb0-please-add-recorCopy head branch name to clipboard
Feb 5, 2026
Merged

Add ts2swift Record to Dictionary mapping#582
kateinoigakukun merged 1 commit into
mainswiftwasm/JavaScriptKit:mainfrom
katei/3cb0-please-add-recorswiftwasm/JavaScriptKit:katei/3cb0-please-add-recorCopy head branch name to clipboard

Conversation

@kateinoigakukun

Copy link
Copy Markdown
Member

Motivation:

  • Support ts2swift translation for Record<string, T> outputs.

Changes:

  • Map Record<string, T> (including alias instantiations) to [String: T] with a warning fallback for non-string keys.
  • Add Record fixture and refresh Vitest snapshot covering nested, optional, array, and object values plus unsupported key coverage.

@kateinoigakukun kateinoigakukun force-pushed the katei/0bd3-bridgejs-support branch from ee19ac2 to aa82380 Compare February 5, 2026 10:17
Base automatically changed from katei/0bd3-bridgejs-support to main February 5, 2026 10:49
…ript/src/processor.js`, mapping `Record<string, T>` to `[String: T]` (with JSObject fallback for non-string keys) by reading alias type arguments even when the type isn’t a `TypeReference`.

- Added a new fixture and refreshed Vitest snapshots to cover dictionary outputs, nested/optional records, array/object values, and unsupported key handling in `Plugins/BridgeJS/Sources/TS2Swift/JavaScript/test/fixtures/RecordDictionary.d.ts` and `.../__snapshots__/ts2swift.test.js.snap`.

Tests: `cd Plugins/BridgeJS/Sources/TS2Swift/JavaScript && npm test -- --update`.
@kateinoigakukun kateinoigakukun force-pushed the katei/3cb0-please-add-recor branch from 228b50f to 25683e4 Compare February 5, 2026 10:52
@kateinoigakukun kateinoigakukun merged commit 6b3a697 into main Feb 5, 2026
11 checks passed
@kateinoigakukun kateinoigakukun deleted the katei/3cb0-please-add-recor branch February 5, 2026 13:23
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.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.