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: correctly determine if array is empty #1005

Merged
merged 2 commits into from Dec 19, 2023
Merged

Conversation

dstaley
Copy link
Contributor

@dstaley dstaley commented Nov 22, 2023

🎟️ Asana Task
πŸ” Preview Link


Description

This PR fixes an empty array comparison. In JavaScript, arrays are objects, and equality comparisons only return true if both sides of the operator refer to the same object. By comparing to an empty array literal, this comparison will always return false. In recent versions of TypeScript, this is considered an error, which prevents builds using this code. This PR changes to compare by length instead.

PR Checklist πŸš€

Items in this checklist may not may not apply to your PR, but please consider each item carefully.

  • Add Asana and Preview links above.
  • Conduct thorough self-review.
  • Add or update tests as appropriate.
  • Conduct reasonable cross browser testing for both compatibility and responsive behavior (We have a Sauce Labs account for this, if you don't have access, just ask!).
  • Conduct reasonable accessibility review (use the WAS as a guide or an axe browser plugin until we establish more formal checks).
  • Identify (in the description above) and document (add Asana tasks on this board) any technical debt that you're aware of, but are not addressing as part of this PR.

@dstaley dstaley added the release:canary Triggers a canary release for commits to this pull request label Nov 22, 2023
Copy link

changeset-bot bot commented Nov 22, 2023

πŸ¦‹ Changeset detected

Latest commit: 5e9d77c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@hashicorp/react-docs-page Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Nov 22, 2023

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated (UTC)
react-components βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Dec 18, 2023 11:48pm

Copy link
Contributor

github-actions bot commented Nov 22, 2023

πŸ“¦ Canary Packages Published

Latest commit: 5e9d77c

Published 1 packages

@hashicorp/react-docs-page@17.9.1-canary-20231218234848

npm install @hashicorp/react-docs-page@canary

@dstaley dstaley requested review from a team and heatlikeheatwave and removed request for a team December 18, 2023 22:05
Co-authored-by: Heat Hamilton <55773810+heatlikeheatwave@users.noreply.github.com>
Copy link
Contributor

@heatlikeheatwave heatlikeheatwave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸš€ LGTM!

@dstaley dstaley merged commit 6964d98 into main Dec 19, 2023
7 checks passed
@dstaley dstaley deleted the ds.docs-page-ts-fix branch December 19, 2023 18:56
@hashibot-web hashibot-web mentioned this pull request Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:canary Triggers a canary release for commits to this pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants