Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Allow recursive type definition #26

Merged
merged 2 commits into from
Nov 26, 2024

Conversation

okuramasafumi
Copy link
Contributor

Let's say we have the following type:

type Chapter = {
  title: string
  next: Chapter | null
}

Here, Chapter type is recursive, referencing itself. Typelizer can generate this kind of type, but currently it tries to import itself and causes an error.
This PR fixes this issue by ignoring itself from import target.
Note that I added spec for Alba only since that was my case, but please tell me if I should add more specs for other serializers.

okuramasafumi and others added 2 commits November 21, 2024 02:54
Let's say we have the following type:

```typescript
type Chapter = {
  title: string
  next: Chapter | null
}
```

Here, `Chapter` type is recursive, referencing itself.
Typelizer can generate this kind of type, but currently it tries
to import itself and causes an error.
This commit fixes this issue by ignoring itself from import target.
Note that I added spec for Alba only since that was my case,
but please tell me if I should add more specs for other serializers.
@skryukov skryukov merged commit 5cd2dab into skryukov:main Nov 26, 2024
5 checks passed
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