Skip to content

Conversation

@avivkeller
Copy link
Member

Previously, any inlineCode block inside a list that matched the syntax of a typed-list would be considered valid. After this, the inlineCode's content must also be a valid JavaScript property (/^[a-z0-9$_]+$/i1). Additionally, previously, the node immediately following the property in a typed list was assumed to be a text node, however, in non-Typed lists, this could realisticly be any node, so a nullish check was added.

Footnotes

  1. Note: In this RegExp, properties can begin with numbers. This is intentional, since, in the event of an array, a number property may be valid in a typed list.

Copilot AI review requested due to automatic review settings August 19, 2025 21:07
@avivkeller avivkeller requested a review from a team as a code owner August 19, 2025 21:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves validation for typed list detection by adding stricter property syntax validation and safer null handling. It ensures that inline code blocks in typed lists contain valid JavaScript property names and adds defensive programming to handle potential null values.

  • Added validation to ensure inline code content matches valid JavaScript property syntax
  • Improved null safety by checking for undefined values before accessing properties
  • Extracted property validation logic to a reusable constant

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/utils/queries/index.mjs Enhanced typed list validation logic with property syntax checking and null safety
src/utils/queries/constants.mjs Added regex constant for JavaScript property validation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@codecov
Copy link

codecov bot commented Aug 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.25%. Comparing base (02d53de) to head (a71661d).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #414      +/-   ##
==========================================
- Coverage   74.22%   72.25%   -1.97%     
==========================================
  Files         118       96      -22     
  Lines       10994     9484    -1510     
  Branches      696      586     -110     
==========================================
- Hits         8160     6853    -1307     
+ Misses       2831     2629     -202     
+ Partials        3        2       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vercel
Copy link

vercel bot commented Aug 19, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
api-docs-tooling Ready Ready Preview Aug 22, 2025 11:25pm

Copy link
Member

@AugustinMauroy AugustinMauroy left a comment

Choose a reason for hiding this comment

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

Need to add test 😁

@avivkeller
Copy link
Member Author

Bump @nodejs/web-infra, this is a bug fix

Copy link
Member

@ovflowd ovflowd left a comment

Choose a reason for hiding this comment

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

LGTM!!

@avivkeller avivkeller merged commit 8cfd3e5 into main Aug 23, 2025
19 checks passed
@avivkeller avivkeller deleted the isTypedList-validate-prop branch August 23, 2025 01:01
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.

4 participants