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

fix(publish): better GitHub API type-safety #122

Merged
merged 1 commit into from
Jul 11, 2024
Merged

Conversation

lachlancollins
Copy link
Member

@lachlancollins lachlancollins commented Jul 11, 2024

This error occurred on a TanStack Router workflow:

              if (data.items.length && data.items[0]) {
                             ^

TypeError: Cannot read properties of undefined (reading 'length')

This PR requires changes the API data type from {items: Array<{login: string}>} to unknown, and uses conditionals to narrow the type

Copy link

pkg-pr-new bot commented Jul 11, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

commit: f317b44

@tanstack/config

npm i https://pkg.pr.new/@tanstack/config@122

Copy link

nx-cloud bot commented Jul 11, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit f317b44. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@lachlancollins lachlancollins changed the title fix(publish): better type-safety for GitHub API fix(publish): better GitHub API type-safety Jul 11, 2024
@lachlancollins lachlancollins merged commit 2b70e90 into main Jul 11, 2024
4 checks passed
@lachlancollins lachlancollins deleted the safer-github-api branch July 11, 2024 04:44
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.

None yet

1 participant