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

chore(utils/array): add isNotNullOrUndefined #22081

Merged
merged 1 commit into from May 11, 2023
Merged

chore(utils/array): add isNotNullOrUndefined #22081

merged 1 commit into from May 11, 2023

Conversation

cgrindel
Copy link
Contributor

Changes

Add isNotNullOrUndefined to lib/util/array. This predicate is useful for filtering arrays such that values that are null or undefined are excluded.

Related to #21893.

Context

In #21893, an array in the bazel-module manager is generated that can contain null values. These values should be ignored such that the resulting array should only contain entries with the typed value (e.g., T[]). The isNotNullOrUndefined predicate acts as a type guard such that the null and undefined values are removed and the type of the resulting array only contains the desired type.

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

@cgrindel
Copy link
Contributor Author

cc: @viceice

@secustor secustor added this pull request to the merge queue May 11, 2023
@secustor secustor removed this pull request from the merge queue due to a manual request May 11, 2023
@secustor secustor changed the title feat: add isNotNullOrUndefined to lib/util/array chore(utils/array): add isNotNullOrUndefined May 11, 2023
@secustor secustor added this pull request to the merge queue May 11, 2023
Merged via the queue into renovatebot:main with commit ebf064e May 11, 2023
11 checks passed
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 35.80.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@cgrindel cgrindel deleted the feat/21893_add_type_guard_for_not_null_or_undefined branch May 11, 2023 16:12
mjunker pushed a commit to mjunker/renovate that referenced this pull request May 17, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants